feat(docker): migrate mcp_bridge to the mcp v2 low-level API - #2149
Open
weike-zhang wants to merge 2 commits into
Open
feat(docker): migrate mcp_bridge to the mcp v2 low-level API#2149weike-zhang wants to merge 2 commits into
weike-zhang wants to merge 2 commits into
Conversation
weike-zhang
force-pushed
the
feat/mcp-v2-migration
branch
from
August 20, 2026 05:21
61fbbc7 to
40a1e87
Compare
mcp 2.0.0 replaced the v1 decorator-based Server registration with constructor-based on_* handlers, and Server.run now speaks SessionMessage envelopes instead of raw JSONRPCMessage. - register on_list_tools/on_call_tool/on_list_resources/on_read_resource/ on_list_resource_templates via the Server constructor - wrap WS frames in SessionMessage and unwrap replies - require mcp>=2.0.0 (supersedes the mcp<2 cap from unclecode#2148)
weike-zhang
force-pushed
the
feat/mcp-v2-migration
branch
from
August 20, 2026 05:23
40a1e87 to
36e5e5c
Compare
mcp 2.0.0 requires sse-starlette>=3.0.0, which conflicts with the pinned ==2.2.1. Loosen the pin so the mcp v2 migration resolves cleanly.
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 #2147 (mcp 2.0.0 broke the docker server). Supersedes the
mcp<2cap from #2148 by migrating the code forward instead of pinning.What changed
deploy/docker/mcp_bridge.pywas using the mcp v1 low-level API:Server.list_tools()/call_tool()/list_resources()/read_resource()/list_resource_templates()decorators — removed in mcp 2.0.0Server.run()talking rawJSONRPCMessageframes over the WS transportv2 migration
Serverconstructor:on_list_tools,on_call_tool,on_list_resources,on_read_resource,on_list_resource_templates. Each handler receives(ctx, params);params.name/params.argumentsandparams.urimap 1:1 to the oldname/arguments/namearguments.ListToolsResult,CallToolResult,ReadResourceResult, ...) instead of bare lists._tools_data,_resources_data,_templates_data) extracted so the/mcp/schemaendpoint no longer needs to invoke MCP handlers directly.SessionMessage(message=...)and unwraps outboundSessionMessage.message(v2Server.runno longer accepts rawJSONRPCMessage).deploy/docker/requirements.txt:mcp>=1.18.0→mcp>=2.0.0.Verification (against
mcp==2.0.0)/mcp/ssehandshake +tools/list+tools/call(through the loopback HTTP proxy + AuthGate service token) +/mcp/schemaall pass./mcp/wsclient:initialize,tools/list,tools/callall respond correctly (previously the server closed the socket with no response).If this merges, #2148's
<2pin is no longer needed.