Skip to content

fix(mcp): cap the mcp SDK below 2.0 and add a smoke CI matrix - #4

Open
wnykaza-ui wants to merge 2 commits into
moleculeprotocol:mainfrom
wnykaza-ui:fix/mcp-2-pin
Open

fix(mcp): cap the mcp SDK below 2.0 and add a smoke CI matrix#4
wnykaza-ui wants to merge 2 commits into
moleculeprotocol:mainfrom
wnykaza-ui:fix/mcp-2-pin

Conversation

@wnykaza-ui

Copy link
Copy Markdown

Fixes #3.

Commit 1, the pin. mcp/pyproject.toml and mcp/requirements.txt both declared mcp>=1.2.0 with no upper bound. The mcp Python SDK 2.0.0 removed the mcp.server.fastmcp module that mcp/server.py imports at line 56, so any clean install resolves to 2.0.0 and dies on import. Both files now declare mcp>=1.2.0,<2, which keeps the whole 1.x line eligible and blocks 2.x until the server is ported to the new API.

Commit 2, the CI. The repo had no .github directory and nothing ran mcp/smoke.py, which is why an upstream SDK release could break every clean install with no signal. This adds .github/workflows/smoke.yml, a matrix over ubuntu-latest and windows-latest across Python 3.11, 3.12 and 3.13, that installs mcp/requirements.txt and runs the smoke suite. It needs no network and no secrets, so it runs on forks and pull requests without configuration.

Two details make the Windows leg work. Every step runs under bash so $GITHUB_ENV and the heredoc behave identically on both runners. And smoke.py picks its subprocess interpreter with os.environ.get("PYTHON", HERE/".venv"/"bin"/"python"). That fallback is POSIX only and CI never creates a .venv anyway, so a step exports PYTHON from sys.executable before the run. This uses the existing override rather than changing smoke.py, keeping this PR scoped to the dependency bug plus coverage.

A guard step imports mcp.server.fastmcp and asserts the resolved major version is below 2, so the job fails loudly if the cap ever stops holding.

Verification. Fresh python -m venv, pip install -r mcp/requirements.txt with the new pin, resolved mcp 1.29.0 instead of 2.0.0, then ran the suite. The server boots clean, lists all 23 tools and every assertion passes:

TOOL COUNT: 23
ALL ASSERTIONS PASS: True

Exit code 0. Verified on Windows 11 with Python 3.14 using the PYTHON override, which is the same mechanism the Windows CI leg uses. The ModuleNotFoundError was also reproduced directly against mcp==2.0.0 in a throwaway venv to confirm the cause.

Not included here. The Windows .venv/bin/python hardcode in smoke.py line 32 and the three mcp/README.md references are left alone, as is an abi_encode bool coercion finding. Happy to send those as follow ups so this PR stays reviewable.

wnykaza-ui and others added 2 commits August 10, 2026 13:38
The dependency was pinned as an unbounded "mcp>=1.2.0" in both
mcp/pyproject.toml and mcp/requirements.txt. mcp SDK 2.0.0 is now the
version pip resolves to, and 2.0.0 removed the mcp.server.fastmcp module
that server.py imports at line 56. A clean install therefore fails at
import time with ModuleNotFoundError.

Cap the range at "mcp>=1.2.0,<2" in both files. This keeps every 1.x
release eligible and blocks the breaking 2.x line until the server is
ported to the new API.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The repo had no .github directory and nothing ran mcp/smoke.py, so an
upstream SDK release could break every clean install without a signal.
This adds a matrix over ubuntu-latest and windows-latest across Python
3.11, 3.12 and 3.13 that installs mcp/requirements.txt and runs the
suite. It needs no network and no secrets.

Two details make the Windows leg work. Every step runs under bash so
GITHUB_ENV and the heredoc behave the same on both runners. And smoke.py
selects its subprocess interpreter with
os.environ.get("PYTHON", HERE/".venv"/"bin"/"python"), a fallback that is
POSIX-only and that CI never creates anyway, so a step exports PYTHON
from sys.executable before the run.

A guard step imports mcp.server.fastmcp and asserts the resolved major
version is below 2, which fails loudly if the cap ever stops holding.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

Clean install fails on mcp 2.x: ModuleNotFoundError: No module named 'mcp.server.fastmcp' (unbounded mcp>=1.2.0 pin)

1 participant