Connect Claude Code to Tools via MCP
by Anthropic (Claude Code Docs)
The full reference for wiring real tools, databases and APIs into Claude Code.
Overview
Anthropic's full Model Context Protocol reference for Claude Code; a separate quickstart handles first-time setup, so this is the page you come back to. It opens with six concrete use cases (implementing a Jira ticket and opening a GitHub PR, reading Sentry and Statsig usage data, querying PostgreSQL, pulling Figma designs out of Slack, drafting Gmail, and reacting to inbound Telegram or webhook events through channels), then walks through four installation transports: remote HTTP via `claude mcp add --transport http`, the recommended path, with `streamable-http` accepted as a JSON alias; the deprecated SSE transport; local stdio servers; and WebSocket. It documents the three installation scopes, local, project (a `.mcp.json` checked into the repo) and user, along with their precedence order and `${VAR}` environment-variable expansion. Later sections cover OAuth against remote servers, including command-line authentication, fixed callback ports, pre-configured credentials, metadata-discovery overrides and scope restriction, plus dynamic headers for custom auth. It also covers importing servers from Claude Desktop, running Claude Code itself as an MCP server, output limits and per-tool overrides, requiring approval for a specific tool, responding to elicitation requests, referencing MCP resources with `@` mentions, using MCP prompts as slash commands, MCP tool search for large server sets, and managed enterprise configuration. A prominent warning covers prompt-injection risk from servers that fetch external content.
At a Glance
- Topic
- MCP
- Level
- Intermediate
- Format
- Documentation
- Cost
- Free
- Duration
- ~40 min read; ongoing reference
- Provider
- Anthropic (Claude Code Docs)
- Hands-on
- Yes — code/exercises
- Certificate
- None
What You’ll Learn
- ✓Add remote HTTP, SSE, stdio and WebSocket MCP servers with claude mcp add
- ✓Choose between local, project and user scopes and understand their precedence
- ✓Check a project-scoped .mcp.json into git so teammates share the same servers
- ✓Authenticate against remote servers with OAuth, fixed callback ports and custom headers
- ✓Reference server-exposed MCP resources with @ mentions and run MCP prompts as slash commands
- ✓Keep large tool sets usable with MCP tool search and per-server deferral
- ✓Raise MCP output limits per tool and require approval before sensitive tool calls
- ✓Run Claude Code itself as an MCP server for other clients to consume
Highlights
- •The authoritative reference, versioned with Claude Code releases: it names the exact builds where behaviour changed (v2.1.202, v2.1.203, v2.1.219)
- •Every option appears as a copyable command against a named real service (Notion, Asana, Sentry, GitHub, PostgreSQL), not as prose
- •Documents failure modes, not just the happy path: a JSON entry with a url but no type is silently treated as stdio and skipped, and the doc gives the exact error string
- •Explicit prompt-injection warning before you connect a server that fetches external content
- •Covers enterprise reality: managed configuration, organization controls on connector tools, and OAuth scope restriction
Who It’s For
Best For
- ✓Claude Code users wiring an agent into internal systems
- ✓Platform teams standardising MCP server config across a repo or organisation
- ✓MCP server authors checking how Claude Code will load and call their server
Prerequisites
- •Claude Code installed and basic command-line familiarity
- •Comfort editing JSON config files and using environment variables
- •Read the linked MCP quickstart first if this is your very first server
FAQ
What is Connect Claude Code to Tools via MCP?
Anthropic's complete Model Context Protocol reference for Claude Code, covering all four transports, the three installation scopes, OAuth against remote servers, MCP resources and prompts, and enterprise-managed configuration. For engineers who have run the quickstart and now need to connect internal systems properly, share server config across a team, and keep a large tool set usable.
Is Connect Claude Code to Tools via MCP free?
Connect Claude Code to Tools via MCP is free to access.
What level is Connect Claude Code to Tools via MCP for?
Connect Claude Code to Tools via MCP is aimed at a intermediate audience. Recommended background: Claude Code installed and basic command-line familiarity, Comfort editing JSON config files and using environment variables, Read the linked MCP quickstart first if this is your very first server.
How long does Connect Claude Code to Tools via MCP take?
Expect roughly ~40 min read; ongoing reference. Most learners work through it at their own pace.
What will I learn from Connect Claude Code to Tools via MCP?
You'll learn: Add remote HTTP, SSE, stdio and WebSocket MCP servers with claude mcp add; Choose between local, project and user scopes and understand their precedence; Check a project-scoped .mcp.json into git so teammates share the same servers; Authenticate against remote servers with OAuth, fixed callback ports and custom headers; Reference server-exposed MCP resources with @ mentions and run MCP prompts as slash commands; Keep large tool sets usable with MCP tool search and per-server deferral; Raise MCP output limits per tool and require approval before sensitive tool calls; Run Claude Code itself as an MCP server for other clients to consume.
Topics
Sources
This page was written from 3 sources, 2 on domains other than code.claude.com.