Upgrade Python libraries to mcp 2.2.0, and bump others as well - #197
Open
a-akimov wants to merge 1 commit into
Open
Upgrade Python libraries to mcp 2.2.0, and bump others as well#197a-akimov wants to merge 1 commit into
a-akimov wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
The broad SDK and transitive dependency upgrade warrants final human validation despite the coherent API migrations.
Pull request overview
Upgrades the Python MCP examples to MCP 2.2.0 and compatible dependencies.
Changes:
- Uses
ToolErrorfor expected weather-tool failures. - Adopts direct
Client(StdioServerParameters)construction. - Refreshes dependency constraints and lock data.
File summaries
| File | Description |
|---|---|
weather-server-python/weather.py |
Returns expected failures as MCP tool errors. |
weather-server-python/uv.lock |
Locks upgraded server dependencies. |
weather-server-python/pyproject.toml |
Requires MCP 2.2.0+. |
mcp-client-python/README.md |
Documents direct stdio client construction. |
mcp-client-python/pyproject.toml |
Updates MCP, Anthropic, and supporting dependencies. |
mcp-client-python/client.py |
Uses the new MCP client API. |
Review details
- Files reviewed: 5/7 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Motivation and Context
Updating to the latest version of mcp (2.2.0) and anthropic (1.4.0), as well as other dependencies to keep the repo up-to-date.
Code changes required by the new SDKs
weather-server-python/weather.py: all fourValueErrorraises becameToolError. Since mcp 2.1, an unexpected exception from a tool reaches the model only as "Error executing tool get_alerts" with a traceback in the server log.ToolErroris the anticipated-failure path, and its message is returned as an error result.mcp-client-python/client.py:ClientacceptsStdioServerParametersdirectly since 2.1, so thestdio_clientwrapper and its import are gone. One line was also reflowed by the newer ruff formatter.How Has This Been Tested?
Locally.
Breaking Changes
N/a
Types of changes
Checklist
Additional context
N/a