-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[Feat] MCP - Add support for streamablehttp_client
MCP Servers
#11628
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Pull Request Overview
Adds HTTP streaming support for MCP servers in LiteLLM and updates tests and CI configuration accordingly.
- Implement HTTP
streamablehttp_client
transport inMCPServerManager
for bothlist_tools
andcall_tool
. - Introduce new async tests with mocks for HTTP transport behavior.
- Bump
mcp
dependency version from 1.5.0 to 1.9.3 in.circleci/requirements.txt
and CI scripts.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
tests/mcp_tests/test_mcp_server.py | Added new HTTP-transport tests and mocks for streamablehttp_client . |
litellm/proxy/_experimental/mcp_server/mcp_server_manager.py | Implemented HTTP transport logic in _get_tools_from_server and call_tool . |
.circleci/requirements.txt | Updated mcp version to 1.9.3. |
.circleci/config.yml | Updated CI steps to install mcp==1.9.3 |
Comments suppressed due to low confidence (2)
tests/mcp_tests/test_mcp_server.py:48
- This test relies on an environment variable but doesn’t skip or assert when the URL is missing. Consider adding
if not os.environ.get(...): pytest.skip('No HTTPS server URL set')
and include assertions to validate the returnedtools
andresult
.
"url": os.environ.get("ZAPIER_MCP_HTTPS_SERVER_URL"),
litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:259
- Returning an empty error result without any context can make debugging difficult. Consider including a descriptive error message in the
CallToolResult
, or raising an exception when an unsupported transport is encountered.
return CallToolResult(content=[], isError=True)
|
||
return tools_result.tools | ||
elif server.transport == MCPTransport.http: | ||
# TODO: implement http transport | ||
return [] | ||
verbose_logger.debug(f"Using HTTP streamable transport for {server.url}") |
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.
[nitpick] The HTTP transport blocks in both _get_tools_from_server
and call_tool
are nearly identical. Consider extracting session initialization and mapping logic into a shared helper to reduce duplication.
Copilot uses AI. Check for mistakes.
Need the version bump in pyproject.yaml and the poetry.lock |
[Feat] MCP - Add support for
streamablehttp_client
MCP ServersAdds HTTP streaming support for MCP servers in LiteLLM and updates tests and CI configuration accordingly.
Implement HTTP streamablehttp_client transport in MCPServerManager for both list_tools and call_tool.
Adds support for streamablehttp_client MCP servers on LiteLLM
https://www.loom.com/share/ba1422987ec349a7a306372687cb825d?sid=4d30fff2-85e1-4b7a-a649-0d0a3a25233e
Relevant issues
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/
directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit
Type
🆕 New Feature
✅ Test
Changes