Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix: remove dupe server_id MCP config servers (#11327)

Tyler Wagner63d7f99e27e5
diff --git a/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py b/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py
index c52e3ab29d8..c29d8814819 100644
--- a/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py
+++ b/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py
@@ -72,8 +72,9 @@ class MCPServerManager:
mcp_info = MCPInfo(**_mcp_info)
mcp_info["server_name"] = server_name
mcp_info["description"] = server_config.get("description", None)
+ server_id = str(uuid.uuid4())
new_server = MCPServer(
- server_id=str(uuid.uuid4()),
+ server_id=server_id,
name=server_name,
url=server_config["url"],
# TODO: utility fn the default values
@@ -82,7 +83,6 @@ class MCPServerManager:
auth_type=server_config.get("auth_type", None),
mcp_info=mcp_info,
)
- server_id = str(uuid.uuid4())
self.config_mcp_servers[server_id] = new_server
verbose_logger.debug(
f"Loaded MCP Servers: {json.dumps(self.config_mcp_servers, indent=4, default=str)}"