diff --git a/ui/litellm-dashboard/src/components/mcp_tools/ByokCredentialModal.tsx b/ui/litellm-dashboard/src/components/mcp_tools/ByokCredentialModal.tsx index 84203a23950..cca7aa46663 100644 --- a/ui/litellm-dashboard/src/components/mcp_tools/ByokCredentialModal.tsx +++ b/ui/litellm-dashboard/src/components/mcp_tools/ByokCredentialModal.tsx @@ -13,6 +13,7 @@ import { LinkOutlined, } from "@ant-design/icons"; import { MCPServer } from "./types"; +import { getGlobalLitellmHeaderName } from "@/components/networking"; interface ByokCredentialModalProps { server: MCPServer; @@ -56,7 +57,7 @@ export const ByokCredentialModal: React.FC = ({ method: "POST", headers: { "Content-Type": "application/json", - Authorization: `Bearer ${accessToken}`, + [getGlobalLitellmHeaderName()]: `Bearer ${accessToken}`, }, body: JSON.stringify({ credential: apiKey.trim(), save: saveKey }), }); diff --git a/ui/litellm-dashboard/src/components/networking.tsx b/ui/litellm-dashboard/src/components/networking.tsx index d982956d7a3..4bf8d6a1c88 100644 --- a/ui/litellm-dashboard/src/components/networking.tsx +++ b/ui/litellm-dashboard/src/components/networking.tsx @@ -6755,12 +6755,10 @@ export const testMCPToolsListRequest = async ( "Content-Type": "application/json", }; if (accessToken) { - headers["x-litellm-api-key"] = accessToken; + headers[globalLitellmHeaderName] = `Bearer ${accessToken}`; } if (oauthAccessToken) { headers["Authorization"] = `Bearer ${oauthAccessToken}`; - } else if (accessToken) { - headers[globalLitellmHeaderName] = `Bearer ${accessToken}`; } const response = await fetch(url, { @@ -6931,7 +6929,7 @@ export const exchangeMcpOAuthToken = async ({ "Content-Type": "application/x-www-form-urlencoded", }; if (accessToken) { - headers["Authorization"] = `Bearer ${accessToken}`; + headers[globalLitellmHeaderName] = `Bearer ${accessToken}`; } const response = await fetch(url, {