Skip to content

Commit 6a96ab4

Browse files
committed
fix(mcp): default available_on_public_internet to true
Fixes breaking change where new MCP servers were private by default, causing k8s/cross-cluster deployments to have their servers silently stripped by IP filtering. Changes all defaults to true across: - litellm/proxy/_types.py (3 Pydantic models) - litellm/types/mcp_server/mcp_server_manager.py (MCPServer class) - litellm/proxy/schema.prisma + schema.prisma + litellm-proxy-extras schema - mcp_server_manager.py YAML + DB loading fallbacks - UI MCPPermissionManagement.tsx form defaults See migration script in #22331 for existing deployments that need to flip existing servers back to public.
1 parent 7e4e454 commit 6a96ab4

File tree

7 files changed

+14
-12
lines changed

7 files changed

+14
-12
lines changed

litellm-proxy-extras/litellm_proxy_extras/schema.prisma

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ model LiteLLM_MCPServerTable {
266266
token_url String?
267267
registration_url String?
268268
allow_all_keys Boolean @default(false)
269-
available_on_public_internet Boolean @default(false)
269+
available_on_public_internet Boolean @default(true)
270270
}
271271

272272
// Generate Tokens for Proxy

litellm/proxy/_experimental/mcp_server/mcp_server_manager.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@
7171
from mcp.shared.tool_name_validation import (
7272
validate_tool_name, # pyright: ignore[reportAssignmentType]
7373
)
74-
from mcp.shared.tool_name_validation import SEP_986_URL
74+
from mcp.shared.tool_name_validation import (
75+
SEP_986_URL,
76+
)
7577
except ImportError:
7678
from pydantic import BaseModel
7779

@@ -329,7 +331,7 @@ async def load_servers_from_config(
329331
static_headers=server_config.get("static_headers", None),
330332
allow_all_keys=bool(server_config.get("allow_all_keys", False)),
331333
available_on_public_internet=bool(
332-
server_config.get("available_on_public_internet", False)
334+
server_config.get("available_on_public_internet", True)
333335
),
334336
)
335337
self.config_mcp_servers[server_id] = new_server
@@ -632,7 +634,7 @@ async def build_mcp_server_from_table(
632634
disallowed_tools=getattr(mcp_server, "disallowed_tools", None),
633635
allow_all_keys=mcp_server.allow_all_keys,
634636
available_on_public_internet=bool(
635-
getattr(mcp_server, "available_on_public_internet", False)
637+
getattr(mcp_server, "available_on_public_internet", True)
636638
),
637639
updated_at=getattr(mcp_server, "updated_at", None),
638640
)

litellm/proxy/_types.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,7 @@ class NewMCPServerRequest(LiteLLMPydanticObjectBase):
10801080
token_url: Optional[str] = None
10811081
registration_url: Optional[str] = None
10821082
allow_all_keys: bool = False
1083-
available_on_public_internet: bool = False
1083+
available_on_public_internet: bool = True
10841084

10851085
@model_validator(mode="before")
10861086
@classmethod
@@ -1142,7 +1142,7 @@ class UpdateMCPServerRequest(LiteLLMPydanticObjectBase):
11421142
token_url: Optional[str] = None
11431143
registration_url: Optional[str] = None
11441144
allow_all_keys: bool = False
1145-
available_on_public_internet: bool = False
1145+
available_on_public_internet: bool = True
11461146

11471147
@model_validator(mode="before")
11481148
@classmethod
@@ -1196,7 +1196,7 @@ class LiteLLM_MCPServerTable(LiteLLMPydanticObjectBase):
11961196
token_url: Optional[str] = None
11971197
registration_url: Optional[str] = None
11981198
allow_all_keys: bool = False
1199-
available_on_public_internet: bool = False
1199+
available_on_public_internet: bool = True
12001200

12011201

12021202
class MakeMCPServersPublicRequest(LiteLLMPydanticObjectBase):

litellm/proxy/schema.prisma

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ model LiteLLM_MCPServerTable {
266266
token_url String?
267267
registration_url String?
268268
allow_all_keys Boolean @default(false)
269-
available_on_public_internet Boolean @default(false)
269+
available_on_public_internet Boolean @default(true)
270270
}
271271

272272
// Generate Tokens for Proxy

litellm/types/mcp_server/mcp_server_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class MCPServer(BaseModel):
5252
env: Optional[Dict[str, str]] = None
5353
access_groups: Optional[List[str]] = None
5454
allow_all_keys: bool = False
55-
available_on_public_internet: bool = False
55+
available_on_public_internet: bool = True
5656
updated_at: Optional[datetime] = None
5757
model_config = ConfigDict(arbitrary_types_allowed=True)
5858

schema.prisma

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ model LiteLLM_MCPServerTable {
266266
token_url String?
267267
registration_url String?
268268
allow_all_keys Boolean @default(false)
269-
available_on_public_internet Boolean @default(false)
269+
available_on_public_internet Boolean @default(true)
270270
}
271271

272272
// Generate Tokens for Proxy

ui/litellm-dashboard/src/components/mcp_tools/MCPPermissionManagement.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const MCPPermissionManagement: React.FC<MCPPermissionManagementProps> = ({
4646
}
4747
} else {
4848
form.setFieldValue("allow_all_keys", false);
49-
form.setFieldValue("available_on_public_internet", false);
49+
form.setFieldValue("available_on_public_internet", true);
5050
}
5151
}, [mcpServer, form]);
5252

@@ -99,7 +99,7 @@ const MCPPermissionManagement: React.FC<MCPPermissionManagementProps> = ({
9999
<Form.Item
100100
name="available_on_public_internet"
101101
valuePropName="checked"
102-
initialValue={mcpServer?.available_on_public_internet ?? false}
102+
initialValue={mcpServer?.available_on_public_internet ?? true}
103103
className="mb-0"
104104
>
105105
<Switch />

0 commit comments

Comments
 (0)