Revert "fix(server) Differentiate command resolution by platform"
This reverts commit 0fa56e14d9.
This commit is contained in:
@@ -4,7 +4,6 @@ import cors from "cors";
|
|||||||
import EventSource from "eventsource";
|
import EventSource from "eventsource";
|
||||||
import { parseArgs } from "node:util";
|
import { parseArgs } from "node:util";
|
||||||
import { parse as shellParseArgs } from "shell-quote";
|
import { parse as shellParseArgs } from "shell-quote";
|
||||||
import { platform } from "node:os";
|
|
||||||
|
|
||||||
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
||||||
import {
|
import {
|
||||||
@@ -43,12 +42,7 @@ const createTransport = async (query: express.Request["query"]) => {
|
|||||||
const origArgs = shellParseArgs(query.args as string) as string[];
|
const origArgs = shellParseArgs(query.args as string) as string[];
|
||||||
const env = query.env ? JSON.parse(query.env as string) : undefined;
|
const env = query.env ? JSON.parse(query.env as string) : undefined;
|
||||||
|
|
||||||
// On Windows, we need to find the actual executable to run
|
const { cmd, args } = findActualExecutable(command, origArgs);
|
||||||
// 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(
|
console.log(
|
||||||
`Stdio transport: command=${cmd}, args=${args}, env=${JSON.stringify(env)}`,
|
`Stdio transport: command=${cmd}, args=${args}, env=${JSON.stringify(env)}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user