Claude MCP: How to Add MCP Servers to Claude Code and Claude Desktop
Connect MCP servers to Claude in minutes: the claude mcp add commands for Claude Code, scopes and .mcp.json, the Claude Desktop config file, and how to fix servers that won't connect.
Claude MCP is how you give Claude new abilities. The Model Context Protocol (MCP) is an open standard for connecting AI tools to outside data and actions, and both Claude Code and Claude Desktop can use MCP servers: your issue tracker, your database, your files, or your own product.
This guide covers both clients, with the exact commands and config. If you are new to the idea, start with what an MCP server is.
Add an MCP server to Claude Code
Claude Code manages servers with the claude mcp command. There are two kinds of server you will add most often.
Remote servers over HTTP, hosted by the service you are connecting to:
claude mcp add --transport http notion https://mcp.notion.com/mcp
If the server needs a token, pass a header:
claude mcp add --transport http secure-api https://api.example.com/mcp \
--header "Authorization: Bearer your-token"
Local servers over stdio, which run as a process on your machine:
claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable \
-- npx -y airtable-mcp-server
The -- matters. Everything before it is an option for Claude Code; everything after it is the command that starts the server, passed through untouched. (An older SSE transport still exists, but it is deprecated, so prefer HTTP.)
Pick the right scope
Every server is added at a scope, set with --scope:
| Scope | Loads in | Shared with your team | Stored in |
|---|---|---|---|
local (default) | This project only | No | ~/.claude.json |
project | This project only | Yes, via git | .mcp.json in the project root |
user | All your projects | No | ~/.claude.json |
Use project for servers the whole team needs on this repo, user for personal tools you want everywhere, and local for experiments.
The .mcp.json file
Project-scoped servers live in .mcp.json, which you commit so teammates get the same tools:
{
"mcpServers": {
"shared-server": {
"type": "http",
"url": "https://example.com/mcp"
},
"database-tools": {
"command": "npx",
"args": ["-y", "@example/mcp-server"]
}
}
}
Keep secrets out of this file. Put tokens in environment variables instead.
Manage your servers
claude mcp list # everything configured
claude mcp get notion # details for one server
claude mcp remove notion # remove it
Inside a Claude Code session, type /mcp to see which servers are connected, log in to servers that use OAuth, turn servers on and off and see the tools each one offers.
Already set servers up in Claude Desktop? Import them in one step:
claude mcp add-from-claude-desktop
Add an MCP server to Claude Desktop
Claude Desktop reads its servers from a JSON config file.
- Open the Claude menu in your system menu bar (not the settings inside the chat window) and choose Settings...
- Go to the Developer tab and click Edit Config. This creates the file if it doesn't exist.
- The file lives at:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
Add your servers under mcpServers. This example runs the official filesystem server with access to two folders:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/username/Desktop",
"/Users/username/Downloads"
]
}
}
}
- Quit Claude Desktop completely and reopen it. The config only loads at startup.
- In a chat, open the + menu at the bottom left of the message box, go to Connectors and choose Manage connectors to see your server and its tools.
Claude asks for your approval before each action a server takes, and you can always say no. Only give a server access to folders and accounts you are comfortable with it using: it runs with your user's permissions.
When a server won't connect
Work through these in order:
- Restart fully. Most "missing server" problems are a client that never reloaded.
- Check the JSON. A trailing comma breaks the whole file.
- Use absolute paths. Relative paths in
argsfail silently. - Run the command yourself. Paste the server's command into a terminal. If it errors there, it will error in Claude.
- Read the logs. Claude Desktop writes MCP logs to
~/Library/Logs/Claudeon macOS and%APPDATA%\Claude\logson Windows.mcp.logcovers connections, andmcp-server-NAME.logholds each server's own output.
In Claude Code, /mcp shows the status of each server and is the fastest place to look.
Build your own Claude MCP server
Connecting other people's servers is step one. The bigger win is putting your own product behind an MCP server, so customers can use it from Claude and other AI assistants. That is how ServeStack lets AI assistants browse a restaurant's menu and place an order.
My MCP Server Starter is a typed TypeScript base for that, and the minimal example in my MCP server guide shows the core of one. If you'd rather have it built for you, that is part of my AI integration services.
Frequently asked questions
Does Claude.ai in the browser support MCP? Claude's apps support remote MCP servers as connectors. Local stdio servers need Claude Desktop or Claude Code, because they run on your machine.
Can I use the same server in Claude Code and Claude Desktop? Yes. Add it to both, or import your Desktop servers into Claude Code with claude mcp add-from-claude-desktop.
Where is claude_desktop_config.json? On macOS at ~/Library/Application Support/Claude/, on Windows at %APPDATA%\Claude\. Open it from Settings, Developer, Edit Config.
Are MCP servers safe? They are as safe as the code you run and the access you grant. Install servers from sources you trust, scope file access narrowly, and review each action Claude asks to take.
Want to expose your own app to Claude? My open-source MCP Server Starter gives you a typed TypeScript server to build on.
Get the MCP Server StarterWritten by Antonio Kodheli
Full-stack web developer in Boston. I build modern web apps with TypeScript, Next.js, and the Claude API, and write about it here.