MCP server config args and env not passed to spawned subprocesses
Resolved 💬 3 comments Opened Feb 10, 2026 by prong-raft-squishy Closed Feb 10, 2026
When defining an MCP server in ~/.claude/.mcp.json, the args (beyond the package name) and env fields are silently ignored — they never reach the spawned subprocess.
Reproduction
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest", "--browser=chromium"],
"env": {
"PLAYWRIGHT_MCP_BROWSER": "chromium"
}
}
}
}
The spawned process (verified via ps -wwE) shows:
- Command:
npm exec @playwright/mcp@latest— no--browser=chromiumflag - Environment: no
PLAYWRIGHT_MCP_BROWSERvariable present
Expected
Both the CLI flag and the env var should be passed through to the MCP subprocess.
Impact
Any MCP server that requires configuration via CLI flags or environment variables cannot be configured through .mcp.json. The only workaround is to either patch the MCP server's source code in the npx cache or use a wrapper script that sets env vars before exec.
Environment
- Claude Code version: latest (as of 2026-02-09)
- macOS, Apple Silicon
- Node 25.4.0, npm 11.7.0
Notes
- The
argsissue may be related tonpx→npm execconversion, where args after the package spec need a--separator to be forwarded to the package rather than interpreted by npm itself. - The
envissue appears to be a separate bug — the env block is simply not applied to the child process environment.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗