Repository navigation
fix(mcp): name a fastmcp/mcp mismatch and its repair (2.158.4) - #228
Merged
Merged
Conversation
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
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.
With fastmcp 3.x installed, a
pip installof another tool that wants mcp 2.x upgrades mcp anyway.from fastmcp importthen fails withcannot 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