Skip to content

Claude Code MCP configuration: files, scopes, settings and limits

Better Design

Direct answer

Claude Code stores local and user scope MCP servers in ~/.claude.json and project scope servers in .mcp.json at the project root, which you commit to share with your team. Settings keys such as enableAllProjectMcpServers, enabledMcpjsonServers, disabledMcpjsonServers, allowedMcpServers and deniedMcpServers control which servers load.

A hand-drawn terminal showing the command or error this guide covers: claude code mcp configuration.

Commands and settings that shape the configuration

Each command below comes from the official docs, read on November 12, 2026. The comment above each line says what it does.

commands and config
# The .mcp.json format that --scope project writes.
{
  "mcpServers": {
    "shared-server": {
      "type": "http",
      "url": "https://example.com/mcp"
    }
  }
}

# Env var expansion: ${VAR} and ${VAR:-default} work in command, args, env, url and headers.
{
  "mcpServers": {
    "api-server": {
      "type": "http",
      "url": "${API_BASE_URL:-https://api.example.com}/mcp",
      "headers": {
        "Authorization": "Bearer ${API_KEY}"
      }
    }
  }
}

# Raises the server startup timeout (default 30000 ms).
MCP_TIMEOUT=60000 claude

# Raises the MCP tool output limit (default 25,000 tokens).
export MAX_MCP_OUTPUT_TOKENS=50000
claude

# Per-server tool call limit in ms inside a .mcp.json entry; overrides MCP_TOOL_TIMEOUT for that server.
"timeout": 600000

# Adds a remote server that needs OAuth; then run /mcp and sign in in the browser.
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp

# Runs the OAuth flow from the shell; add --no-browser over SSH.
claude mcp login sentry

# Settings key that approves every .mcp.json server without a prompt.
{
  "enableAllProjectMcpServers": true
}

The steps for claude code mcp configuration

Four steps take you from the problem to a working MCP server.

A hand-drawn four-step path: Choose a scope for the server, Add it, or edit .mcp.json, Approve project servers when asked, Check the result with /mcp.
  1. Step 1: Choose a scope for the server
  2. Step 2: Add it, or edit .mcp.json
  3. Step 3: Approve project servers when asked
  4. Step 4: Check the result with /mcp

Where each scope stores its servers

local (default)
File

~/.claude.json, under the entry for this project

Who sees it

Only you, only this project

project
File

.mcp.json in the project root

Who sees it

Everyone who clones the project

user
File

~/.claude.json, under the top-level mcpServers key

Who sees it

Only you, all projects

Caveats the docs call out

  • When the same server name is in several scopes, Claude Code uses the whole entry from the highest one (local, then project, then user); fields are not merged.
  • An unset ${VAR} with no default stays as literal ${VAR} text and triggers a warning; a variable set to an empty string counts as set, so the default is not used.
  • In a remote server's url and headers, credential variables such as ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, HTTPS_PROXY and NPM_TOKEN always read as empty; copy the value into a variable with your own name.
  • A successful text result longer than 50,000 characters is saved to a file whatever MAX_MCP_OUTPUT_TOKENS says, unless the tool declares anthropic/maxResultSizeChars (ceiling 500,000).

Steal this workflow

Run this guide in your own assistant. The prompt carries the guide link and the workflow summary, so the assistant can adapt it to your project.

Read the guide "Claude Code MCP configuration: files, scopes, settings and limits" at https://better-design.com/blog/claude-code-mcp-configuration and help me apply it to my project.

Claude Code stores local and user scope MCP servers in ~/.claude.json and project scope servers in .mcp.json at the project root, which you commit to share with your team. Settings keys such as enableAllProjectMcpServers, enabledMcpjsonServers, disabledMcpjsonServers, allowedMcpServers and deniedMcpServers control which servers load.

Start by asking what I am building and which tools I use. Then walk me through the workflow step by step, adapted to my answers.

Claude and ChatGPT open with the prompt filled in. Gemini copies the prompt to your clipboard first, so paste it when the app opens.

Questions

Will a teammate's .mcp.json run servers on my machine without asking?

Not in an interactive session: Claude Code asks for approval first. In claude -p and Agent SDK runs it loads them without asking; block one with disabledMcpjsonServers.

Can an admin restrict which MCP servers people use?

Yes: allowedMcpServers and deniedMcpServers, deployed in managed settings to enforce them.

Does Claude Code support OAuth for remote MCP servers?

Yes, OAuth 2.0: sign in from /mcp or claude mcp login <name>; tokens are stored securely and refreshed automatically.

Where these commands and paths come from

Each command, path and caveat comes from the official docs, read on November 12, 2026. Commands change between releases, so check the docs for your version.

Add design guidance to the same setup

MCP servers give your coding agent tools and data. Better Design is an MCP server too: it gives the agent a design system, interface principles and review rules, so the screens it builds look designed.