Repository navigation
feat: run on MCP Python SDK 2.x - #8
Merged
Merged
Conversation
SDK 2.x replaced the Server.list_tools()/call_tool() decorators with on_list_tools/on_call_tool handlers passed to the constructor, which take a request context and return ListToolsResult/CallToolResult. The tool bodies are unchanged; create_server now wires them through those handlers. The 1.x decorator also validated arguments against the tool's input schema and turned a raising tool into an error result. 2.x leaves both to the handler, so on_call_tool keeps them, with the same messages. jsonschema is now a direct dependency. Requires mcp>=2.3,<3. Checked over stdio with both a 2.3 and a 1.26 client: same tool list, results, validation errors and error results as main on 1.26. Fixes #7 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y1K5ZxarAhddzS87B9bG7h
# Conflicts: # CHANGELOG.md
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.
Moves wbox-mcp to the MCP Python SDK 2.x API and drops 1.x support.
Changes
src/wbox/server.py: SDK 2.x removed the@Server.list_tools()/@Server.call_tool()decorators.create_servernow passeson_list_tools/on_call_toolto theServerconstructor. The tool bodies are unchanged.inputSchemaand turned an exception into anisErrorresult. 2.x leaves both to the handler, soon_call_tooldoes them with the same messages.jsonschemais now a direct dependency.tests/mcp-dev/server.py: the same port for the dev wrapper.pyproject.toml:mcp>=2.3,<3.uv.lockregenerated (mcp 2.3.0).Verification
wbox-mcp servewith the crash-dummy config, I ran a 2.3 client and a 1.26 client. Both get the same results asmainrunning mcp 1.26: initialize, 26 tools listed, an unknown tool, a schema-invalid call (isError+ "Input validation error: 'command' is a required property"), andclickwith no compositor.tests/mcp-dev/server.pyhandshake works: 19 tools,statusandstoprespond.pytest testsgives the same counts on this branch and onmain(5 failed / 38 passed / 68 skipped / 490 errors). This container has no display, tkinter or labwc, so the compositor tests could not run. The integration workflow covers them.Fixes #7
Generated by Claude Code