From f2820feca92490a4eff42aa6773dec2f6de471bd Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 3 Jan 2025 13:45:24 -0500 Subject: [PATCH] add env option to MCP --- core/context/mcp/index.ts | 1 + core/index.d.ts | 1 + extensions/vscode/config_schema.json | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/core/context/mcp/index.ts b/core/context/mcp/index.ts index e214b1e02..26be2f471 100644 --- a/core/context/mcp/index.ts +++ b/core/context/mcp/index.ts @@ -72,6 +72,7 @@ class MCPConnection { return new StdioClientTransport({ command: options.transport.command, args: options.transport.args, + env: options.transport.env, }); case "websocket": return new WebSocketClientTransport(new URL(options.transport.url)); diff --git a/core/index.d.ts b/core/index.d.ts index d916a19f1..2d7622895 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -940,6 +940,7 @@ export interface StdioOptions { type: "stdio"; command: string; args: string[]; + env?: Record; } export interface WebSocketOptions { diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index c9df4e976..c0ffddd3a 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -3151,6 +3151,13 @@ "items": { "type": "string" } + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Environment variables to pass to the command" } }, "required": ["type", "command", "args"]