Skip to content

cavemem mcp silent exit + install writes MCP config to wrong file #19

@patrickfiedler

Description

@patrickfiedler

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions