From fe41e14951f37cd06a52671c2dc0a7e5fad1d124 Mon Sep 17 00:00:00 2001 From: YutaSaito <36355491+uc4w6c@users.noreply.github.com> Date: Tue, 2 Dec 2025 13:08:54 +0900 Subject: [PATCH] fix: remove URL format validation for MCP server endpoints (#17270) --- .../mcp_tools/create_mcp_server.tsx | 45 ++----------------- 1 file changed, 4 insertions(+), 41 deletions(-) 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 65a6c6c84e..ba6739d07c 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 @@ -48,7 +48,6 @@ const CreateMCPServer: React.FC = ({ const [allowedTools, setAllowedTools] = useState([]); const [transportType, setTransportType] = useState(""); const [searchValue, setSearchValue] = useState(""); - const [urlWarning, setUrlWarning] = useState(""); const [oauthAccessToken, setOauthAccessToken] = useState(null); const authType = formValues.auth_type as string | undefined; const shouldShowAuthValueField = authType ? AUTH_TYPES_REQUIRING_AUTH_VALUE.includes(authType) : false; @@ -125,22 +124,6 @@ const CreateMCPServer: React.FC = ({ onBeforeRedirect: persistCreateUiState, }); - // Function to check URL format based on transport type - const checkUrlFormat = (url: string, transport: string) => { - if (!url) { - setUrlWarning(""); - return; - } - - if (transport === "sse" && !url.endsWith("/sse")) { - setUrlWarning("Typically MCP SSE URLs end with /sse. You can add this url but this is a warning."); - } else if (transport === "http" && !url.endsWith("/mcp")) { - setUrlWarning("Typically MCP HTTP URLs end with /mcp. You can add this url but this is a warning."); - } else { - setUrlWarning(""); - } - }; - React.useEffect(() => { if (typeof window === "undefined") { return; @@ -192,9 +175,6 @@ const CreateMCPServer: React.FC = ({ } form.setFieldsValue(pendingRestoredValues.values); setFormValues(pendingRestoredValues.values); - if (pendingRestoredValues.values.url && transportReady) { - checkUrlFormat(pendingRestoredValues.values.url, transportReady); - } setPendingRestoredValues(null); }, [pendingRestoredValues, form, transportType]); @@ -315,7 +295,6 @@ const CreateMCPServer: React.FC = ({ setCostConfig({}); setTools([]); setAllowedTools([]); - setUrlWarning(""); setAliasManuallyEdited(false); setModalVisible(false); onCreateSuccess(response); @@ -333,7 +312,6 @@ const CreateMCPServer: React.FC = ({ setCostConfig({}); setTools([]); setAllowedTools([]); - setUrlWarning(""); setAliasManuallyEdited(false); setModalVisible(false); }; @@ -343,14 +321,8 @@ const CreateMCPServer: React.FC = ({ // Clear fields that are not relevant for the selected transport if (value === "stdio") { form.setFieldsValue({ url: undefined, auth_type: undefined, credentials: undefined }); - setUrlWarning(""); } else { form.setFieldsValue({ command: undefined, args: undefined, env: undefined }); - // Check URL format for the new transport type - const currentUrl = form.getFieldValue("url"); - if (currentUrl) { - checkUrlFormat(currentUrl, value); - } } }; @@ -536,19 +508,10 @@ const CreateMCPServer: React.FC = ({ { validator: (_, value) => validateMCPServerUrl(value) }, ]} > -
- { - const value = e.target.value; - checkUrlFormat(value, transportType); - form.setFieldValue("url", value); - }} - placeholder="https://your-mcp-server.com" - className="rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500" - /> - {urlWarning &&
{urlWarning}
} -
+ )}