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]

feat: feat: allow_all_keys to mcp server on the UI

Yuta Saito38a20b803621
diff --git a/ui/litellm-dashboard/src/components/mcp_tools/MCPPermissionManagement.tsx b/ui/litellm-dashboard/src/components/mcp_tools/MCPPermissionManagement.tsx
index 9286e4825cf..23735d985df 100644
--- a/ui/litellm-dashboard/src/components/mcp_tools/MCPPermissionManagement.tsx
+++ b/ui/litellm-dashboard/src/components/mcp_tools/MCPPermissionManagement.tsx
@@ -1,5 +1,5 @@
import React, { useEffect } from "react";
-import { Form, Select, Tooltip, Collapse, Input, Space, Button } from "antd";
+import { Form, Select, Tooltip, Collapse, Input, Space, Button, Switch } from "antd";
import { InfoCircleOutlined, MinusCircleOutlined, PlusOutlined } from "@ant-design/icons";
import { MCPServer } from "./types";
const { Panel } = Collapse;
@@ -38,6 +38,11 @@ const MCPPermissionManagement: React.FC<MCPPermissionManagementProps> = ({
}));
form.setFieldValue("static_headers", staticHeaders);
}
+ if (typeof mcpServer.allow_all_keys === "boolean") {
+ form.setFieldValue("allow_all_keys", mcpServer.allow_all_keys);
+ }
+ } else {
+ form.setFieldValue("allow_all_keys", false);
}
}, [mcpServer, form]);
@@ -57,6 +62,26 @@ const MCPPermissionManagement: React.FC<MCPPermissionManagementProps> = ({
className="border-0"
>
<div className="space-y-6 pt-4">
+ <div className="flex items-start justify-between gap-4">
+ <div>
+ <span className="text-sm font-medium text-gray-700 flex items-center">
+ Allow All LiteLLM Keys
+ <Tooltip title="When enabled, every API key can access this MCP server.">
+ <InfoCircleOutlined className="ml-2 text-blue-400 hover:text-blue-600 cursor-help" />
+ </Tooltip>
+ </span>
+ <p className="text-sm text-gray-600 mt-1">Enable if this server should be "public" to all keys.</p>
+ </div>
+ <Form.Item
+ name="allow_all_keys"
+ valuePropName="checked"
+ initialValue={mcpServer?.allow_all_keys ?? false}
+ className="mb-0"
+ >
+ <Switch />
+ </Form.Item>
+ </div>
+
<Form.Item
label={
<span className="text-sm font-medium text-gray-700 flex items-center">
diff --git a/ui/litellm-dashboard/src/components/mcp_tools/create_mcp_server.tsx b/ui/litellm-dashboard/src/components/mcp_tools/create_mcp_server.tsx
index e9f9636bf2c..d72b7c4f676 100644
--- a/ui/litellm-dashboard/src/components/mcp_tools/create_mcp_server.tsx
+++ b/ui/litellm-dashboard/src/components/mcp_tools/create_mcp_server.tsx
@@ -188,6 +188,7 @@ const CreateMCPServer: React.FC<CreateMCPServerProps> = ({
static_headers: staticHeadersList,
stdio_config: rawStdioConfig,
credentials: credentialValues,
+ allow_all_keys: allowAllKeysRaw,
...restValues
} = values;
@@ -278,6 +279,7 @@ const CreateMCPServer: React.FC<CreateMCPServerProps> = ({
mcp_access_groups: accessGroups,
alias: restValues.alias,
allowed_tools: allowedTools.length > 0 ? allowedTools : null,
+ allow_all_keys: Boolean(allowAllKeysRaw),
static_headers: staticHeaders,
};
diff --git a/ui/litellm-dashboard/src/components/mcp_tools/mcp_server_edit.tsx b/ui/litellm-dashboard/src/components/mcp_tools/mcp_server_edit.tsx
index b4486bdfb23..82f85f75eda 100644
--- a/ui/litellm-dashboard/src/components/mcp_tools/mcp_server_edit.tsx
+++ b/ui/litellm-dashboard/src/components/mcp_tools/mcp_server_edit.tsx
@@ -286,7 +286,12 @@ const MCPServerEdit: React.FC<MCPServerEditProps> = ({
if (!accessToken) return;
try {
// Ensure access groups is always a string array
- const { static_headers: staticHeadersList, credentials: credentialValues, ...restValues } = values;
+ const {
+ static_headers: staticHeadersList,
+ credentials: credentialValues,
+ allow_all_keys: allowAllKeysRaw,
+ ...restValues
+ } = values;
const accessGroups = (restValues.mcp_access_groups || []).map((g: any) =>
typeof g === "string" ? g : g.name || String(g),
@@ -339,6 +344,7 @@ const MCPServerEdit: React.FC<MCPServerEditProps> = ({
allowed_tools: allowedTools.length > 0 ? allowedTools : null,
disallowed_tools: restValues.disallowed_tools || [],
static_headers: staticHeaders,
+ allow_all_keys: Boolean(allowAllKeysRaw ?? mcpServer.allow_all_keys),
};
const includeCredentials = restValues.auth_type && AUTH_TYPES_REQUIRING_CREDENTIALS.includes(restValues.auth_type);
diff --git a/ui/litellm-dashboard/src/components/mcp_tools/mcp_server_view.tsx b/ui/litellm-dashboard/src/components/mcp_tools/mcp_server_view.tsx
index 541c0bbb2f3..6a4e9c105ff 100644
--- a/ui/litellm-dashboard/src/components/mcp_tools/mcp_server_view.tsx
+++ b/ui/litellm-dashboard/src/components/mcp_tools/mcp_server_view.tsx
@@ -229,6 +229,25 @@ export const MCPServerView: React.FC<MCPServerViewProps> = ({
<Text className="font-medium">Auth Type</Text>
<div>{handleAuth(mcpServer.auth_type)}</div>
</div>
+ <div>
+ <Text className="font-medium">Allow All LiteLLM Keys</Text>
+ <div className="flex items-center gap-2">
+ {mcpServer.allow_all_keys ? (
+ <span className="px-2 py-1 bg-green-50 text-green-700 rounded-md text-sm">
+ Enabled
+ </span>
+ ) : (
+ <span className="px-2 py-1 bg-gray-100 text-gray-600 rounded-md text-sm">
+ Disabled
+ </span>
+ )}
+ {mcpServer.allow_all_keys && (
+ <Text className="text-xs text-gray-500">
+ All keys can access this MCP server
+ </Text>
+ )}
+ </div>
+ </div>
<div>
<Text className="font-medium">Access Groups</Text>
<div>
diff --git a/ui/litellm-dashboard/src/components/mcp_tools/types.tsx b/ui/litellm-dashboard/src/components/mcp_tools/types.tsx
index 0d21f04779b..cf938e21b3a 100644
--- a/ui/litellm-dashboard/src/components/mcp_tools/types.tsx
+++ b/ui/litellm-dashboard/src/components/mcp_tools/types.tsx
@@ -152,6 +152,7 @@ export interface MCPServer {
teams?: Team[];
mcp_access_groups?: string[];
allowed_tools?: string[];
+ allow_all_keys?: boolean;
}
export interface MCPServerProps {