Repository navigation
fix(mcp): work with mcp 2.x as resolved through strands-agents - #86
Merged
Merged
Conversation
- Raise the mcp floor to >=2.0.0 to match what resolution already picks - Swap httpx for httpx2 in the streamable-http headers path - Port the 06_mcp example server from FastMCP to MCPServer, stdio only - Inline the three single-use helpers in mcp/client.py
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.
Description
strands-agentsallowsmcp<2.2, so a fresh resolve now lands on mcp 2.x.Our code still spoke the 1.x API and broke there.
This patches us onto 2.x rather than changing anything of our own:
mcpfloor raised to>=2.0.0to match what resolution already picks; upper bound stays withstrands-agents.httpx→httpx2in the streamable-httpheaderspath (mcp 2.x swapped its HTTP stack, sostreamable_http_clientwants anhttpx2.AsyncClient).examples/06_mcpserver portedFastMCP→MCPServerand reduced to stdio, which is the only mode its config uses.mcp/client.pyintocreate_mcp_client; no behavior change.Related Issues
N/A
Type of Change
YAML / API Impact
No schema or public API change.
create_mcp_clientkeeps its signature;transport_options.http_clientnow takes anhttpx2.AsyncClientinstead of anhttpx.AsyncClient, which follows mcp 2.x and is the only user-visible detail.Testing
How have you tested the change?
uv run just check(lint + type check)uv run just testfor overall testingexamples/still workChecklist