Claude Code MCP: How to Add MCP Servers (Step by Step)
- Published
- 3 min read
- 3 min read
Key takeaways
- MCP (Model Context Protocol) is an open standard that connects Claude Code to tools, databases, and APIs.
- Add a remote server with
claude mcp add --transport http <name> <url>. - Add a local server with
claude mcp add <name> -- <command>. Everything after--goes to the server. - Choose a scope: local (default, just you, this project), project (shared through
.mcp.json), or user (all your projects). - Log in to servers that need it by typing
/mcpinside Claude Code. - Only connect servers you trust: a server that reads outside content can expose you to prompt injection.
Connect Claude Code to your tools
The free guide covers the install and the settings that make Claude Code work for you.
Get the free guideWhat is MCP in Claude Code?
MCP, the Model Context Protocol, is an open standard for connecting AI tools to the outside world. With an MCP server, Claude Code can read your Notion pages, look up errors in Sentry, query your database, or work in your project tracker, without you copying anything into the chat.
I added an MCP server to Echo, my social listening tool, so you can ask Claude or ChatGPT about your brand mentions. New to Claude Code? Start with how to install it, or follow the full Claude Code guide.

How to add an MCP server to Claude Code
Remote server (HTTP)
Most services host their server online. This is the recommended way. For example, Notion:
claude mcp add --transport http notion https://mcp.notion.com/mcpIf the server needs an API key, add a header: --header "Authorization: Bearer your-token". The older SSE transport is deprecated: use HTTP when the service offers it.
Local server (stdio)
Some servers run on your computer as a program. Everything after -- is the command that starts it, passed untouched. For example, Airtable with its API key:
claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable \
-- npx -y airtable-mcp-serverMCP scopes: local, project, or user
| Scope | Works in | Shared with your team | Saved in |
|---|---|---|---|
local (default) | This project | No | ~/.claude.json |
project | This project | Yes, through git | .mcp.json at the project root |
user | All your projects | No | ~/.claude.json |
With the project scope, Claude Code writes a .mcp.json file you can commit. Your teammates are asked to approve it the first time:
{
"mcpServers": {
"shared-server": {
"type": "http",
"url": "https://example.com/mcp"
}
}
}Don't put secrets in .mcp.json. Reference an environment variable instead, like ${API_KEY}, and each person sets their own.
Log in to an MCP server with /mcp
- Add the server, for example
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp. - Start Claude Code and type
/mcp. - Pick the server and follow the browser sign-in.
- Ask Claude something that uses it: "What are the top errors in Sentry this week?"
Get the free Claude Code guide
The install and the 5 settings to know, step by step, with every prompt ready to copy.
Download the guideClaude Code MCP commands
| Command | What it does |
|---|---|
claude mcp list | Lists your servers and their status |
claude mcp get notion | Shows one server's details |
claude mcp remove notion | Removes a server |
claude mcp add-json <name> '<json>' | Adds a server from a JSON config |
/mcp | Checks status and logs in, inside Claude Code |
@server:resource | Mentions a server's resource in your prompt |
Claude Code warns you when a tool returns more than 10,000 tokens, and cuts it at 25,000 by default. Raise the limit with the MAX_MCP_OUTPUT_TOKENS environment variable.
Frequently asked questions
What is MCP in Claude Code?
MCP, the Model Context Protocol, is an open standard that connects Claude Code to outside tools, databases, and APIs through MCP servers.
How do I add an MCP server to Claude Code?
Run claude mcp add --transport http followed by a name and the server URL. For a local server, put its start command after two dashes.
Where are Claude Code MCP servers saved?
Local and user servers are saved in ~/.claude.json. Project servers are saved in .mcp.json at the project root, so you can share them with git.
Are MCP servers safe?
Only as safe as their maker. Connect servers you trust, and be careful with servers that read outside content, which can carry prompt injection.