Skip to content

fix(mcp): support mcp 2 streamable http client - #125

Open
dvd233 wants to merge 1 commit into
MiniMax-AI:mainfrom
dvd233:fix/mcp-2-streamable-http-119
Open

dvd233 wants to merge 1 commit into
MiniMax-AI:mainfrom
dvd233:fix/mcp-2-streamable-http-119

Conversation

@dvd233

@dvd233 dvd233 commented Sep 19, 2026

Copy link
Copy Markdown

Summary

  • Support the renamed streamable_http_client transport in mcp 2.x while keeping mcp 1.x compatibility.
  • Configure mcp 2.x httpx2 headers and connect/read timeouts, and close the client through the existing AsyncExitStack.
  • Add a regression assertion for both transport API names.

Fixes #119

Validation

  • mcp 1.9.4 focused MCP tests: 24 passed, 1 skipped.
  • mcp 2.0.0 focused MCP tests: 24 passed, 1 skipped.
  • python -m compileall -q mini_agent tests/test_mcp.py
  • git diff --check

The focused test selection excludes the repository's optional Git MCP tests and Windows-specific temporary-file cleanup cases; the latter still fail independently on this host because the existing tests unlink an open NamedTemporaryFile.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

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.

ImportError: cannot import name 'streamablehttp_client' from 'mcp.client.streamable_http' — mcp 2.0.0 breaking change

1 participant