Skip to content

fix(deps): bound mcp to <2.0.0 to keep tests on the 1.x line - #341

Open
lhs1695 wants to merge 1 commit into
HKUDS:mainfrom
lhs1695:fix/mcp-version-pin
Open

fix(deps): bound mcp to <2.0.0 to keep tests on the 1.x line#341
lhs1695 wants to merge 1 commit into
HKUDS:mainfrom
lhs1695:fix/mcp-version-pin

Conversation

@lhs1695

@lhs1695 lhs1695 commented Aug 4, 2026

Copy link
Copy Markdown

Summary

Bound the mcp dependency to <2.0.0 in pyproject.toml.

Problem: The constraint was mcp>=1.0.0 with no upper bound. MCP SDK 2.0 removed mcp.server.fastmcp, which the test suite relies on (tests/test_mcp/test_http_flow.py, tests/fixtures/fake_mcp_server.py). On a fresh pip install, the resolver picks mcp 2.x and test collection fails with ModuleNotFoundError: No module named 'mcp.server.fastmcp'. The harness runtime itself was developed against the mcp 1.x line (its mcp/ module only uses the client APIs, which still exist in 2.x).

Change: "mcp>=1.0.0""mcp>=1.0.0,<2.0.0".

Verification

  • pip install "mcp>=1.0.0,<2.0.0" resolves to mcp 1.29.0 (the 1.x line).
  • pytest tests/test_mcp/17 passed (previously collection errored on the fastmcp import).
  • Full suite: 1135 passed, 13 failed (pre-existing Windows-platform-specific failures unrelated to this change), 11 skipped.

Notes

  • ruff check src tests scripts with ruff 0.16.1 reports 681 pre-existing lint errors across the untouched codebase; none are introduced by this change (only pyproject.toml and CHANGELOG.md are touched).

MCP SDK 2.0 removed mcp.server.fastmcp, which the test suite uses for
mock MCP servers. The unrestricted mcp>=1.0.0 constraint resolves to
2.x on fresh installs and breaks test collection. Pin mcp<2.0.0 so
pip/uv pick a version the harness was developed against.
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