Migrate MCP adapter to mcp 2.0, lift the <2 pin - #105
Merged
Conversation
mcp 2.0.0 removed mcp.server.fastmcp. Port create_mcp_server to mcp.server.mcpserver.MCPServer: add_tool() for dynamic registration, snake_case ToolAnnotations fields. Serve moves host/port/ transport_security from mcp.settings to run() kwargs. Pin becomes mcp[cli]>=2,<3. Part of #98
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.
Part of #98.
What: mcp 2.0.0 removed
mcp.server.fastmcp; #97 pinnedmcp[cli]>=1.0,<2to unblock CI. This ports the adapter to the mcp 2.0 high-level server and lifts the pin tomcp[cli]>=2,<3.How:
mcp_adapter.py:FastMCP→mcp.server.mcpserver.MCPServer; dynamic registration viaadd_tool(wrapper, annotations=...)(drops thetool()(wrapper)decorator dance);ToolAnnotationsfields now snake_case.cli/api.py: 2.0 removed host/port/transport_security from server settings — they arerun(transport="streamable-http", ...)kwargs now.wrapper.__signature__unchanged;list_tools()still async.Gate: ruff clean, 750/750 on mcp 2.0.0 (fresh
uv sync).Live-verify (local): booted
neurostack serve --transport httpon 0.0.0.0:18901 — initialize OK, tools/list = 28 tools with wire annotations (readOnlyHint/openWorldHint),vault_statscall returned real stats,isError: false.