add env option to MCP
This commit is contained in:
parent
bfd2249080
commit
f2820feca9
3 changed files with 9 additions and 0 deletions
|
|
@ -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
1
core/index.d.ts
vendored
|
|
@ -940,6 +940,7 @@ export interface StdioOptions {
|
|||
type: "stdio";
|
||||
command: string;
|
||||
args: string[];
|
||||
env?: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface WebSocketOptions {
|
||||
|
|
|
|||
|
|
@ -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"]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue