AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
MCP verified MIT Self-run

Mcp Mac Setup

mcp-kylebrodeur-mcp-mac-setup · by kylebrodeur

Fix VS Code MCP stdio server launches on macOS when Node/pnpm is managed via nvm or fnm

No reviews yet
0 installs
19 views
0.0% view→install

Install

$ agentstack add mcp-kylebrodeur-mcp-mac-setup

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/mcp-kylebrodeur-mcp-mac-setup)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Mcp Mac Setup? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

mcp-mac-setup

> Fix stdio MCP server launches when Node is managed via nvm or fnm — works with VS Code, Cursor, Claude Code, Claude Desktop, and any host reading the standard {"mcpServers": { ... }} JSON config.

[](https://www.npmjs.com/package/@kylebrodeur/mcp-mac-setup) [](LICENSE)


The Problem

GUI-launched applications (VS Code, Cursor, Claude Desktop, etc.) inherit their environment from launchd, not from your interactive shell. That means ~/.zshrc / ~/.bash_profile are never sourced, and any tool installed under a Node version manager (nvm, fnm) is missing from PATH.

When one of those apps tries to spawn an MCP server, it exec()s the command directly — and gets back spawn pnpm ENOENT, command not found, or — if you "fixed" it with an absolute path — silent breakage after you upgrade Node and the absolute path stops existing.

Why this is hard to solve in general

  • macOS intentionally keeps GUI app environments minimal for reproducibility.
  • VS Code's MCP server docs note the requirement but don't provide a fix for version-manager users.
  • The absolute path of pnpm / node / npx changes every time you switch Node versions (~/.nvm/versions/node/v20.x.x/bin/pnpm~/.nvm/versions/node/v22.x.x/bin/pnpm).
  • One-time hardcoding goes stale. You need a script that re-resolves the real path each time you switch.

mcp-mac-setup does this:

  1. Detects your Node version manager (fnm, nvm, or PNPM_HOME / which fallback).
  2. Resolves the absolute paths to the active node, npx, pnpm, npm binaries.
  3. Rewrites every stdio MCP server entry in the target config so that:
  • command is the absolute path to the right binary for that server
  • env.PATH is hardcoded with the active bin/ first
  • env.PNPM_HOME / env.NVM_DIR / env.NVM_BIN are set when relevant

Hosts Supported

Any host that reads {"mcpServers": { ... }} JSON. Includes:

| Host | User-level config | Workspace / project config | |---|---|---| | VS Code | ~/Library/Application Support/Code/User/mcp.json | .vscode/mcp.json | | Cursor | (via project root) | ./.mcp.json | | Claude Code | ~/.claude.json | ./.mcp.json | | Claude Desktop | ~/Library/Application Support/Claude/claude_desktop_config.json | (none — user-level only) |

Pass --target to target a specific file.


Quick Start

# rewrite every stdio server in the user-level mcp.json with absolute paths
pnpm dlx @kylebrodeur/mcp-mac-setup --binary auto

# verify everything matches the current Node version (CI-friendly)
pnpm dlx @kylebrodeur/mcp-mac-setup --check

# then reload the host
#   VS Code:        Cmd+Shift+P → Developer: Reload Window
#   Claude Code:    restart MCP servers
#   Cursor:         restart MCP servers

Why --binary auto?

Different MCP servers use different launchers:

{
  "mcpServers": {
    "playwright":  { "command": "pnpm",   "args": ["dlx", "@playwright/mcp"] },
    "codegraph":   { "command": "npx",    "args": ["-y", "@colbymchenry/codegraph", "serve", "--mcp"] },
    "custom-shim": { "command": "node",   "args": ["./bin/my-mcp-server.js"] }
  }
}

--binary auto rewrites each server's command to the matching absolute path under the resolved Node bin directory, based on what the server actually uses. --binary pnpm (the v1.0 default) still works and forces every server through pnpm.


CLI Options

| Flag | Description | |---|---| | --binary | auto (per-server) \| pnpm (legacy default) \| node \| npx \| npm \| all | | --server | Update a single named server only | | --target | Write to ` instead of the user-level mcp.json | | --workspace | Read workspace .vscode/mcp.json from | | --prefer | Detection preference: auto \| fnm \| nvm | | --check | Exit 0 if config matches current runtime; 1 if rewrite is needed | | --install-task | Write a .vscode/tasks.json entry into the project | | --task-dir | With --install-task: target /.vscode` |

Examples

# Fix everything in the user-level VS Code mcp.json
pnpm dlx @kylebrodeur/mcp-mac-setup --binary auto

# Fix a single server in a project-root .mcp.json
pnpm dlx @kylebrodeur/mcp-mac-setup --binary auto --server codegraph --target ./.mcp.json

# Force every server through pnpm (v1.0 behavior)
pnpm dlx @kylebrodeur/mcp-mac-setup --binary pnpm

# CI guard: fail the build if the config is stale
pnpm dlx @kylebrodeur/mcp-mac-setup --binary auto --check

# Use fnm even if both nvm and fnm are installed
pnpm dlx @kylebrodeur/mcp-mac-setup --binary auto --prefer fnm

When to Re-run

Re-run mcp-mac-setup after:

  • Upgrading your Node version (nvm use / fnm use)
  • Switching Node version managers
  • Adding or removing MCP servers that depend on node/npx/pnpm/npm
  • Any change that moves the Node-managed binaries to new absolute paths

What Gets Preserved

The script only rewrites fields that need to change:

  • Absolute paths you wrote yourself (e.g. /opt/custom/binary) → command preserved; only env.PATH is injected so the server can find its own helpers
  • HTTP / SSE servers (type: "http" or type: "sse") → skipped entirely
  • args arrays → unchanged (the gallery "exec" → "dlx" typo fix still applies under --binary pnpm)
  • User-defined env vars → preserved, only PATH / PNPM_HOME / NVM_* are merged in

VS Code Task

Install a one-keystroke task into any project:

pnpm dlx @kylebrodeur/mcp-mac-setup --install-task

Then: Cmd+Shift+P → Tasks: Run Task → Fix MCP runtime path.

The repo's own .vscode/tasks.json exposes the same tasks for contributors.


Detection Priority

  1. fnm~/.local/share/fnm/aliases/default/bin/
  2. nvm — reads ~/.nvm/alias/default (the active version)
  3. PNPM_HOME / which pnpm — last-resort fallback (warns; path may be unstable)

Override priority with --prefer fnm or --prefer nvm.


Requirements

  • macOS or Linux
  • Node ≥ 18
  • nvm or fnm managing your Node install (PNPM_HOME fallback also works)

Contributing

Issues and PRs welcome at github.com/kylebrodeur/mcp-mac-setup.

Run the test suite locally:

pnpm test

License

[MIT](LICENSE)

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.