56 lines
1.8 KiB
Markdown
56 lines
1.8 KiB
Markdown
---
|
|
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-03-02T02:14:29.458261+00:00"
|
|
relations:
|
|
- target: d746c584-c625-4710-b2a7-bba205e2e92d
|
|
type: RELATED_TO
|
|
direction: incoming
|
|
strength: 0.87
|
|
edge_id: afaa906e-805f-4e2e-8b52-0ac2659cfe54
|
|
---
|
|
|
|
## 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>"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
```
|