From e15d37b399fc186376843d77e8519545a7ead586 Mon Sep 17 00:00:00 2001 From: Atef Bellaaj Date: Fri, 12 Dec 2025 19:51:49 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=90=20feat:=20Add=20API=20key=20authen?= =?UTF-8?q?tication=20support=20for=20MCP=20servers=20(#10936)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🔐 feat: Add API key authentication support for MCP servers * Chore: Copilot comments fixes --------- Co-authored-by: Atef Bellaaj --- .../SidePanel/MCPBuilder/MCPAuth.tsx | 124 ++++++-- .../SidePanel/MCPBuilder/MCPServerDialog.tsx | 33 ++- client/src/locales/en/translation.json | 5 + .../src/mcp/registry/MCPServerInspector.ts | 6 + .../src/mcp/registry/MCPServersRegistry.ts | 18 +- .../__tests__/MCPServerInspector.test.ts | 49 ++++ .../__tests__/ServerConfigsDB.test.ts | 275 ++++++++++++++++++ .../src/mcp/registry/db/ServerConfigsDB.ts | 208 ++++++++++--- packages/api/src/utils/env.spec.ts | 153 ++++++++++ packages/api/src/utils/env.ts | 32 ++ packages/data-provider/src/mcp.ts | 17 ++ 11 files changed, 836 insertions(+), 84 deletions(-) diff --git a/client/src/components/SidePanel/MCPBuilder/MCPAuth.tsx b/client/src/components/SidePanel/MCPBuilder/MCPAuth.tsx index 9576a10bce..51f8347145 100644 --- a/client/src/components/SidePanel/MCPBuilder/MCPAuth.tsx +++ b/client/src/components/SidePanel/MCPBuilder/MCPAuth.tsx @@ -28,6 +28,7 @@ enum AuthorizationTypeEnum { export interface AuthConfig { auth_type?: AuthTypeEnum; api_key?: string; + api_key_source?: 'admin' | 'user'; // Whether admin provides key for all or each user provides their own api_key_authorization_type?: AuthorizationTypeEnum; api_key_custom_header?: string; oauth_client_id?: string; @@ -171,8 +172,6 @@ export default function MCPAuth({ {localize('com_ui_none')} - {/* - TODO Support API keys for auth
-
*/} +