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: handle missing 'env' attribute in MCP server Prisma model (#12560)

Cole McIntosh7f5033d8a60f
diff --git a/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py b/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py
index 3b4d6abf579..1458381c02d 100644
--- a/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py
+++ b/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py
@@ -160,7 +160,9 @@ class MCPServerManager:
_mcp_info: MCPInfo = mcp_server.mcp_info or {}
# Use helper to deserialize environment dictionary
- env_dict = _deserialize_env_dict(mcp_server.env)
+ # Safely access env field which may not exist on Prisma model objects
+ env_data = getattr(mcp_server, 'env', None)
+ env_dict = _deserialize_env_dict(env_data)
new_server = MCPServer(
server_id=mcp_server.server_id,