[Feat] MCP expose streamable https endpoint for LiteLLM Proxy (#11645)

* feat - add https mcp support

* fixes for MCP http integration

* fix code QA

* bump mcp dep

* test_mcp_server_manager_https_server

* test mcp server https

* fix linting error

* bump mcp in poetry

* fix import streamablehttp_client

* fix streamablehttp_client

* fix streamablehttp_client

* add streamablehttp_client

* add simple https server

* working mounted app

* working HTTPS mcp streamable

* fix code QA check

* feat: add MCP Server

* fix - init just as fastapi app

* add LITELLM_MCP_SERVER_DESCRIPTION

* fix importing / init litellm app

* Update litellm/proxy/_experimental/mcp_server/server.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update litellm/proxy/_experimental/mcp_server/server.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update server.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fixes based on review + code check

* fix linting

* test_streamable_http_mcp_handler_mock

* fix python 3.13 install

* fix deps test

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Ishaan Jaff
2025-06-12 16:32:04 -07:00
committed by GitHub
parent 6b9754e2aa
commit 7947139913
6 changed files with 217 additions and 57 deletions
@@ -24,8 +24,8 @@ def test_using_litellm():
def test_litellm_proxy_server():
# Install the litellm[proxy] package
subprocess.run(["pip", "install", "litellm[proxy]"])
# Install the local litellm[proxy] package in development mode
subprocess.run(["pip", "install", "-e", ".[proxy]"])
# Import the proxy_server module
try:
@@ -91,11 +91,11 @@ import requests
def test_litellm_proxy_server_config_no_general_settings():
# Install the litellm[proxy] package
# Start the server
# Install the local litellm packages in development mode
server_process = None
try:
subprocess.run(["pip", "install", "litellm[proxy]"])
subprocess.run(["pip", "install", "litellm[extra_proxy]"])
subprocess.run(["pip", "install", "-e", ".[proxy]"])
subprocess.run(["pip", "install", "-e", ".[extra_proxy]"])
filepath = os.path.dirname(os.path.abspath(__file__))
config_fp = f"{filepath}/test_configs/test_config_no_auth.yaml"
server_process = subprocess.Popen(
@@ -136,8 +136,9 @@ def test_litellm_proxy_server_config_no_general_settings():
pytest.fail("Failed to connect to the server")
finally:
# Shut down the server
server_process.terminate()
server_process.wait()
if server_process:
server_process.terminate()
server_process.wait()
# Additional assertions can be added here
assert True