fix(deps): pin mcp SDK to <2.0.0 in MCP server examples - #46
Open
Dao-you wants to merge 1 commit into
Open
Conversation
mcp 2.0.0 removed the legacy `Server` decorator API (`@app.list_resources()`,
`@app.list_tools()`, ...) that src/mssql_mcp_server/server.py is built on, so
an unconstrained install crashes at import time with:
AttributeError: 'Server' object has no attribute 'list_resources'
This bites `uvx --from git+...` launches in particular: they re-resolve
dependencies on every cold start and ignore uv.lock, so the server broke the
moment 2.0.0 hit PyPI. Consumers had to work around it with
`--with "mcp<2.0.0"` in their MCP client config.
- pyproject.toml / requirements.txt: mcp>=1.0.0 -> mcp>=1.0.0,<2.0.0
- uv.lock: regenerated (also picks up the stale project name
mssql-mcp-server -> microsoft-sql-server-mcp)
- README.md: document the pin and the condition for removing it
Verified: `uv pip compile pyproject.toml` now resolves mcp==1.29.0, and
`import mssql_mcp_server.server` succeeds. This is a stopgap - the real fix is
migrating the server to the 2.x API.
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.
Problem
mcp2.0.0 removed the legacyServerdecorator API this server is built on, so thepackage now fails at import time:
pyproject.tomldeclaredmcp>=1.0.0with no upper bound.uvx --from git+...launchesre-resolve dependencies on every cold start and ignore
uv.lock, so every client usingthat install path broke the moment 2.0.0 hit PyPI — no config or database change involved.
The only workaround was
--with "mcp<2.0.0"in each MCP client config.Change
pyproject.toml/requirements.txt:mcp>=1.0.0→mcp>=1.0.0,<2.0.0uv.lock: regenerated (also picks up the stale project namemssql-mcp-server→microsoft-sql-server-mcp)README.md: new "Dependency notes" section recording the pin and the condition for removing itVerification
uv pip compile pyproject.toml→mcp==1.29.0(this is the pathuvxtakes)import mssql_mcp_server.serversucceedsmcp1.2.0, so thepin is a no-op for
uv run. The 39 pre-existing failures intests/are untouched.Follow-up
This is a stopgap, not a migration. Removing the upper bound requires porting
server.pyto themcp2.x API.