Skip to content

fix(deps): keep FastMCP 2 on the MCP 1.x SDK - #307

Open
Elon-Jiang wants to merge 1 commit into
ANative-Lab:mainfrom
Elon-Jiang:fix/mcp-sdk-v1-compatibility
Open

Elon-Jiang wants to merge 1 commit into
ANative-Lab:mainfrom
Elon-Jiang:fix/mcp-sdk-v1-compatibility

Conversation

@Elon-Jiang

Copy link
Copy Markdown

Problem

A fresh uv sync --all-extras --python 3.12 on main e3df9006 selects FastMCP 2.14.1 with MCP SDK 2.3.0. from evoagentx.workflow import WorkFlow then fails before any workflow runs:

fastmcp/server/server.py:38: from mcp.shared.exceptions import McpError
ImportError: cannot import name 'McpError' from 'mcp.shared.exceptions'

FastMCP 2's dependency has a lower bound but allows SDK 2, whose exception/API names changed. This is inside the installed FastMCP package, distinct from the EvoAgentX-owned exception import already fixed in #239.

Change

Keep the existing FastMCP 2 integration on mcp<2 in the tools and all extras and the matching flat requirements. No core API or tool implementation changes.

Add a real local stdio regression: import the public workflow entry point, start a Python FastMCP server, discover its arithmetic tool through EvoAgentX's MCPClient, and call it through Toolkit/MCPTool (2 + 3 -> 5). There are no transport/server mocks or external MCP/model services.

Validation

  • Exact original main with its default SDK 2 resolution: public workflow import and the new regression fail. Original code with compatible SDK 1.30.0 is a passing control.
  • After the manifest fix, a normal clean uv sync --locked --all-extras selects MCP 1.30.0 without a manual SDK override. Four related checks pass; full suite 270 passed, 9 warnings.
  • Flat requirements.txt resolution selects MCP 1.30.0. Built-wheel metadata contains the SDK upper bound for both tools and all. Distribution build and new-test Ruff checks pass.
  • Repository-wide Ruff still reports the same 6,191 existing diagnostics as the exact original; no production Python changed and global lint is not claimed to pass.
  • The existing stdio-client shutdown emits an event-loop-closed cleanup warning in the native test. The same warning reproduces on unchanged code with the compatible SDK; this dependency fix does not change client shutdown.

Prepared with AI assistance. No independent human review is claimed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant