Free toolGenerate .mcp.json configs for Claude Code, Cursor & Codex →
C

Anthropic · Terminal CLI · VS Code & JetBrains extensions · Desktop app · Web

Claude Code config file: where it lives & format

Claude Code MCP config file: where .mcp.json lives, its format and copy-paste examples. For the full walkthrough, see the step-by-step guide.

Step-by-step guideHow to install Claude Code on macOS, Linux and Windows →The full walkthrough with verification and troubleshooting. This page is the quick config reference.

1. Find the config file

  • .mcp.json (project, shared)
  • ~/.claude.json (user / local scope)

Remote entries need "type": "http" (or "sse" / "ws"; "streamable-http" is accepted as an alias for http); an entry with a url but no type is read as stdio and skipped.

2. Add a local (stdio) server

Example: Context7, which runs locally with npx.

terminal
claude mcp add --transport stdio context7 -- npx -y @upstash/context7-mcp

3. Add a remote (HTTP) server

Example: Notion's hosted server. You sign in with OAuth the first time it connects.

terminal
claude mcp add --transport http notion https://mcp.notion.com/mcp

4. If it won't connect

  • Validate the file. One trailing comma breaks the whole file.
  • Check the top-level key: VS Code uses servers; Claude Code, Cursor and Antigravity use mcpServers; Codex uses TOML tables.
  • If npx isn't found, the app may not see your shell's PATH (common with nvm). Use the full path to npx.
  • Restart the agent or reload the window after editing.
Generate your config →

Claude Code MCP approvals and limits

Servers defined in a repository's .mcp.json are project-scoped, and Claude Code asks for approval before using them in interactive sessions. A cloned repository cannot approve its own servers: approval settings committed to .claude/settings.json are ignored until you accept the workspace trust dialog, and until then claude mcp list shows the server as Pending approval. To undo earlier choices, run claude mcp reset-project-choices.

For scripted runs, --strict-mcp-config makes Claude Code use only the servers passed with --mcp-config. MCP tools appear as mcp__server__tool, which is the name to use in permission rules.

Large tool results are capped: Claude Code warns when one MCP result passes 10,000 tokens and limits output to 25,000 tokens by default. Raise the cap with the MAX_MCP_OUTPUT_TOKENS environment variable, for example MAX_MCP_OUTPUT_TOKENS=50000. Text results over 50,000 characters are saved to a file unless the server sets its own limit. Server authors can force approval on every call of a tool by setting _meta["anthropic/requiresUserInteraction"] to true, and organizations can limit servers with allowedMcpServers and deniedMcpServers in managed settings.

Source: code.claude.com · Checked Oct 24, 2026

Frequently asked questions

.mcp.json (project, shared) or ~/.claude.json (user / local scope).

Guides, pricing & comparisons

Portable agent skills: one SKILL.md for every coding agent

→

Safe “always allow” rules for Claude Code and Codex CLI

→

How to install Claude Code on macOS, Linux and Windows

→

Claude Code auto mode: what runs, what gets blocked, how to turn it off

→

Agent Skills moves to the Agentic AI Foundation: what changes

→

MCP security: the risks in MCP servers and how to lock them down

→

Claude Code in VS Code: install, shortcuts and CLI differences

→

Claude Code on Windows: native, WSL and common errors

→

MCP OAuth: connect a remote MCP server in Claude Code, Codex and Cursor

→

Claude Code tips from Anthropic’s best practices

→

Claude Code with OpenRouter: setup, models and troubleshooting

→

Claude Code in JetBrains IDEs: install, connect and fix issues

→

Claude Code subagents: create, configure and run them

→

Fix spawn npx ENOENT when starting an MCP server

→

CLAUDE.md examples: instructions your team can actually use

→

MCP connection closed: find why a server will not connect

→

Claude Fable 5.2: model choice, CursorBench and Pro week

→

MCP token usage: output limits and context cost

→

MCP Apps: add interactive UI to an MCP server for Claude and Cursor

→

Claude Code vs OpenAI Codex: documented features compared

→

Cursor vs Claude Code: documented features compared

→

Claude Code vs GitHub Copilot: documented features compared

→

Google Antigravity vs Claude Code: documented features compared

→

Claude Code pricing and usage limits

→

AGENTS.md vs CLAUDE.md vs Cursor rules

→

AGENTS.md templates for Laravel and Next.js

→

MCP servers that work in every coding agent

→