Skip to content
Claude Certified Architect – Foundations (CCAR-F) Exam Prep

Lesson 11 of 30 · 7 min

x
11/30

MCP Server Integration

Video lesson: CCAR-F 11/30: MCP Server Integration

Scopes and storage

ScopeStored inWho gets it
local (default)~/.claude.json, under the project pathYou, this project only
project.mcp.json at the project rootEveryone who clones the repo (commit it)
user~/.claude.jsonYou, all projects

Precedence, highest first: local, project, user, plugin-provided, claude.ai connectors. The whole entry from the winning source is used; fields are not merged across scopes. Managed servers rank above all of these.

Secrets: environment variable expansion

In .mcp.json: ${VAR} and ${VAR:-default}, allowed in command, args, env, url and headers. This is how a shared .mcp.json references tokens without containing them. An unset variable with no default loads with a warning and the literal ${VAR} text. Never put a real token in .mcp.json.

Transports

  • http: recommended for remote servers; supports OAuth.
  • stdio: a local process on your machine.
  • sse: deprecated; prefer http.
  • ws: persistent connection; header auth only.

Commands

claude mcp add --transport http <name> <url> · claude mcp add --transport stdio <name> -- <command> [args] (the -- separates Claude's flags from the server command) · --env KEY=value · --scope local|project|user · claude mcp list · claude mcp get · claude mcp remove · claude mcp add-json. Inside a session, /mcp shows status, authentication and reconnect.

Approval and trust

  • Interactive sessions prompt for approval before using servers from a project's .mcp.json.
  • In claude -p, the Agent SDK and cloud sessions there is no prompt, so project servers load without asking. Block one everywhere with disabledMcpjsonServers; --strict-mcp-config uses only servers from --mcp-config.

Using MCP content

  • Tools appear as mcp__<server>__<tool>; hook matchers and permission rules use this name (a regex such as ^mcp__ matches all MCP tools).
  • Resources are referenced with @server:resource (for example @github:repos/owner/repo/issues).
  • Output limits: warning at 10,000 tokens, default maximum 25,000; raise with MAX_MCP_OUTPUT_TOKENS. Startup timeout MCP_TIMEOUT, tool timeout MCP_TOOL_TIMEOUT.
  • Tool search (lazy loading of tool definitions) is on by default.
  • Remote servers that return 401/403 need OAuth: /mcp or claude mcp login <name>. Headless runs cannot complete OAuth; authenticate interactively first.

Choosing a server (design guidance)

Use an existing community or vendor server for standard integrations (GitHub, Slack, databases); build a custom server for internal systems or when you need tight control over tool design and output size.

Exam traps

  • Committing a token in .mcp.json instead of ${VAR}.
  • Putting a team-wide server in user scope, so teammates do not get it.
  • Expecting scope fields to merge. The winning scope's entry replaces others.
  • Assuming CI prompts for project-server approval. It does not.
  • Using SSE for a new remote server.

References

  1. MCP in Claude Code — checked Oct 16, 2026
  2. Common workflows — checked Oct 16, 2026

Check your understanding

  • A server should be shared with the whole team via git. Scope and file?Show answer

    Answer

    Project scope, .mcp.json.
  • How does a shared .mcp.json reference an API token safely?Show answer

    Answer

    "Authorization": "Bearer ${API_KEY}" with the value in each developer's environment.
  • Which scope wins when a name exists at local and user?Show answer

    Answer

    Local.
Previous

Progress is saved in this browser.

Next Lesson