From 84360bfde8f10b47a384e681393f982363cfad30 Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Wed, 12 Mar 2025 23:59:18 +0800 Subject: [PATCH] fix(package): update @modelcontextprotocol/sdk to use a patch for platform-specific shell handling --- ...extprotocol-sdk-npm-1.6.1-b46313efe7.patch | 26 +++++++++++++++++++ package.json | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .yarn/patches/@modelcontextprotocol-sdk-npm-1.6.1-b46313efe7.patch diff --git a/.yarn/patches/@modelcontextprotocol-sdk-npm-1.6.1-b46313efe7.patch b/.yarn/patches/@modelcontextprotocol-sdk-npm-1.6.1-b46313efe7.patch new file mode 100644 index 00000000..830f101d --- /dev/null +++ b/.yarn/patches/@modelcontextprotocol-sdk-npm-1.6.1-b46313efe7.patch @@ -0,0 +1,26 @@ +diff --git a/dist/cjs/client/stdio.js b/dist/cjs/client/stdio.js +index 2ada8771c5f76673b5021d6453c6bdd7e0b88013..89f6ea9ca7de86294d3d966f3454b98e19bfe534 100644 +--- a/dist/cjs/client/stdio.js ++++ b/dist/cjs/client/stdio.js +@@ -68,7 +68,7 @@ class StdioClientTransport { + this._process = (0, node_child_process_1.spawn)(this._serverParams.command, (_a = this._serverParams.args) !== null && _a !== void 0 ? _a : [], { + env: (_b = this._serverParams.env) !== null && _b !== void 0 ? _b : getDefaultEnvironment(), + stdio: ["pipe", "pipe", (_c = this._serverParams.stderr) !== null && _c !== void 0 ? _c : "inherit"], +- shell: false, ++ shell: process.platform === 'win32' ? true : false, + signal: this._abortController.signal, + windowsHide: node_process_1.default.platform === "win32" && isElectron(), + cwd: this._serverParams.cwd, +diff --git a/dist/esm/client/stdio.js b/dist/esm/client/stdio.js +index 387c982fd40fd8db9790a78e1a05c9ecb81501c0..7b7e60a306bca73149609015a27e904a0a68ca02 100644 +--- a/dist/esm/client/stdio.js ++++ b/dist/esm/client/stdio.js +@@ -61,7 +61,7 @@ export class StdioClientTransport { + this._process = spawn(this._serverParams.command, (_a = this._serverParams.args) !== null && _a !== void 0 ? _a : [], { + env: (_b = this._serverParams.env) !== null && _b !== void 0 ? _b : getDefaultEnvironment(), + stdio: ["pipe", "pipe", (_c = this._serverParams.stderr) !== null && _c !== void 0 ? _c : "inherit"], +- shell: false, ++ shell: process.platform === 'win32' ? true : false, + signal: this._abortController.signal, + windowsHide: process.platform === "win32" && isElectron(), + cwd: this._serverParams.cwd, diff --git a/package.json b/package.json index 95ea5103..b6999dea 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "@llm-tools/embedjs-loader-web": "^0.1.28", "@llm-tools/embedjs-loader-xml": "^0.1.28", "@llm-tools/embedjs-openai": "^0.1.28", - "@modelcontextprotocol/sdk": "^1.6.1", + "@modelcontextprotocol/sdk": "patch:@modelcontextprotocol/sdk@npm%3A1.6.1#~/.yarn/patches/@modelcontextprotocol-sdk-npm-1.6.1-b46313efe7.patch", "@notionhq/client": "^2.2.15", "@types/react-infinite-scroll-component": "^5.0.0", "adm-zip": "^0.5.16",