🐛 Fix MCP server build failures on Windows (#11197)

Two Windows-specific issues in packages/server/package.json:

1. Path resolution: `node scripts/copy-resources.js` could fail in some
   Windows environments (bash-in-CMD) because the bare relative path gets
   mis-parsed. Change to `node ./scripts/copy-resources.js` to make the
   path explicit.

2. esbuild binary not found: bare `esbuild` fails when the node_modules/.bin
   shim is not on PATH in certain Windows setups. Change to `pnpm exec esbuild`
   so pnpm resolves the local binary via its own mechanism, consistent across
   platforms.

Fixes #8637

Signed-off-by: Andrey Antukh <niwi@niwi.nz>
Co-authored-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
0xTHAC0 2026-09-24 18:46:59 +05:30 committed by GitHub
parent eda9e670be
commit 9d7a685f3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,8 +5,8 @@
"type": "module",
"main": "dist/index.js",
"scripts": {
"build:server": "esbuild src/index.ts --bundle --platform=node --target=node20 --format=esm --outfile=dist/index.js --external:@modelcontextprotocol/* --external:ws --external:express --external:class-transformer --external:class-validator --external:reflect-metadata --external:pino --external:pino-pretty --external:pino-loki --external:js-yaml --external:sharp --external:nrepl-client --external:ioredis",
"build": "pnpm run build:server && node scripts/copy-resources.js",
"build:server": "pnpm exec esbuild ./src/index.ts --bundle --platform=node --target=node20 --format=esm --outfile=dist/index.js --external:@modelcontextprotocol/* --external:ws --external:express --external:class-transformer --external:class-validator --external:reflect-metadata --external:pino --external:pino-pretty --external:pino-loki --external:js-yaml --external:sharp --external:nrepl-client --external:ioredis",
"build": "pnpm run build:server && node ./scripts/copy-resources.js",
"build:types": "tsc --emitDeclarationOnly --outDir dist",
"start": "node dist/index.js",
"start:multi-user": "node dist/index.js --multi-user",