File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
1212import { SSEServerTransport } from "@modelcontextprotocol/sdk/server/sse.js" ;
1313import express from "express" ;
1414import mcpProxy from "./mcpProxy.js" ;
15+ import { findActualExecutable } from "spawn-rx" ;
1516
1617// Polyfill EventSource for an SSE client in Node.js
1718// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -37,14 +38,17 @@ const createTransport = async (query: express.Request["query"]) => {
3738
3839 if ( transportType === "stdio" ) {
3940 const command = query . command as string ;
40- const args = ( query . args as string ) . split ( / \s + / ) ;
41+ const origArgs = ( query . args as string ) . split ( / \s + / ) ;
4142 const env = query . env ? JSON . parse ( query . env as string ) : undefined ;
4243
44+ const { cmd, args } = findActualExecutable ( command , origArgs ) ;
45+
4346 console . log (
44- `Stdio transport: command=${ command } , args=${ args } , env=${ JSON . stringify ( env ) } ` ,
47+ `Stdio transport: command=${ cmd } , args=${ args } , env=${ JSON . stringify ( env ) } ` ,
4548 ) ;
49+
4650 const transport = new StdioClientTransport ( {
47- command,
51+ command : cmd ,
4852 args,
4953 env,
5054 stderr : "pipe" ,
You can’t perform that action at this time.
0 commit comments