Skip to content

fix(python): cap mcp dependency to <2 across all Python servers - #4577

Open
cyforkk wants to merge 2 commits into
modelcontextprotocol:mainfrom
cyforkk:fix/all-python-servers-mcp-version-cap
Open

fix(python): cap mcp dependency to <2 across all Python servers#4577
cyforkk wants to merge 2 commits into
modelcontextprotocol:mainfrom
cyforkk:fix/all-python-servers-mcp-version-cap

Conversation

@cyforkk

@cyforkk cyforkk commented Jul 29, 2026

Copy link
Copy Markdown

Description

Closes #4560, #4570

The mcp SDK 2.0.0 renamed McpError to MCPError, breaking imports in servers that had no upper bound on the mcp dependency. All unpinned launchers (like uvx) resolved to 2.0.0 and failed at startup.

This PR caps the mcp dependency to <2 in all three Python servers:

  • mcp-server-time: mcp>=1.23.0mcp>=1.23.0,<2
  • mcp-server-fetch: mcp>=1.1.3mcp>=1.1.3,<2
  • mcp-server-git: mcp>=1.0.0mcp>=1.0.0,<2

Lockfiles are regenerated with the default PyPI index to ensure CI compatibility.

Changes

  • src/time/pyproject.toml + src/time/uv.lock
  • src/fetch/pyproject.toml + src/fetch/uv.lock
  • src/git/pyproject.toml + src/git/uv.lock

Checklist

Co-Authored-By: Claude Fable 5 noreply@anthropic.com

mcp 2.0.0 renamed McpError to MCPError, breaking imports in
servers with no upper bound. Cap mcp to <2 in all three Python
servers (time, fetch, git) and regenerate lockfiles with the
default PyPI index.

Closes modelcontextprotocol#4560, modelcontextprotocol#4570

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Ecocitizenz

Ecocitizenz commented Jul 29, 2026 via email

Copy link
Copy Markdown

@sahildayal

Copy link
Copy Markdown

Independent confirmation that this reproduces and that the cap resolves it, covering both git and fetch (Windows, uv 0.11.32).

Unconstrained (uv resolves mcp 2.0.0):

  • uvx mcp-server-gitAttributeError: 'Server' object has no attribute 'list_tools'
  • uvx mcp-server-fetchImportError: cannot import name 'McpError' from 'mcp.shared.exceptions'

One gotcha worth flagging for anyone verifying this: --help exits 0 in both cases, because the failure happens inside serve(). A smoke test that only shells out to --help reports both servers as healthy — that cost me a green CI run before I caught it.

With mcp<2 (resolves 1.29.0), both start and complete a real MCP initialize handshake. Verified with the official @modelcontextprotocol/sdk client rather than a process-exit check:

server result
mcp-server-git 12 tools (git_status, git_diff, git_commit, git_log, …)
mcp-server-fetch 1 tool (fetch)

Also confirming the scope of the break, since it affects whether a cap is the right stopgap: on 2.0.0 list_tools is absent from both mcp.server.Server and mcp.server.lowlevel.Server, and the surface is now add_request_handler / add_notification_handler. So this is an API redesign rather than a rename — which is presumably why #4564 and #4565 need real handler-registration changes, and why capping is a reasonable stopgap in the meantime.

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.

fetch: ImportError on startup with mcp SDK 2.0.0 (McpError renamed to MCPError)

3 participants