-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Support streamable-http mcp #644
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support streamable-http mcp #644
Conversation
|
cc @DavdGao |
|
@LiangYang666 Thank you for your contribution! The PR looks promising, but I think we need to enhance the validation logic to make it more robust. Specifically, I suggest we add stricter URL pattern matching by checking for "/sse" or "/mcp" suffixes in the URL field For your reference, there's an ongoing discussion in the official MCP library regarding the criteria for identifying streamable HTTP or SSE configurations: modelcontextprotocol/python-sdk#983 |
|
Please run the following command in agentscope dir to format the code in this pull request: pip install pre-commit
pre-commit install
pre-commit run --all-files |
|
@DavdGao I think it's not ideal to infer the type by validating the URL, as this can create a black-box logic and reduce transparency. In fact, the URL suffix can be customized on mcp servers, so relying on specific patterns may not be reliable. Similar to best practices in other projects such as the OpenAI Agent SDK, Cline, or Cherry Studio, I suggest we give the user the explicit choice to specify whether to use SSE or streamable HTTP, rather than trying to determine it automatically based on the URL. This approach is simpler, more flexible, and avoids hidden logic. |
Thank you for the instructions. |
|
Streamable http feature requires mcp version >=1.8.0, please add to dependencies. |
done |
Thanks for your contribution, please merge the latest main branch to fix errors in UT. |
# Conflicts: # setup.py
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for your contribution!
name: Pull Request
about: Create a pull request
Description
This PR adds support for the streamable_http mcp and resolves #625. Additionally, a usage demo is included, which allows direct testing of the new code. Documentation has not been updated yet. If this PR is approved, I can proceed to update the documentation accordingly.
Checklist
Please check the following items before code is ready to be reviewed.