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
Open
fix(mcp): cap the mcp SDK below 2.0 and add a smoke CI matrix#4wnykaza-ui wants to merge 2 commits into
wnykaza-ui wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3.
Commit 1, the pin.
mcp/pyproject.tomlandmcp/requirements.txtboth declaredmcp>=1.2.0with no upper bound. The mcp Python SDK 2.0.0 removed themcp.server.fastmcpmodule thatmcp/server.pyimports at line 56, so any clean install resolves to 2.0.0 and dies on import. Both files now declaremcp>=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
.githubdirectory and nothing ranmcp/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 overubuntu-latestandwindows-latestacross Python 3.11, 3.12 and 3.13, that installsmcp/requirements.txtand 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
bashso$GITHUB_ENVand the heredoc behave identically on both runners. Andsmoke.pypicks its subprocess interpreter withos.environ.get("PYTHON", HERE/".venv"/"bin"/"python"). That fallback is POSIX only and CI never creates a.venvanyway, so a step exportsPYTHONfromsys.executablebefore the run. This uses the existing override rather than changingsmoke.py, keeping this PR scoped to the dependency bug plus coverage.A guard step imports
mcp.server.fastmcpand 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.txtwith the new pin, resolvedmcp 1.29.0instead of 2.0.0, then ran the suite. The server boots clean, lists all 23 tools and every assertion passes:Exit code 0. Verified on Windows 11 with Python 3.14 using the
PYTHONoverride, which is the same mechanism the Windows CI leg uses. TheModuleNotFoundErrorwas also reproduced directly againstmcp==2.0.0in a throwaway venv to confirm the cause.Not included here. The Windows
.venv/bin/pythonhardcode insmoke.pyline 32 and the threemcp/README.mdreferences are left alone, as is anabi_encodebool coercion finding. Happy to send those as follow ups so this PR stays reviewable.