Skip to content

fix(mcp): name a fastmcp/mcp mismatch and its repair (2.158.4) - #228

Merged
drknowhow merged 2 commits into
mainfrom
fix/mcp-stack-mismatch
Oct 23, 2026
Merged

drknowhow merged 2 commits into
mainfrom
fix/mcp-stack-mismatch

Conversation

@drknowhow

Copy link
Copy Markdown
Owner

With fastmcp 3.x installed, a pip install of another tool that wants mcp 2.x upgrades mcp anyway. from fastmcp import then fails with cannot import name 'McpError' from 'mcp', and the C3 MCP server dies before its handshake in every session, so the host reports only a closed connection. Now, when that import fails because the installed fastmcp and mcp versions don't fit together, the server prints the mismatch and the pip command that repairs it, then exits 1. The SessionStart hook puts the same message into the session. Checked on fastmcp 3.2.4 + mcp 2.3.0, which prints the message, and on 4.1.3 + 2.3.0, where the handshake completes and 24 tools are listed. Local full suite: 4998 passed, 8 skipped; the one failure, test_no_text_open_without_encoding, comes only from untracked local .wt/ worktrees.

https://claude.ai/code/session_019S3KVhMUwYBjYF5e9nQrXW

fastmcp 3.x pins mcp<2, but installing another tool that wants mcp 2.x
moves mcp anyway, so `from fastmcp import` failed and the MCP server died
before its handshake with nothing the session could see. The server now
prints the mismatch and the pip repair and exits 1; the SessionStart hook
adds the same message to the session. Checked on fastmcp 3.2.4 + mcp 2.3.0
(message) and 4.1.3 + 2.3.0 (handshake, 24 tools). Full suite: 4998 passed,
8 skipped; test_no_text_open_without_encoding fails only on untracked .wt/.

Claude-Session: https://claude.ai/code/session_019S3KVhMUwYBjYF5e9nQrXW
@drknowhow
drknowhow merged commit f78032f into main Oct 23, 2026
12 checks passed
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