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: Git

Here's the exact config to add the Git 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": {
    "git": {
      "command": "uvx",
      "args": [
        "mcp-server-git",
        "--repository",
        "/path/to/repo"
      ]
    }
  }
}
Or via CLI
bash
claude mcp add git -- uvx mcp-server-git --repository /path/to/repo