# Claude Code MCP: How to Add MCP Servers (claude mcp add)

[Muhammad Shakil](https://skryvo.ai/about/) · Founder of Skryvo

October 22, 2026 · 7 min read

**In this guide**

1. [How do I add an MCP server to Claude Code?](https://skryvo.ai/blog/claude-code-mcp/#how-do-i-add-an-mcp-server-to-claude-code)
2. [What do the MCP scopes mean in Claude Code?](https://skryvo.ai/blog/claude-code-mcp/#what-do-the-mcp-scopes-mean-in-claude-code)
3. [How do I share MCP servers with my team?](https://skryvo.ai/blog/claude-code-mcp/#how-do-i-share-mcp-servers-with-my-team)
4. [How do I sign in to a remote MCP server?](https://skryvo.ai/blog/claude-code-mcp/#how-do-i-sign-in-to-a-remote-mcp-server)
5. [How do I list, check and remove MCP servers?](https://skryvo.ai/blog/claude-code-mcp/#how-do-i-list-check-and-remove-mcp-servers)
6. [Why is my MCP server not working in Claude Code?](https://skryvo.ai/blog/claude-code-mcp/#why-is-my-mcp-server-not-working-in-claude-code)
7. [Can Claude Code be an MCP server itself?](https://skryvo.ai/blog/claude-code-mcp/#can-claude-code-be-an-mcp-server-itself)
8. [A worked example: posting from Claude Code](https://skryvo.ai/blog/claude-code-mcp/#a-worked-example-posting-from-claude-code)

Share [X](https://twitter.com/intent/tweet?text=Claude%20Code%20MCP%3A%20How%20to%20Add%20MCP%20Servers%20(claude%20mcp%20add)&url=https%3A%2F%2Fskryvo.ai%2Fblog%2Fclaude-code-mcp%2F) [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fskryvo.ai%2Fblog%2Fclaude-code-mcp%2F) [Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fskryvo.ai%2Fblog%2Fclaude-code-mcp%2F)

Checked against Anthropic's Claude Code docs on October 22, 2026.

Claude Code connects to MCP (Model Context Protocol) servers to reach tools outside your terminal: an issue tracker, a database, a browser, a publishing tool. One command adds a server, a scope decides who else gets it, and `/mcp` inside a session shows what is connected.

**The short version:** for a remote server run `claude mcp add --transport http <name> <url>`, then open `/mcp` in Claude Code to sign in. For a local one run `claude mcp add <name> -- <command>`. Add `--scope project` to write it to `.mcp.json` so your team gets it too. Everything below is from [Anthropic's Claude Code MCP documentation](https://code.claude.com/docs/en/mcp), checked October 22, 2026.

## How do I add an MCP server to Claude Code?

Remote servers over HTTP are the recommended kind. Give the server a name and its URL:

```
claude mcp add --transport http notion https://mcp.notion.com/mcp
```

If the server takes a fixed token instead of OAuth, pass it as a header with `--header` (or `-H`). A local server runs as a process on your machine; everything after `--` is the command that starts it:

```
claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable -- npx -y airtable-mcp-server
```

The `--` matters: without it, the server's own flags would be read as Claude Code's. SSE servers still work with `--transport sse`, but Anthropic marks SSE as deprecated, so use HTTP where the server offers it.

## What do the MCP scopes mean in Claude Code?

- **local** (the default): only you, only in this project. Stored in `~/.claude.json` under the project's path.
- **project**: everyone working in the repository. Stored in `.mcp.json` at the project root, so it goes into version control.
- **user**: only you, in every project. Stored in `~/.claude.json`.

Pick one with `--scope` (or `-s`). When the same name is defined in more than one place, local wins over project, project over user, and the whole entry from the winner is used; fields are not merged.

## How do I share MCP servers with my team?

Add them with `--scope project`, or write `.mcp.json` by hand and commit it. Keep secrets out of the file with variables, which Claude Code expands in `command`, `args`, `env`, `url` and `headers`:

```
{
  "mcpServers": {
    "api-server": {
      "type": "http",
      "url": "${API_BASE_URL:-https://api.example.com}/mcp",
      "headers": { "Authorization": "Bearer ${API_KEY}" }
    }
  }
}
```

`${VAR}` takes the variable's value and `${VAR:-default}` falls back to the default. Two safety rules to know: Claude Code asks each person to approve project servers before it uses them (reset those answers with `claude mcp reset-project-choices`), and well-known credential variables such as `ANTHROPIC_API_KEY` or `NPM_TOKEN` expand to nothing in a remote server's URL or headers, so a repository cannot send them elsewhere. Copy a value into a variable of your own name if a server really needs it.

## How do I sign in to a remote MCP server?

Add the server, then type `/mcp` in Claude Code and finish the sign-in in your browser. Claude Code stores the tokens and refreshes them; "Clear authentication" in `/mcp` revokes them. From the shell, `claude mcp login <name>` runs the same flow and `claude mcp logout <name>` clears it. If the provider does not support dynamic client registration, register an app with it, use `http://localhost:PORT/callback` as the redirect address, and add the server with `--client-id`, `--client-secret` and `--callback-port`.

Skryvo writes posts and articles in your brand's voice and publishes them for you. [Start for $0](https://skryvo.ai/signup/) 7 days free, no card needed

## How do I list, check and remove MCP servers?

```
claude mcp list            # every server and its health
claude mcp get notion      # one server's details
claude mcp remove notion   # remove it, with its stored sign-in
claude mcp add-json weather '{"type":"http","url":"https://api.weather.com/mcp"}'
claude mcp add-from-claude-desktop   # copy servers from Claude Desktop (macOS and WSL)
```

Inside a session, `/mcp` shows each server as connected, needing sign-in, failed, waiting for approval or disabled, and `/mcp reconnect all` retries the failed ones. In `add-json`, an entry with a `url` must also say `"type": "http"`, or Claude Code treats it as a local server.

## Why is my MCP server not working in Claude Code?

- **It is slow to start.** Raise the startup timeout for the session, for example `MCP_TIMEOUT=10000 claude` for ten seconds.
- **Its results are cut short.** MCP output is capped at 25,000 tokens by default; raise it with `MAX_MCP_OUTPUT_TOKENS=50000`.
- **A project server never loads.** It is waiting for your approval; start `claude` interactively and accept it.
- **A variable shows up literally.** An unset `${VAR}` with no default stays as text and `claude mcp list` warns about it.
- **The server's flags were swallowed.** Put the server's command after `--`.

## Can Claude Code be an MCP server itself?

Yes. `claude mcp serve` runs Claude Code as a local MCP server, so another client can call its tools. In Claude Desktop, add it with `"command": "claude"` and `"args": ["mcp", "serve"]`, using the full path to `claude` if it is not on your PATH. Plugins can also bring their own MCP servers: installing the plugin adds them and uninstalling removes them.

## A worked example: posting from Claude Code

Skryvo is a remote MCP server for social media:

```
claude mcp add --transport http skryvo https://api.skryvo.ai/mcp
```

Open `/mcp`, sign in, and ask "Write a LinkedIn post about the bug we just fixed and schedule it for tomorrow at 9am." Claude Code drafts it in your brand's voice, shows it, and schedules it only after you approve. [The Claude Code setup page](https://skryvo.ai/agents/claude-code/) also covers the plugin route. The same server works in Claude as a [connector](https://skryvo.ai/blog/claude-connectors/), in [Codex](https://skryvo.ai/blog/codex-mcp/) and in [Cursor](https://skryvo.ai/blog/cursor-mcp/).

Keep personal servers at user scope, shared ones in a committed `.mcp.json` with every secret behind a variable, and check `/mcp` whenever a tool goes quiet.

Other clients: [VS Code MCP](https://skryvo.ai/blog/vscode-mcp/), [Gemini CLI MCP](https://skryvo.ai/blog/gemini-cli-mcp/), [Skryvo in Claude Cowork](https://skryvo.ai/agents/claude-cowork/).

## Do this in Skryvo

- [Claude Code MCP server for social media](https://skryvo.ai/agents/claude-code/)
- [Add MCP servers to Cursor](https://skryvo.ai/blog/cursor-mcp/)
- [MCP connectors for every AI agent](https://skryvo.ai/agents/)

About the author

### [Muhammad Shakil](https://skryvo.ai/about/) Founder of Skryvo

I wrote this myself. I have built mobile apps and websites for companies in the US and Europe since 2022, and I built Skryvo after one too many AI drafts fell apart the moment someone checked a fact. Everything I publish here is tested on my own work first, and I show the numbers, including the ones that did not go my way.

[LinkedIn](https://www.linkedin.com/in/flutterdeveloper1/) [X](https://x.com/MShakilAwan3) [Full bio](https://skryvo.ai/about/) [All articles](https://skryvo.ai/blog/)

Read Skryvo often? [Add Skryvo as a preferred source on Google](https://www.google.com/preferences/source?q=skryvo.ai) and our articles are more likely to show up for you.

## Keep reading

[All guides](https://skryvo.ai/blog/)

AI Agents · 7 min read

### [Best Social Media MCP Servers and Connectors (2026)](https://skryvo.ai/blog/best-social-media-mcp-servers/)

Seven social media MCP servers and connectors compared from their own docs: Buffer, Metricool, Postiz, Zernio, Blotato, Ayrshare and Skryvo, by channels, sign-in, price, approval.

AI Agents · 8 min read

### [Perplexity MCP: Official Server, URL, Pricing and Setup](https://skryvo.ai/blog/perplexity-mcp/)

Perplexity MCP both ways: its official server in Claude Code, Cursor, Claude Desktop and Docker, what each tool runs on, and adding MCP connectors to Perplexity.

AI Agents · 6 min read

### [Cursor MCP: How to Add an MCP Server to Cursor](https://skryvo.ai/blog/cursor-mcp/)

Add MCP servers to Cursor with mcp.json or Customize, use env variables safely, sign in with OAuth, run them from the CLI, and read MCP logs.

## Turn ideas like these into posts

Skryvo writes posts and articles in your brand's voice and publishes them to your channels, from the app or your AI agent.

[Start for $0](https://skryvo.ai/signup/) [See how it works](https://skryvo.ai/features/)

- 7 days free, no card needed
