Skip to content

fix(mcp): work with mcp 2.x as resolved through strands-agents - #86

Merged
galuszkm merged 1 commit into
mainfrom
fix/mg/pin-mcp-2.2.0
Sep 23, 2026
Merged

galuszkm merged 1 commit into
mainfrom
fix/mg/pin-mcp-2.2.0

Conversation

@galuszkm

Copy link
Copy Markdown
Member

Description

strands-agents allows mcp<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:

  • mcp floor raised to >=2.0.0 to match what resolution already picks; upper bound stays with strands-agents.
  • httpx → httpx2 in the streamable-http headers path (mcp 2.x swapped its HTTP stack, so streamable_http_client wants an httpx2.AsyncClient).
  • examples/06_mcp server ported FastMCP → MCPServer and reduced to stdio, which is the only mode its config uses.
  • Folded the three single-use private helpers in mcp/client.py into create_mcp_client; no behavior change.

Related Issues

N/A

Type of Change

  • Bug fix

YAML / API Impact

No schema or public API change. create_mcp_client keeps its signature; transport_options.http_client now takes an httpx2.AsyncClient instead of an httpx.AsyncClient, which follows mcp 2.x and is the only user-visible detail.

Testing

How have you tested the change?

  • I ran uv run just check (lint + type check)
  • I ran uv run just test for overall testing
  • I added or updated tests that prove my fix is effective or my feature works
  • I verified existing examples in examples/ still work

Checklist

  • I have read the CONTRIBUTING document
  • I have updated the documentation accordingly
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

- 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
@galuszkm
galuszkm merged commit 3c2163b into main Sep 23, 2026
9 checks passed
@galuszkm
galuszkm deleted the fix/mg/pin-mcp-2.2.0 branch September 23, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant