---
title: "Claude Code MCP config: file path, key, example · DotsAgent"
description: "Add MCP servers to Claude Code from Anthropic: where the config file lives, the top-level key and format, remote OAuth support and a sample config."
url: https://dotsagent.io/mcp/clients/claude-code
---

Anthropic

# Add MCP servers to Claude Code

Claude Code takes servers from the claude mcp add command or from a .mcp.json file at the repository root.

- **macOS**: `~/.claude.json`
- **Windows**: `~/.claude.json`
- **Linux**: `~/.claude.json`
- **Project file**: `.mcp.json`
- **Top-level key**: `mcpServers`
- **Format**: json
- **OAuth for remote servers**: 

## Example config

This example adds GitHub's hosted server and Playwright as a local server, in the shape this client expects.

`.mcp.json`

```
{
  "mcpServers": {
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/"
    },
    "playwright": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "@playwright/mcp@latest"
      ]
    }
  }
}
```

`shell`

```
claude mcp add --transport http --scope project github https://api.githubcopilot.com/mcp/
claude mcp add --scope project playwright -- npx @playwright/mcp@latest
```

## Notes and quirks

- Local scope, the default, and user scope are stored in ~/.claude.json; project scope lives in .mcp.json.
- Every entry with a url also needs a type such as http; a url on its own is an error.
- Values in the file expand ${VAR} and ${VAR:-default}.
- Run /mcp in a session to sign in to OAuth servers. For pre-registered OAuth apps, pass --client-id, --client-secret and --callback-port.

[Build a Claude Code config →](https://dotsagent.io/mcp/config#client=claude-code)

## Other clients

[Claude Desktop](https://dotsagent.io/mcp/clients/claude-desktop)

[Cursor](https://dotsagent.io/mcp/clients/cursor)

[VS Code (GitHub Copilot)](https://dotsagent.io/mcp/clients/vscode-copilot)

[Windsurf / Devin Desktop](https://dotsagent.io/mcp/clients/windsurf)

[Zed](https://dotsagent.io/mcp/clients/zed)

[OpenAI Codex CLI](https://dotsagent.io/mcp/clients/codex-cli)

[Gemini CLI](https://dotsagent.io/mcp/clients/gemini-cli)

[ChatGPT](https://dotsagent.io/mcp/clients/chatgpt)

[OpenClaw](https://dotsagent.io/mcp/clients/openclaw)

[Cline](https://dotsagent.io/mcp/clients/cline)

[Continue](https://dotsagent.io/mcp/clients/continue)

[JetBrains AI Assistant](https://dotsagent.io/mcp/clients/jetbrains-ai)

## Sources

1. [code.claude.com](https://code.claude.com/docs/en/mcp)/docs/en/mcp

Independent reference for people who build AI agents. Not affiliated with any vendor named here.

© 2026 DotsAgent · Facts checked October 1, 2026
