MCP servers in Claude Code

Claude Code stores MCP servers under an "mcpServers" object in ~/.claude.json. It also reads a project-scoped .mcp.json and supports adding servers from the command line with "claude mcp add". Each entry must declare either a "type" or a "command"; Claude Code refuses an entry that has neither. Remote servers connect natively over Streamable HTTP with OAuth.

Where the config lives

  • macOS / Linux: ~/.claude.json

Worked example: claude-mem

Here's the exact config to add the claude-mem MCP server to Claude Code. Every server in the directory has a ready-to-paste Claude Code config like this.

Add to ~/.claude.json

~/.claude.json
json
{
  "mcpServers": {
    "claude-mem": {
      "command": "npx",
      "args": [
        "-y",
        "claude-mem",
        "mcp"
      ]
    }
  }
}
Or via CLI
bash
claude mcp add claude-mem -- npx -y claude-mem mcp