Summary
officecli mcp claude registers the MCP server in the wrong file — ~/.claude/settings.json — which Claude Code does not read MCP servers from. As a result the server is never loaded by Claude Code, yet officecli mcp list reports it as registered (false positive).
Claude Code loads MCP servers from ~/.claude.json (user scope) or a project-level .mcp.json — not from ~/.claude/settings.json. (settings.json is for permissions/hooks/env/model/etc.; an mcpServers key there is silently ignored.)
Environment
- officecli 1.0.111 (installed via Homebrew)
- macOS (Apple Silicon)
- Claude Code (CLI)
Steps to reproduce
$ officecli mcp claude
Registered officecli MCP in Claude Code.
Config: /Users/<me>/.claude/settings.json
$ claude mcp list | grep -i officecli
# (nothing — Claude Code does not see it)
$ officecli mcp list
...
✓ Claude Code registered # <-- false positive
officecli writes:
// ~/.claude/settings.json
"mcpServers": {
"officecli": { "command": ".../officecli", "args": ["mcp"] }
}
but claude mcp list still does not list it, confirming Claude Code ignores mcpServers in settings.json.
Expected
After officecli mcp claude, the server should appear in claude mcp list and be usable in Claude Code.
Root cause
src/officecli/McpInstaller.cs:
// L120-124
private static string GetClaudeSettingsPath() =>
Path.Combine(..., ".claude", "settings.json"); // wrong file
private static void InstallClaude() =>
InstallJson("Claude Code", GetClaudeSettingsPath(), "mcpServers");
The status check (L277, CheckJsonStatus("Claude Code", GetClaudeSettingsPath())) reads the same wrong path, which is why it reports success.
Suggested fix
Target a location Claude Code actually loads. Two options:
- Preferred — shell out to the official CLI, which handles file + scope correctly across versions:
claude mcp add -s user officecli -- officecli mcp
- Or write directly to
~/.claude.json under the top-level mcpServers key (user scope), instead of ~/.claude/settings.json.
Secondary issues
- Uninstall leaves residue:
officecli mcp uninstall claude removes the server entry but leaves an empty "mcpServers": {} key behind in settings.json.
- Status check is a false positive: because install and status both read
settings.json, officecli mcp list reports "registered" even though Claude Code never loads the server. The status check should verify the location Claude Code actually reads.
Summary
officecli mcp clauderegisters the MCP server in the wrong file —~/.claude/settings.json— which Claude Code does not read MCP servers from. As a result the server is never loaded by Claude Code, yetofficecli mcp listreports it as registered (false positive).Claude Code loads MCP servers from
~/.claude.json(user scope) or a project-level.mcp.json— not from~/.claude/settings.json. (settings.jsonis for permissions/hooks/env/model/etc.; anmcpServerskey there is silently ignored.)Environment
Steps to reproduce
officecliwrites:but
claude mcp liststill does not list it, confirming Claude Code ignoresmcpServersinsettings.json.Expected
After
officecli mcp claude, the server should appear inclaude mcp listand be usable in Claude Code.Root cause
src/officecli/McpInstaller.cs:The status check (
L277,CheckJsonStatus("Claude Code", GetClaudeSettingsPath())) reads the same wrong path, which is why it reports success.Suggested fix
Target a location Claude Code actually loads. Two options:
claude mcp add -s user officecli -- officecli mcp~/.claude.jsonunder the top-levelmcpServerskey (user scope), instead of~/.claude/settings.json.Secondary issues
officecli mcp uninstall clauderemoves the server entry but leaves an empty"mcpServers": {}key behind insettings.json.settings.json,officecli mcp listreports "registered" even though Claude Code never loads the server. The status check should verify the location Claude Code actually reads.