You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the search: this was reported before, in #4246, with a fix proposed in #4247; both were closed on 2026-07-31. I am filing again because the situation
has changed since then — the break now fails CI on every pull request, and on master — and because I ran into it independently on my own PR (#4292) rather
than from those threads. If the earlier closure already reflected a decision
against capping mcp, please just close this; I would rather ask than assume.
Installed from source with pip install -e . in a clean Python 3.11 venv
(CI uses 3.10 and shows the same failure)
camel 0.2.91a5
Resolved mcp version: 2.1.0
Problem description
camel/toolkits/base.py:68 does from mcp.server import FastMCP inside the BaseToolkit class body. mcp 2.x removed FastMCP entirely — the string FastMCP does not appear anywhere in the 2.1.0 wheel (0 files, 0 occurrences); mcp.server now exports MCPServer instead.
pyproject.toml:24 pins mcp>=1.3.0 with no upper bound (same in the dev_tools and all extras). uv.lock resolves mcp==1.28.1, so every
uv-based install is fine — which is why this is invisible in local development.
Any install that does not use the lock resolves to mcp 2.1.0, and importing camel.agents, camel.societies or camel.societies.workforce fails.
What is newly broken. The Minimal dependency check job installs with plain pip install -e ., so it hits this. Its last 8 runs, across 6 unrelated
branches and several authors, are all failures:
pytest_package on master (push runs) is affected too: green at 473388d3
(run of 2026-08-14), failing at 76da662d and bc07a096 (runs of 2026-08-21),
with 117 collection errors — 116 of them this same FastMCP ImportError. No
camel commit lands between 473388d3 and 76da662d, so the trigger is on the mcp side.
Reproducible example code
The Python snippets:
# after `pip install -e .` in a clean venvimportimportlib.metadataasmprint(m.version("mcp")) # 2.1.0importmcp.serverassprint(hasattr(s, "FastMCP")) # Falseprint(hasattr(s, "MCPServer")) # Trueimportcamel.agents# ImportError
none -- this is the Minimal dependency check job's own command
Steps to reproduce:
Clean venv, pip install -e . on unmodified master. mcp resolves to
2.1.0.
Run the job's command above. Result: 3 failed, 4 passed, 1 deselected —
the three failures are camel.agents, camel.societies and camel.societies.workforce, exactly the three the CI job reports.
Traceback
camel/agents/__init__.py:15: in <module>
from .chat_agent import ChatAgent
camel/agents/chat_agent.py:61: in <module>
from camel.agents._utils import (
camel/agents/_utils.py:21: in <module>
from camel.toolkits import FunctionTool
camel/toolkits/__init__.py:24: in <module>
from .math_toolkit import MathToolkit
camel/toolkits/math_toolkit.py:18: in <module>
from camel.toolkits.base import BaseToolkit
camel/toolkits/base.py:61: in <module>
class BaseToolkit(metaclass=AgentOpsMeta):
camel/toolkits/base.py:68: in BaseToolkit
from mcp.server import FastMCP
E ImportError: cannot import name 'FastMCP' from 'mcp.server'
Expected behavior
pip install -e . on master should produce an importable camel.agents, and Minimal dependency check should pass.
Additional context
Two possible fixes, and I want to be explicit that I picked the smaller one:
Migrate to the mcp 2.x API (mcp.server.MCPServer) — this touches camel/toolkits/base.py, camel/utils/mcp.py, MCPToolkit, MCPAgent and mcp_client. Note that fix(toolkits): import FastMCP from mcp.server.fastmcp #4238's approach of importing from mcp.server.fastmcp cannot work: that module does not exist in 2.x either.
I have (1) ready and measured, in clean Python 3.11 venvs running the job's own
command:
resolved mcp
result
master
2.1.0
3 failed, 4 passed
with the cap
1.29.1
7 passed
The uv.lock change is only the three specifier records; the locked mcp
version stays at 1.28.1, so nothing else in the lock moves. Capping does not
block (2) later.
Happy to open the PR, or to leave it if you would rather go straight to the 2.x
migration.
Required prerequisites
On the search: this was reported before, in #4246, with a fix proposed in
#4247; both were closed on 2026-07-31. I am filing again because the situation
has changed since then — the break now fails CI on every pull request, and on
master— and because I ran into it independently on my own PR (#4292) ratherthan from those threads. If the earlier closure already reflected a decision
against capping
mcp, please just close this; I would rather ask than assume.What version of camel are you using?
0.2.91a5 (current master, 13dc7a7)
System information
pip install -e .in a clean Python 3.11 venv(CI uses 3.10 and shows the same failure)
mcpversion: 2.1.0Problem description
camel/toolkits/base.py:68doesfrom mcp.server import FastMCPinside theBaseToolkitclass body.mcp2.x removedFastMCPentirely — the stringFastMCPdoes not appear anywhere in the 2.1.0 wheel (0 files, 0 occurrences);mcp.servernow exportsMCPServerinstead.pyproject.toml:24pinsmcp>=1.3.0with no upper bound (same in thedev_toolsandallextras).uv.lockresolvesmcp==1.28.1, so everyuv-based install is fine — which is why this is invisible in local development.
Any install that does not use the lock resolves to
mcp2.1.0, and importingcamel.agents,camel.societiesorcamel.societies.workforcefails.What is newly broken. The
Minimal dependency checkjob installs with plainpip install -e ., so it hits this. Its last 8 runs, across 6 unrelatedbranches and several authors, are all failures:
pytest_packageonmaster(push runs) is affected too: green at473388d3(run of 2026-08-14), failing at
76da662dandbc07a096(runs of 2026-08-21),with 117 collection errors — 116 of them this same
FastMCPImportError. Nocamel commit lands between
473388d3and76da662d, so the trigger is on themcpside.Reproducible example code
The Python snippets:
Command lines:
Extra dependencies:
Steps to reproduce:
pip install -e .on unmodifiedmaster.mcpresolves to2.1.0.
3 failed, 4 passed, 1 deselected—the three failures are
camel.agents,camel.societiesandcamel.societies.workforce, exactly the three the CI job reports.Traceback
Expected behavior
pip install -e .onmastershould produce an importablecamel.agents, andMinimal dependency checkshould pass.Additional context
Two possible fixes, and I want to be explicit that I picked the smaller one:
mcpbelow 2.0.0 — three one-line specifier changes inpyproject.tomlplus the matchinguv.lockentries. This is what fix(deps): cap mcp below 2.0.0, which removed FastMCP #4247proposed.
mcp.server.MCPServer) — this touchescamel/toolkits/base.py,camel/utils/mcp.py,MCPToolkit,MCPAgentandmcp_client. Note that fix(toolkits): import FastMCP from mcp.server.fastmcp #4238's approach of importing frommcp.server.fastmcpcannot work: that module does not exist in 2.x either.I have (1) ready and measured, in clean Python 3.11 venvs running the job's own
command:
mcpmasterThe
uv.lockchange is only the threespecifierrecords; the lockedmcpversion stays at 1.28.1, so nothing else in the lock moves. Capping does not
block (2) later.
Happy to open the PR, or to leave it if you would rather go straight to the 2.x
migration.