File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import cors from "cors";
4
4
import EventSource from "eventsource" ;
5
5
import { parseArgs } from "node:util" ;
6
6
import { parse as shellParseArgs } from "shell-quote" ;
7
+ import { platform } from "node:os" ;
7
8
8
9
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js" ;
9
10
import {
@@ -42,7 +43,12 @@ const createTransport = async (query: express.Request["query"]) => {
42
43
const origArgs = shellParseArgs ( query . args as string ) as string [ ] ;
43
44
const env = query . env ? JSON . parse ( query . env as string ) : undefined ;
44
45
45
- const { cmd, args } = findActualExecutable ( command , origArgs ) ;
46
+ // On Windows, we need to find the actual executable to run
47
+ // On other platforms, we can just use the command as-is
48
+ const { cmd, args } =
49
+ platform ( ) === "win32"
50
+ ? findActualExecutable ( command , origArgs )
51
+ : { cmd : command , args : origArgs } ;
46
52
47
53
console . log (
48
54
`Stdio transport: command=${ cmd } , args=${ args } , env=${ JSON . stringify ( env ) } ` ,
You can’t perform that action at this time.
0 commit comments