diff --git a/core/context/mcp/MCPConnection.ts b/core/context/mcp/MCPConnection.ts index 489d53ccf..6db095de4 100644 --- a/core/context/mcp/MCPConnection.ts +++ b/core/context/mcp/MCPConnection.ts @@ -55,7 +55,9 @@ class MCPConnection { private constructTransport(options: MCPOptions): Transport { switch (options.transport.type) { case "stdio": - const env: Record = options.transport.env || {}; + const env: Record = options.transport.env + ? { ...options.transport.env } + : {}; if (process.env.PATH !== undefined) { env.PATH = process.env.PATH; }