[BUG] VSCode extension: MCP server env vars from global mcp.json not passed to server process
Bug Description
MCP server env block in the global ~/.claude/mcp.json is not passed to the spawned server process when running inside the VSCode extension. The server starts and tools are listed, but the environment variables are missing so tools fail at runtime.
Environment
- Claude Code: VSCode extension
- Platform: macOS (Darwin 25.2.0)
- MCP server:
@smartbear/mcp@latest(v0.13.5) via npx
Reproduction Steps
- Configure an MCP server in
~/.claude/mcp.json:
{
"mcpServers": {
"smartbear": {
"command": "npx",
"args": ["-y", "@smartbear/mcp@latest"],
"env": {
"BUGSNAG_AUTH_TOKEN": "<valid-token>"
}
}
}
}
- The project also has a
.mcp.jsonat the repo root with different servers (no overlap):
{
"mcpServers": {
"notion": { "type": "http", "url": "https://mcp.notion.com/mcp" },
"linear": { "command": "npx", "args": ["-y", "mcp-remote", "https://mcp.linear.app/mcp"] },
"figma": { "url": "https://mcp.figma.com/mcp" }
}
}
- Open VSCode with Claude Code extension
- MCP server starts and tools appear in deferred tools list (e.g.
bugsnag_list_projects) - Call any Bugsnag tool → error:
"The tool is not configured - configuration options for BugSnag are missing or invalid."
Diagnosis
| Test | Result |
|------|--------|
| Token validity (direct curl to Bugsnag API) | 200 OK |
| MCP server with manual protocol handshake (initialize → notifications/initialized → tools/call) with env var | Works — projects returned |
| Server stderr under VSCode extension | "No clients configured. Please provide valid environment variables for at least one client" |
| Project-level MCP servers (Linear, Figma — no env block) | Works |
| Global MCP server (SmartBear — with env block) | Fails |
The server process starts (confirmed via ps aux), tools are registered, but the env block values are not injected into the process environment.
Summary: Only the global ~/.claude/mcp.json server with env block fails. Project-level .mcp.json servers without env block work fine. This narrows the bug to global mcp.json env block injection into stdio server processes.
Expected Behavior
The env block values from ~/.claude/mcp.json should be injected into the MCP server's process environment when the extension spawns the server.
_🤖 Generated with Claude Code_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗