User-scoped MCP servers crash Claude Code on Windows (segfault)
Description
Using claude mcp add --scope user to add a user-scoped MCP server causes Claude Code to crash with a segfault on every subsequent startup on Windows.
The --scope user flag stores a top-level mcpServers key in ~/.claude.json. When Claude Code starts and encounters this key, Bun crashes immediately with a segmentation fault.
Steps to Reproduce
- On Windows, run:
````
claude mcp add --scope user my-server -- cmd /c npx -y some-mcp-server
- This adds a top-level
mcpServersentry to~/.claude.json(outside ofprojects):
``json``
{
"projects": { ... },
"mcpServers": {
"my-server": {
"type": "stdio",
"command": "cmd",
"args": ["/c", "npx", "-y", "some-mcp-server"],
"env": {}
}
}
}
- Launch Claude Code — it crashes immediately.
Expected Behavior
Claude Code should start normally and make the MCP server available across all projects.
Actual Behavior
Bun Canary v1.3.9-canary.51 (d5628db2) Windows x64 (baseline)
panic(main thread): Segmentation fault at address 0xFFFFFFFFFFFFFFFF
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
Bun crash report: https://bun.report/1.3.9/e_2d5628dbmgkgEugogCgm+2W88outB4s+mqC49uiqC6ssiqCy7sqXozg0U23wN2/tgUm17jOimsjOw0vxvDCYKERNEL32.DLLut0LCSntdll.dll4zijBA2DD
Workaround
Remove the top-level mcpServers key from ~/.claude.json and instead add the server to each project entry individually under projects.<path>.mcpServers.
Environment
- Claude Code version: 2.1.x (installed via native method)
- OS: Windows 11 Pro 10.0.26200
- Bun: Canary v1.3.9-canary.51
- CPU: x64 (sse42 avx avx2)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗