Summary
pyproject.toml declares mcp>=1.0.0 with no upper bound. On a fresh uv tool install cocoindex-code[full], the resolver picks the latest available mcp (currently 2.0.0), which no longer ships mcp.server.fastmcp (the module appears to have been restructured/renamed, e.g. into mcp.server.mcpserver). Since cocoindex_code/server.py still does from mcp.server.fastmcp import FastMCP, ccc mcp crashes on startup.
Environment
cocoindex-code v0.2.39 (latest at time of filing)
- Installed via
uv tool install cocoindex-code[full]
- Resulting
mcp version: 2.0.0
- Python 3.12.9 (uv-managed)
- Linux
Steps to reproduce
uv tool install cocoindex-code[full]
cd <any project>
ccc init
ccc mcp
Actual result
ModuleNotFoundError: No module named 'mcp.server.fastmcp'
Full traceback (trimmed to the relevant frames):
File ".../cocoindex_code/cli.py", line 1041, in mcp
asyncio.run(_run_mcp())
File ".../cocoindex_code/cli.py", line 1028, in _run_mcp
from .server import create_mcp_server, run_heartbeat_loop
File ".../cocoindex_code/server.py", line 17, in <module>
from mcp.server.fastmcp import FastMCP
ModuleNotFoundError: No module named 'mcp.server.fastmcp'
This also surfaces indirectly when the MCP client (e.g. Claude Code) tries to connect to the ccc mcp server and gets -32000: Connection closed, since the subprocess dies immediately on import.
Root cause
pyproject.toml:
dependencies = [
"mcp>=1.0.0",
...
]
No upper bound means any future mcp major release that changes its public API (as 2.0.0 apparently did, removing/renaming mcp.server.fastmcp) will silently break cocoindex-code for new installs, with no warning at install time.
Workaround
Force-install a compatible mcp version:
uv tool install "cocoindex-code[full]" --with 'mcp<2.0' --force
This resolves mcp==1.29.0 (which still has mcp.server.fastmcp) and ccc mcp starts correctly.
Suggested fix
Pin an upper bound on mcp in pyproject.toml, e.g. mcp>=1.0.0,<2.0.0, until the codebase is updated to support mcp 2.x's new API surface (or add explicit support for both and adjust the constraint accordingly).
Happy to provide more details if useful.
Summary
pyproject.tomldeclaresmcp>=1.0.0with no upper bound. On a freshuv tool install cocoindex-code[full], the resolver picks the latest availablemcp(currently2.0.0), which no longer shipsmcp.server.fastmcp(the module appears to have been restructured/renamed, e.g. intomcp.server.mcpserver). Sincecocoindex_code/server.pystill doesfrom mcp.server.fastmcp import FastMCP,ccc mcpcrashes on startup.Environment
cocoindex-codev0.2.39 (latest at time of filing)uv tool install cocoindex-code[full]mcpversion:2.0.0Steps to reproduce
Actual result
Full traceback (trimmed to the relevant frames):
This also surfaces indirectly when the MCP client (e.g. Claude Code) tries to connect to the
ccc mcpserver and gets-32000: Connection closed, since the subprocess dies immediately on import.Root cause
pyproject.toml:No upper bound means any future
mcpmajor release that changes its public API (as2.0.0apparently did, removing/renamingmcp.server.fastmcp) will silently breakcocoindex-codefor new installs, with no warning at install time.Workaround
Force-install a compatible
mcpversion:This resolves
mcp==1.29.0(which still hasmcp.server.fastmcp) andccc mcpstarts correctly.Suggested fix
Pin an upper bound on
mcpinpyproject.toml, e.g.mcp>=1.0.0,<2.0.0, until the codebase is updated to supportmcp2.x's new API surface (or add explicit support for both and adjust the constraint accordingly).Happy to provide more details if useful.