From 0fa56e14d9da239e1c04e2bd4a1634baf7d61ee2 Mon Sep 17 00:00:00 2001 From: Jack Steam Date: Tue, 17 Dec 2024 16:49:55 -0600 Subject: [PATCH 1/3] fix(server) Differentiate command resolution by platform --- server/src/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/src/index.ts b/server/src/index.ts index b82b17d51..67ff9a01b 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -4,6 +4,7 @@ import cors from "cors"; import EventSource from "eventsource"; import { parseArgs } from "node:util"; import { parse as shellParseArgs } from "shell-quote"; +import { platform } from "node:os"; import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js"; import { @@ -42,7 +43,12 @@ const createTransport = async (query: express.Request["query"]) => { const origArgs = shellParseArgs(query.args as string) as string[]; const env = query.env ? JSON.parse(query.env as string) : undefined; - const { cmd, args } = findActualExecutable(command, origArgs); + // On Windows, we need to find the actual executable to run + // On other platforms, we can just use the command as-is + const { cmd, args } = + platform() === "win32" + ? findActualExecutable(command, origArgs) + : { cmd: command, args: origArgs }; console.log( `Stdio transport: command=${cmd}, args=${args}, env=${JSON.stringify(env)}`, From 406828ade242ab71517479b0834f17ab80fd8520 Mon Sep 17 00:00:00 2001 From: Jack Steam Date: Tue, 18 Feb 2025 11:50:53 -0600 Subject: [PATCH 2/3] Revert "fix(server) Differentiate command resolution by platform" This reverts commit 0fa56e14d9da239e1c04e2bd4a1634baf7d61ee2. --- server/src/index.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/server/src/index.ts b/server/src/index.ts index 67ff9a01b..b82b17d51 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -4,7 +4,6 @@ import cors from "cors"; import EventSource from "eventsource"; import { parseArgs } from "node:util"; import { parse as shellParseArgs } from "shell-quote"; -import { platform } from "node:os"; import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js"; import { @@ -43,12 +42,7 @@ const createTransport = async (query: express.Request["query"]) => { const origArgs = shellParseArgs(query.args as string) as string[]; const env = query.env ? JSON.parse(query.env as string) : undefined; - // On Windows, we need to find the actual executable to run - // On other platforms, we can just use the command as-is - const { cmd, args } = - platform() === "win32" - ? findActualExecutable(command, origArgs) - : { cmd: command, args: origArgs }; + const { cmd, args } = findActualExecutable(command, origArgs); console.log( `Stdio transport: command=${cmd}, args=${args}, env=${JSON.stringify(env)}`, From db6494353c68c57f9dcf1b931bb9158fc27766c2 Mon Sep 17 00:00:00 2001 From: Jack Steam Date: Tue, 18 Feb 2025 11:53:56 -0600 Subject: [PATCH 3/3] chore: update spawn-rx to v5.1.2 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 13f4248b9..5f329648e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@modelcontextprotocol/inspector-server": "0.3.0", "concurrently": "^9.0.1", "shell-quote": "^1.8.2", - "spawn-rx": "^5.1.0", + "spawn-rx": "^5.1.2", "ts-node": "^10.9.2" }, "bin": { @@ -5748,9 +5748,9 @@ } }, "node_modules/spawn-rx": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/spawn-rx/-/spawn-rx-5.1.0.tgz", - "integrity": "sha512-b4HX44hI0usMiHu6LNaZUVg0BGqHuBcl+81iEhZwhvKHz1efTqD/CHBcUbm/uIe5TARy9pJolxU2NMfh6GuQBA==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/spawn-rx/-/spawn-rx-5.1.2.tgz", + "integrity": "sha512-/y7tJKALVZ1lPzeZZB9jYnmtrL7d0N2zkorii5a7r7dhHkWIuLTzZpZzMJLK1dmYRgX/NCc4iarTO3F7BS2c/A==", "license": "MIT", "dependencies": { "debug": "^4.3.7", diff --git a/package.json b/package.json index c2625881c..bd835c4cd 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "@modelcontextprotocol/inspector-server": "0.3.0", "concurrently": "^9.0.1", "shell-quote": "^1.8.2", - "spawn-rx": "^5.1.0", + "spawn-rx": "^5.1.2", "ts-node": "^10.9.2" }, "devDependencies": {