docs: use cd-based MCP config in CONTRIBUTING local dev examples (#526)

Switch local development MCP server config from `npm --prefix` to
`bash -c "cd DIR && npm --silent run start:stdio"`. The --prefix form
caused connection instability in Claude Desktop (reconnect loops with
orphan builds competing on the same dist/).

Also updated example paths from ~/code/ext-apps to ~/src/ext-apps.
This commit is contained in:
Olivier Chafik 2026-03-06 13:44:57 +00:00 • committed by GitHub
commit b8a1349c07
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -277,9 +277,9 @@ cd ext-apps
npm install npm install
``` ```
Then configure your MCP client to build and run the local server. Replace `~/code/ext-apps` with your actual clone path. Then configure your MCP client to build and run the local server. Replace `~/src/ext-apps` with your actual clone path.
Most example servers have a `start:stdio` script that builds and launches in stdio mode. Use `npm --silent run start:stdio` for these: Most example servers have a `start:stdio` script that builds and launches in stdio mode:
<details> <details>
<summary>MCP client configuration for local development (all examples)</summary> <summary>MCP client configuration for local development (all examples)</summary>
@ -288,207 +288,150 @@ Most example servers have a `start:stdio` script that builds and launches in std
{ {
"mcpServers": { "mcpServers": {
"basic-react": { "basic-react": {
"command": "npm", "command": "bash",
"args": [ "args": [
"--silent", "-c",
"--prefix", "cd ~/src/ext-apps/examples/basic-server-react && npm --silent run start:stdio"
"~/code/ext-apps/examples/basic-server-react",
"run",
"start:stdio"
] ]
}, },
"basic-vanillajs": { "basic-vanillajs": {
"command": "npm", "command": "bash",
"args": [ "args": [
"--silent", "-c",
"--prefix", "cd ~/src/ext-apps/examples/basic-server-vanillajs && npm --silent run start:stdio"
"~/code/ext-apps/examples/basic-server-vanillajs",
"run",
"start:stdio"
] ]
}, },
"basic-vue": { "basic-vue": {
"command": "npm", "command": "bash",
"args": [ "args": [
"--silent", "-c",
"--prefix", "cd ~/src/ext-apps/examples/basic-server-vue && npm --silent run start:stdio"
"~/code/ext-apps/examples/basic-server-vue",
"run",
"start:stdio"
] ]
}, },
"basic-svelte": { "basic-svelte": {
"command": "npm", "command": "bash",
"args": [ "args": [
"--silent", "-c",
"--prefix", "cd ~/src/ext-apps/examples/basic-server-svelte && npm --silent run start:stdio"
"~/code/ext-apps/examples/basic-server-svelte",
"run",
"start:stdio"
] ]
}, },
"basic-preact": { "basic-preact": {
"command": "npm", "command": "bash",
"args": [ "args": [
"--silent", "-c",
"--prefix", "cd ~/src/ext-apps/examples/basic-server-preact && npm --silent run start:stdio"
"~/code/ext-apps/examples/basic-server-preact",
"run",
"start:stdio"
] ]
}, },
"basic-solid": { "basic-solid": {
"command": "npm", "command": "bash",
"args": [ "args": [
"--silent", "-c",
"--prefix", "cd ~/src/ext-apps/examples/basic-server-solid && npm --silent run start:stdio"
"~/code/ext-apps/examples/basic-server-solid",
"run",
"start:stdio"
] ]
}, },
"budget-allocator": { "budget-allocator": {
"command": "npm", "command": "bash",
"args": [ "args": [
"--silent", "-c",
"--prefix", "cd ~/src/ext-apps/examples/budget-allocator-server && npm --silent run start:stdio"
"~/code/ext-apps/examples/budget-allocator-server",
"run",
"start:stdio"
] ]
}, },
"cohort-heatmap": { "cohort-heatmap": {
"command": "npm", "command": "bash",
"args": [ "args": [
"--silent", "-c",
"--prefix", "cd ~/src/ext-apps/examples/cohort-heatmap-server && npm --silent run start:stdio"
"~/code/ext-apps/examples/cohort-heatmap-server",
"run",
"start:stdio"
] ]
}, },
"customer-segmentation": { "customer-segmentation": {
"command": "npm", "command": "bash",
"args": [ "args": [
"--silent", "-c",
"--prefix", "cd ~/src/ext-apps/examples/customer-segmentation-server && npm --silent run start:stdio"
"~/code/ext-apps/examples/customer-segmentation-server",
"run",
"start:stdio"
] ]
}, },
"map": { "map": {
"command": "npm", "command": "bash",
"args": [ "args": [
"--silent", "-c",
"--prefix", "cd ~/src/ext-apps/examples/map-server && npm --silent run start:stdio"
"~/code/ext-apps/examples/map-server",
"run",
"start:stdio"
] ]
}, },
"pdf": { "pdf": {
"command": "npm", "command": "bash",
"args": [ "args": [
"--silent", "-c",
"--prefix", "cd ~/src/ext-apps/examples/pdf-server && npm --silent run start:stdio"
"~/code/ext-apps/examples/pdf-server",
"run",
"start:stdio"
] ]
}, },
"scenario-modeler": { "scenario-modeler": {
"command": "npm", "command": "bash",
"args": [ "args": [
"--silent", "-c",
"--prefix", "cd ~/src/ext-apps/examples/scenario-modeler-server && npm --silent run start:stdio"
"~/code/ext-apps/examples/scenario-modeler-server",
"run",
"start:stdio"
] ]
}, },
"shadertoy": { "shadertoy": {
"command": "npm", "command": "bash",
"args": [ "args": [
"--silent", "-c",
"--prefix", "cd ~/src/ext-apps/examples/shadertoy-server && npm --silent run start:stdio"
"~/code/ext-apps/examples/shadertoy-server",
"run",
"start:stdio"
] ]
}, },
"sheet-music": { "sheet-music": {
"command": "npm", "command": "bash",
"args": [ "args": [
"--silent", "-c",
"--prefix", "cd ~/src/ext-apps/examples/sheet-music-server && npm --silent run start:stdio"
"~/code/ext-apps/examples/sheet-music-server",
"run",
"start:stdio"
] ]
}, },
"system-monitor": { "system-monitor": {
"command": "npm", "command": "bash",
"args": [ "args": [
"--silent", "-c",
"--prefix", "cd ~/src/ext-apps/examples/system-monitor-server && npm --silent run start:stdio"
"~/code/ext-apps/examples/system-monitor-server",
"run",
"start:stdio"
] ]
}, },
"threejs": { "threejs": {
"command": "npm", "command": "bash",
"args": [ "args": [
"--silent", "-c",
"--prefix", "cd ~/src/ext-apps/examples/threejs-server && npm --silent run start:stdio"
"~/code/ext-apps/examples/threejs-server",
"run",
"start:stdio"
] ]
}, },
"transcript": { "transcript": {
"command": "npm", "command": "bash",
"args": [ "args": [
"--silent", "-c",
"--prefix", "cd ~/src/ext-apps/examples/transcript-server && npm --silent run start:stdio"
"~/code/ext-apps/examples/transcript-server",
"run",
"start:stdio"
] ]
}, },
"video-resource": { "video-resource": {
"command": "npm", "command": "bash",
"args": [ "args": [
"--silent", "-c",
"--prefix", "cd ~/src/ext-apps/examples/video-resource-server && npm --silent run start:stdio"
"~/code/ext-apps/examples/video-resource-server",
"run",
"start:stdio"
] ]
}, },
"wiki-explorer": { "wiki-explorer": {
"command": "npm", "command": "bash",
"args": [ "args": [
"--silent", "-c",
"--prefix", "cd ~/src/ext-apps/examples/wiki-explorer-server && npm --silent run start:stdio"
"~/code/ext-apps/examples/wiki-explorer-server",
"run",
"start:stdio"
] ]
}, },
"qr": { "qr": {
"command": "bash", "command": "bash",
"args": [ "args": [
"-c", "-c",
"uv run ~/code/ext-apps/examples/qr-server/server.py --stdio" "uv run ~/src/ext-apps/examples/qr-server/server.py --stdio"
] ]
}, },
"say": { "say": {
"command": "bash", "command": "bash",
"args": [ "args": [
"-c", "-c",
"uv run --index https://pypi.org/simple ~/code/ext-apps/examples/say-server/server.py --stdio" "uv run --index https://pypi.org/simple ~/src/ext-apps/examples/say-server/server.py --stdio"
] ]
} }
} }