A fresh install of Nerve currently fails at startup with:
ImportError: cannot import name 'request_ctx' from 'mcp.server.lowlevel.server'
(/home/ubuntu/nerve/.venv/lib/python3.13/site-packages/mcp/server/lowlevel/server.py)
Root cause
The mcp Python SDK released version 2.0.0, which removed request_ctx from mcp.server.lowlevel.server. Since the dependency chain doesn't set an upper bound on mcp, dependency resolution on a fresh install now picks up the incompatible 2.x release. This affects every new install (and any nerve upgrade that reinstalls deps), regardless of whether the import originates in Nerve itself or in a transitive dependency such as claude-agent-sdk.
Steps to reproduce
- Fresh install per the README (installer script or manual
uv pip install -e .)
nerve start -f
- Startup fails with the ImportError above
Environment
- Nerve: latest
main
- Python: 3.13 (uv-managed venv)
- OS: Ubuntu
mcp resolved to 2.x
Workaround
Pinning the SDK back to 1.x fixes it:
source .venv/bin/activate
uv pip install 'mcp<2'
nerve restart
Note that nerve upgrade reinstalls dependencies and can pull 2.x back in, so the pin has to be reapplied after upgrades.
Suggested fix
Add an upper-bound constraint (mcp<2, or explicitly mcp>=1.x,<2) to pyproject.toml until the codebase / claude-agent-sdk is compatible with the mcp 2.0 API.
A fresh install of Nerve currently fails at startup with:
Root cause
The
mcpPython SDK released version 2.0.0, which removedrequest_ctxfrommcp.server.lowlevel.server. Since the dependency chain doesn't set an upper bound onmcp, dependency resolution on a fresh install now picks up the incompatible 2.x release. This affects every new install (and anynerve upgradethat reinstalls deps), regardless of whether the import originates in Nerve itself or in a transitive dependency such asclaude-agent-sdk.Steps to reproduce
uv pip install -e .)nerve start -fEnvironment
mainmcpresolved to 2.xWorkaround
Pinning the SDK back to 1.x fixes it:
Note that
nerve upgradereinstalls dependencies and can pull 2.x back in, so the pin has to be reapplied after upgrades.Suggested fix
Add an upper-bound constraint (
mcp<2, or explicitlymcp>=1.x,<2) topyproject.tomluntil the codebase /claude-agent-sdkis compatible with the mcp 2.0 API.