fix(mcp): adapt to mcp 2.0.0 SDK API changes - #344
Closed
1Beekeeper wants to merge 1 commit into
Closed
Conversation
The mcp>=1.0.0 dependency resolves to 2.0.0, a breaking release that renamed FastMCP->MCPServer (mcp.server.fastmcp->mcp.server.mcpserver), moved transport_security from the constructor to streamable_http_app(), renamed several Tool/CallToolResult fields to snake_case (inputSchema->input_schema, structuredContent->structured_content), and dropped the unused session-id callback from streamable_http_client's return tuple. Co-Authored-By: Claude Sonnet 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.
Summary
pyproject.toml'smcp>=1.0.0constraint currently resolves tomcp==2.0.0, a breaking release of the official MCP Python SDK, which brokeuv run pyteston a fresh clone (ModuleNotFoundError: No module named 'mcp.server.fastmcp').mcp.server.fastmcp.FastMCP->mcp.server.mcpserver.MCPServertransport_securitymoved from theMCPServer()constructor to.streamable_http_app()Tool.inputSchema->Tool.input_schema,CallToolResult.structuredContent->CallToolResult.structured_content(SDK renamed several fields to snake_case)streamable_http_client(...)now yields a 2-tuple(read_stream, write_stream)instead of 3 (dropped an unused session-id callback)Test plan
uv run pytest -q— 1153 passed, 6 skipped, 0 failed (previously failed at collection)🤖 Generated with Claude Code