01What MCP actually is
So far Claude Code has worked with your files, your shell and git. MCP (Model Context Protocol) is the open standard that lets it reach everything else: your error tracker, your database, your issue board, a browser. In one line: MCP is a standard way for an AI app to discover and use tools and data that live outside it.
The payoff is that questions you used to answer by tab-hopping become one prompt: what broke in prod since yesterday's deploy, and which commit caused it? Claude reads the error, finds the code and proposes the fix, all in one session.
The three parts
01Host
The AI app you use. Claude Code is a host. So are Claude Desktop and VS Code.
02Client
A connection the host opens for each server, one client per server. You never touch it, it lives inside Claude Code.
03Server
A small program that offers context to the host. It can run on your machine or on the vendor's platform, like Sentry's.
"Server" only means "the program that serves tools". It does not mean a big machine in a data centre, and it does not mean the program contains any AI.
What happens when you ask a question
1. connect Claude Code starts or reaches the server and learns what it supports 2. discover it asks the server: what tools do you have? name: get_issue_details description: fetch one error with its stack trace inputSchema: { issue_id: string } 3. decide Claude reads your prompt plus those descriptions and picks a tool 4. ask you your permission rules apply here (see section 08) 5. call Claude Code sends the call: get_issue_details { issue_id: "ABC-123" } 6. answer the server returns the result, Claude reads it and continues
Notice who does what. The server only lists tools and runs them. Claude decides which one to call and when, based on the descriptions. The MCP specification says this itself: MCP covers how context is exchanged and does not dictate how an AI app uses the model. The protocol underneath is JSON-RPC, and discovery is just a tools/list request, which is why one client can talk to any server.
What a server can offer
@ (section 09).How is MCP different from an API?
An API is how one program talks to another service, and every API is different: its own URLs, login, data shapes and docs. To use ten APIs from an AI tool, someone has to write ten custom integrations.
MCP is a common layer on top. An MCP server usually wraps a service's API and describes what it can do in a standard, machine-readable way: tool names, what each does and what inputs it takes. Claude Code reads that list at connect time and calls any tool the same way, whichever service is behind it. The MCP docs compare it to a USB-C port: one plug shape, many devices.
Who develops it?
Anthropic created MCP and released it as an open standard. On 9 December 2025 Anthropic donated it to the Agentic AI Foundation, part of the Linux Foundation, co-founded by Anthropic, Block and OpenAI. So it is not Claude-only: VS Code, Cursor, ChatGPT, Gemini and Microsoft Copilot all support it, and Anthropic reported more than 10,000 active public servers at the time. The specification, SDKs for several languages, a debugging tool called MCP Inspector and reference servers are all open source.
The people who build the servers are different again. Many come from the tool's own vendor (Sentry, Notion, GitHub), and many are written by the community. That is why the security section matters: the protocol is a standard, but each server is only as trustworthy as whoever wrote it.
Five things people get wrong
02Three ways to connect
A server is either hosted somewhere (remote) or runs on your machine (local). The transport tells Claude Code how to reach it. (In the MCP specification the remote kind is called "Streamable HTTP". In Claude Code you simply write --transport http.)
01http
Remote servers. The recommended choice. Most hosted tools (Notion, Sentry, GitHub) offer one.
02stdio
A local process Claude Code starts for you, usually with npx. Good for databases and local tools.
03sse
An older remote transport. Deprecated, so use http whenever the server supports it.
# remote (http) claude mcp add --transport http notion https://mcp.notion.com/mcp # remote with a token header claude mcp add --transport http secure-api https://api.example.com/mcp --header "Authorization: Bearer your-token" # local (stdio): everything after -- is the command that starts the server claude mcp add --transport stdio --env AIRTABLE_API_KEY=YOUR_KEY airtable -- npx -y airtable-mcp-server
The -- matters: everything before it is Claude's options, everything after it is the command that launches the server. On Windows, run these in PowerShell as written. For long commands, PowerShell continues a line with a backtick instead of the backslash you see in Mac and Linux guides, so the simplest fix is to keep each command on one line.
03Check it worked
claude mcp list every server and its health claude mcp get notion details for one server claude mcp remove notion take it out claude mcp login sentry sign in to a server that uses OAuth # inside a session /mcp status, sign-in, turn servers on or off
Servers that need a sign-in (Sentry, Notion and most hosted tools) use OAuth. Add the server, run /mcp inside Claude Code, pick it and finish the login in your browser. If a server shows Failed, run claude mcp get with its name: it prints the reason, such as a bad token or an unreachable URL. Note that claude mcp add saves what you type without testing it, so a typo only shows up here.
04How sign-in works
Authorization is not built into MCP tools themselves. It belongs to the connection. For remote servers, MCP supports ordinary HTTP credentials (bearer tokens, API keys, custom headers) and recommends OAuth, following the OAuth 2.1 conventions. It is optional: a server that exposes nothing private may need no login. A local server runs as your own process, so it simply reads credentials from its environment. In Claude Code you will meet three patterns:
01OAuth login
Hosted tools like Sentry and Notion. Run /mcp, pick the server and approve in your browser, the same "Sign in with..." flow you know. Claude Code stores the resulting access. claude mcp login name starts it from the shell and claude mcp logout name clears it.
02Token in a header
Servers that want an API key or personal access token, like the GitHub example below. Pass it with --header "Authorization: Bearer ...". If the server rejects the header, Claude Code reports Failed and does not fall back to OAuth.
03Env variables
Local stdio servers run on your machine, so they usually take credentials from environment variables, set with --env KEY=value. Nothing goes over a browser flow.
If a server's OAuth needs a pre-registered app, add --client-id, --client-secret (it asks for the secret with masked input) and --callback-port to the add command. Whichever pattern you use, the access you grant is what the server can do as you, so give it only what the job needs.
05Scopes: who gets the server
Where you add a server decides who can use it:
~/.claude.json. Best for experiments and personal tokens..mcp.json in the project root, which you commit. Add it with --scope project.~/.claude.json. Good for tools you always want, like GitHub. Add it with --scope user.The project file is how a team shares one setup. Because it is committed, never put a secret in it. Use an environment variable instead, which .mcp.json expands in url, headers, command, args and env:
{
"mcpServers": {
"api-server": {
"type": "http",
"url": "${API_BASE_URL:-https://api.example.com}/mcp",
"headers": { "Authorization": "Bearer ${API_KEY}" }
}
}
}
${VAR} reads the value from each person's own environment, and ${VAR:-default} falls back to a default. When a teammate first opens the project, Claude Code asks them to approve each server in the file before it runs, so a cloned repo cannot start tools silently. Reset those choices with claude mcp reset-project-choices.
06Three real workflows
Triage an error from Sentry
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp # then /mcp inside Claude Code to log in > what are the most common errors in the last 24 hours? > find the code behind the top one and propose a fix
Run PR and issue work from GitHub
claude mcp add --transport http github https://api.githubcopilot.com/mcp/ --header "Authorization: Bearer YOUR_GITHUB_PAT" > review PR #456 and suggest improvements > show me all open PRs assigned to me
Create the personal access token on GitHub with the smallest scopes that do the job, and treat it like a password.
Ask your database questions
claude mcp add --transport stdio db -- npx -y @bytebase/dbhub --dsn "postgresql://readonly:pass@host:5432/analytics" > show me the schema for the orders table > what's our total revenue this month?
Use a read-only database user in that connection string. Then even a wrong or manipulated query cannot change your data. This is the single most important habit with database servers.
07In VS Code
MCP works in the extension too, and it uses the same configuration as the terminal, so a server added in one place shows up in the other for new conversations.
/mcp in the Claude panel. Add, remove, enable, disable and reconnect servers, and manage sign-in. Adding and removing needs a recent extension (Claude Code 2.1.261 or later).Ctrl+`) and run any claude mcp add command from this article./mcp and look for Connected. Bad credentials show Failed.claude on your shell PATH. For claude mcp in a terminal, install the standalone CLI from Day 3 once.08Control what the tools may do
Every MCP tool goes through the permission system you met on Day 5. Rules name a server as mcp__server and a tool as mcp__server__tool, and mcp__server__* matches every tool on that server:
{
"permissions": {
"allow": [ "mcp__sentry__*" ],
"deny": [ "mcp__github__create_issue" ]
}
}
A good default: allow servers that only read (error trackers, docs), and leave the ones that write (GitHub, databases, chat) on the ask list so you approve each action. To see the real tool names for a server, run /mcp and open it.
09Keep context and costs under control
MAX_MCP_OUTPUT_TOKENS=50000 before you start claude. Better still, ask for less ("last 50 rows").MCP_TIMEOUT=10000 claude (milliseconds).@ to browse them, or write @github:issue://123 to attach one directly.The habit that pays off: connect only the servers a project really uses, and switch off the rest from /mcp. It keeps tool choices clear for Claude and your session lean.
10Security: connect with care
Trust each server. An MCP server runs code or reads content on your behalf. A server that fetches outside content (web pages, tickets, emails) can carry hidden instructions meant for Claude, called prompt injection. Anthropic's docs say to verify you trust each server before connecting it.
${VAR} in .mcp.json.11Bonus: Claude Code as a server
It works the other way too. claude mcp serve makes Claude Code itself an MCP server, so another app (Claude Desktop, for example) can use its file and edit tools. In that app's config:
{
"mcpServers": {
"claude-code": { "type": "stdio", "command": "claude", "args": ["mcp", "serve"] }
}
}
If you see spawn claude ENOENT, the app cannot find claude on its PATH. Put the full path to it in command.
12Try this today
claude mcp list, then /mcp in a session. Look for Connected.Next up: skills. How to package your know-how, such as how you write tests or review code, so Claude applies it the same way every time.