Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add support for MCP's Streamable HTTP transport#1716

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
DouweM merged 5 commits intopydantic:mainfromBrandonShar:add-streamable-http
May 26, 2025

Conversation

BrandonShar
Copy link
Contributor

This adds support for the newStreamable HTTP transport that was just added to MCP inv1.8. I based the implementation off of howFastMCP handled it here.

I set it up to be a non-breaking change (with deprecations) and updated the tests accordingly, but there wasn't an SSE integration test that I noticed. I did test this in my project locally and it worked well. Happy to collaborate on some additional testing!

Resolves#1632

zholmquist, mintuhouse, lucinvitae, andaag, kolomietsdv, and jlaneve reacted with heart emoji
@ankit-kapur
Copy link

🙌🏽 Waiting for this to get merged soon

@DouweM
Copy link
Contributor

@BrandonShar Thanks Brandon, this looks great! My only concern is that GitHub shows thatuv.lock has "2,039 additions, 2,038 deletions". Can you please revert that and runmake install again? I'd expect to just see changes related to themcp package.

@BrandonShar
Copy link
ContributorAuthor

BrandonShar commentedMay 20, 2025
edited
Loading

Hey@DouweM thanks for the review! Turns out I needed to upgrade my version ofuv (I was on0.6.*). Looks like that made it want to rebuild the entire lock file. Should be good now!

@DouweMDouweM changed the titleAdd Support for MCP's Streamable HTTP serverAdd support for MCP's Streamable HTTP transportMay 21, 2025
@DouweM
Copy link
Contributor

@BrandonShar Thanks, the code looks good. Can you please updatehttps://ai.pydantic.dev/mcp/client/#sse-client as well? It currently says "The name "HTTP" is used since this implemented will be adapted in future to use the newStreamable HTTP currently in development.", which should be dropped, and it should be made explicit that we support both the older SSE and newer MCP endpoints.

@GustavoRonconi
Copy link

very much looking forward to it!@BrandonShar , you need some help?

BrandonShar reacted with heart emoji

@DouweM
Copy link
Contributor

@BrandonShar Note that we have some conflicts from some other changes we just merged

@hyperlint-aiHyperlint AI
Copy link
Contributor

PR Change Summary

Added support for the Streamable HTTP transport in MCP, ensuring compatibility with existing functionality while introducing new capabilities.

  • Implemented Streamable HTTP transport support in MCPServerHTTP
  • Updated documentation to reflect changes in transport type
  • Ensured non-breaking changes with deprecations and updated tests accordingly

Modified Files

  • docs/mcp/client.md

How can I customize these reviews?

Check out theHyperlint AI Reviewer docs for more information on how to customize the review.

If you just want to ignore it on this PR, you can add thehyperlint-ignore label to the PR. Future changes won't trigger a Hyperlint review.

Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to addhyperlint-ignore to the PR to ignore the link check for this PR.

@BrandonShar
Copy link
ContributorAuthor

@DouweM I tweaked the docs a bit and resolved the conflicts. Just an FYI, a few were just formatting, but the linter seems happy with what I already had.

mintuhouse and maxonics reacted with rocket emoji

@BrandonShar
Copy link
ContributorAuthor

@DouweM changes made. Good call on the docs improvements, I appreciate your attention to detail there!

@DouweMDouweM merged commit8f83407 intopydantic:mainMay 26, 2025
19 checks passed
@@ -75,7 +75,7 @@ tavily = ["tavily-python>=0.5.0"]
# CLI
cli = ["rich>=13", "prompt-toolkit>=3", "argcomplete>=3.5.0"]
# MCP
mcp = ["mcp>=1.6.0; python_version >= '3.10'"]
mcp = ["mcp>=1.8.0; python_version >= '3.10'"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

note that I think this may need to be 1.9.0 as the protocol version in 1.8.0 is still the 2024-11-05 one. we want the 2025-03-26 one (latest) as that's where the streamable HTTP protocol is defined

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@jlaneve Thanks, fixed in#1840

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think tagging 1.9.0 works great, but I'm not seeing why we needed to. The1.8.0 release is what introduced streamable http.

@DouweMDouweM mentioned this pull requestJun 2, 2025
2 tasks
DouweM added a commit that referenced this pull requestJun 3, 2025
This reverts commit8f83407.# Conflicts:#pydantic_ai_slim/pydantic_ai/mcp.py#pydantic_ai_slim/pyproject.toml#tests/test_mcp.py#uv.lock
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@DouweMDouweMDouweM requested changes

@jlanevejlanevejlaneve left review comments

@KludexKludexKludex left review comments

Assignees

@DouweMDouweM

Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Streamable HTTP Implementaion
6 participants
@BrandonShar@ankit-kapur@DouweM@GustavoRonconi@jlaneve@Kludex

[8]ページ先頭

©2009-2025 Movatter.jp