Bug Report: cavemem install writes MCP config to wrong file
Date: 2026-04-28
Environment: Claude Code 2.1.121, cavemem 0.1.0, Linux (CachyOS), Node.js 25.9.0
Context
While debugging why cavemem didn't appear in Claude Code's MCP list, two bugs were found. The first (silent exit of cavemem mcp) is already tracked in issue #3 and PR #16. This report covers the second, independent bug.
Symptom
After running cavemem install, cavemem does not appear in Claude Code's /mcp list. The command reports success:
✓ wrote /home/<USERNAME>/.claude/settings.json
cavemem is wired into claude-code
No error shown. claude mcp list shows cavemem absent.
Root Cause
cavemem install writes the mcpServers entry to ~/.claude/settings.json. Per the Claude Code MCP documentation, MCP server configuration must be in ~/.claude.json (home directory root) — not ~/.claude/settings.json. The mcpServers key in settings.json is silently ignored by Claude Code.
Claude Code MCP scopes (from official docs):
| Scope |
Stored in |
| Local (default) |
~/.claude.json (under project path) |
| User |
~/.claude.json |
| Project |
.mcp.json in project root |
Workaround
Register via the Claude Code CLI directly:
claude mcp add --scope user cavemem /usr/lib/node_modules/cavemem/dist/index.js mcp
Root Cause in Source
packages/installers/src/claude-code.ts, settingsFile():
function settingsFile(): string {
return join(homedir(), '.claude', 'settings.json'); // ← wrong
}
Should be:
function settingsFile(): string {
return join(homedir(), '.claude.json'); // ← correct
}
Note: hooks can stay in ~/.claude/settings.json — Claude Code reads hooks from there correctly. Only the mcpServers write needs to move to ~/.claude.json.
Note: even after applying the fix from PR #16 (so cavemem mcp starts correctly), the server still won't appear in Claude Code until this config file issue is also resolved.
Note 2: Bug report created with Claude Sonnet. I'm not a programmer.
Bug Report:
cavemem installwrites MCP config to wrong fileDate: 2026-04-28
Environment: Claude Code 2.1.121, cavemem 0.1.0, Linux (CachyOS), Node.js 25.9.0
Context
While debugging why cavemem didn't appear in Claude Code's MCP list, two bugs were found. The first (silent exit of
cavemem mcp) is already tracked in issue #3 and PR #16. This report covers the second, independent bug.Symptom
After running
cavemem install, cavemem does not appear in Claude Code's/mcplist. The command reports success:No error shown.
claude mcp listshows cavemem absent.Root Cause
cavemem installwrites themcpServersentry to~/.claude/settings.json. Per the Claude Code MCP documentation, MCP server configuration must be in~/.claude.json(home directory root) — not~/.claude/settings.json. ThemcpServerskey insettings.jsonis silently ignored by Claude Code.Claude Code MCP scopes (from official docs):
~/.claude.json(under project path)~/.claude.json.mcp.jsonin project rootWorkaround
Register via the Claude Code CLI directly:
Root Cause in Source
packages/installers/src/claude-code.ts,settingsFile():Should be:
Note: hooks can stay in
~/.claude/settings.json— Claude Code reads hooks from there correctly. Only themcpServerswrite needs to move to~/.claude.json.Note: even after applying the fix from PR #16 (so
cavemem mcpstarts correctly), the server still won't appear in Claude Code until this config file issue is also resolved.Note 2: Bug report created with Claude Sonnet. I'm not a programmer.