Pass all environment variables to MCP server instead of just PATH (#8602)
This commit is contained in:
parent
1c1fce33eb
commit
e761b68bc6
1 changed files with 6 additions and 2 deletions
|
|
@ -509,8 +509,12 @@ export class MCPService
|
|||
serverConfig: StdioMcpServer,
|
||||
): StdioClientTransport {
|
||||
const env: Record<string, string> = serverConfig.env || {};
|
||||
if (process.env.PATH !== undefined) {
|
||||
env.PATH = process.env.PATH;
|
||||
if (process.env) {
|
||||
for (const [key, value] of Object.entries(process.env)) {
|
||||
if (!(key in env) && !!value) {
|
||||
env[key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new StdioClientTransport({
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue