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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix(mcp): register OpenAPI tools after short prefix collision resolution in reload
Cursor Agent6b3f07ba25a3
diff --git a/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py b/litellm/proxy/_experimental/mcp_server/mcp_server_manager.pyindex 853208a5382..8bb7a5d50d5 100644--- a/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py+++ b/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py@@ -2779,13 +2779,16 @@ class MCPServerManager:if existing_server is not None and existing_server.short_prefix:new_server.short_prefix = existing_server.short_prefixnew_registry[server.server_id] = new_server- await self._maybe_register_openapi_tools(new_server)# Swap in the new registry first so _assign_unique_short_prefix# sees the complete set when checking for collisions.self.registry = new_registryfor new_server in new_registry.values():self._assign_unique_short_prefix(new_server)+ # Register OpenAPI tools *after* the final short prefix is assigned+ # so the tools are stored in the global registry under the same+ # prefix that lookups will use.+ await self._maybe_register_openapi_tools(new_server)verbose_logger.debug("MCP registry refreshed (%s servers in registry)", len(new_registry)