-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
Description
The package's bin file (build/index.js) is missing the Node.js shebang line (#!/usr/bin/env node), which causes the package to fail when executed via npx on Linux or WSL environments.
Steps to Reproduce
-
Run on Linux or WSL:
npx -y @illuminaresolutions/n8n-mcp-server
-
Observe the error:
/home/user/.npm/_npx/.../node_modules/.bin/n8n-mcp-server: 1: import: not found /home/user/.npm/_npx/.../node_modules/.bin/n8n-mcp-server: 2: import: not found ...
Expected Behavior
The server should start successfully with the message:
N8N MCP Server running on stdio
Actual Behavior
The shell tries to interpret the JavaScript file directly instead of running it with Node.js, resulting in syntax errors.
Root Cause
The build/index.js file is missing the shebang line at the top:
#!/usr/bin/env nodeSuggested Fix
Add the shebang to src/index.ts or modify the build script in package.json to prepend it:
"scripts": {
"build": "tsc && echo '#!/usr/bin/env node' | cat - build/index.js > temp && mv temp build/index.js && chmod +x build/index.js"
}Or simply add it to the source file src/index.ts:
#!/usr/bin/env node
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
// ... rest of the codeWorkaround
Manually add the shebang after installation:
sed -i '1i#!/usr/bin/env node' ~/.npm/_npx/*/node_modules/.bin/n8n-mcp-serverEnvironment
- OS: Linux / WSL2
- Node.js: v18+
- Package version: 1.0.1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels