store: MCP server user-scope config: ~/.claude.json + one-time /mcp enable

This commit is contained in:
Cal Corum 2026-02-20 11:30:17 -06:00
parent ac5497670d
commit 53442a8a8f

View File

@ -0,0 +1,49 @@
---
id: a2488459-bc9e-4005-969c-44eef486ebc2
type: configuration
title: "MCP server user-scope config: ~/.claude.json + one-time /mcp enable"
tags: [claude-code, mcp, configuration, n8n]
importance: 0.7
confidence: 0.8
created: "2026-02-20T17:30:17.952797+00:00"
updated: "2026-02-20T17:30:17.952797+00:00"
---
## Adding User-Scope MCP Servers in Claude Code
### Correct Location
- **User MCP servers go in `~/.claude.json`** under the `mcpServers` key
- NOT in `~/.claude/settings.json` (that `mcpServers` key doesn't work)
- NOT in `~/.claude/.mcp.json` (legacy location, still works for cognitive-memory but being phased out)
### Activation Flow
1. Add server config to `~/.claude.json``mcpServers``server-name`
2. Start a new Claude Code session → server shows as **disabled** in `/mcp`
3. Open `/mcp` menu, select the server, press Enter to enable
4. Server persists as **connected** across all future sessions automatically
### Settings.json MCP Fields
- `enableAllProjectMcpServers` — only for **project-level** `.mcp.json` servers
- `enabledMcpjsonServers` — only for **project-level** `.mcp.json` servers
- Neither affects user-scoped servers in `~/.claude.json`
### Example Config (~/.claude.json)
```json
{
"mcpServers": {
"cognitive-memory": {
"command": "python3",
"args": ["/home/cal/.claude/skills/cognitive-memory/mcp_server.py"]
},
"n8n-mcp": {
"command": "npx",
"args": ["n8n-mcp"],
"env": {
"MCP_MODE": "stdio",
"N8N_API_URL": "http://10.10.0.210:5678",
"N8N_API_KEY": "<from ~/.claude/secrets/n8n_api_key>"
}
}
}
}
```