add env option to MCP

This commit is contained in:
Nate 2025-01-03 13:45:24 -05:00
parent bfd2249080
commit f2820feca9
3 changed files with 9 additions and 0 deletions

View file

@ -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));

1
core/index.d.ts vendored
View file

@ -940,6 +940,7 @@ export interface StdioOptions {
type: "stdio";
command: string;
args: string[];
env?: Record<string, string>;
}
export interface WebSocketOptions {

View file

@ -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"]