Workbranch › Guides

Guide

How to connect MCP servers to Claude Code

MCP servers give Claude Code access to tools outside your code, such as an issue tracker, a database or a design tool. This guide shows the commands to add one, where the setting is saved, how to sign in, and how to tell whether it's working.

Updated 30 October 2026

Quick answer: for a remote server run claude mcp add --transport http name https://server/mcp; for a local one run claude mcp add name -- command args. Add --scope user to use it in every project or --scope project to share it through .mcp.json. Then open Claude Code, type /mcp to sign in if needed, and confirm the server shows as connected.

Commands below follow Anthropic's Claude Code documentation as of October 2026. You run the claude mcp commands in your normal terminal, not inside a Claude Code session.

Add a remote server (most common)

A hosted service gives you a web address for its MCP server, which you'll find in its own setup instructions. Anthropic recommends the HTTP transport for these.

  1. In your terminal, cd into the project you'll use it with.
  2. Run claude mcp add --transport http notion https://mcp.notion.com/mcp, swapping in your own name and address. The name is what you'll see in lists and in /mcp.
  3. If the service uses an API key instead of a sign-in, pass it as a header: --header "Authorization: Bearer your-token".

Older servers may only offer SSE, which is deprecated. Recent versions of Claude Code try HTTP first and fall back to SSE on their own; on older versions use --transport sse.

Add a local server

A local (stdio) server is a program that runs on your computer, often started with npx.

  1. Write the Claude options first, then --, then the server's own command: claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable -- npx -y airtable-mcp-server.
  2. Claude Code hands whatever follows -- straight to the server program. Without the separator, flags meant for the server (such as -y) are read as Claude Code options.
  3. When you use --env, put another option between it and the server name, as in the example, or the name is read as another variable.

Choose a scope

ScopeWhere it worksSaved in
local (default)This project, only for you~/.claude.json, under the project's path
projectThis project, for everyone who clones it.mcp.json in the project root (commit it)
userAll your projects~/.claude.json

Pick user for tools you want everywhere, such as your notes app, and project for tools the whole team needs in one repository. If one server is defined in several places, Claude Code connects once, in this order of priority: local, project, user, then servers from plugins, then claude.ai connectors. The three scopes are matched by name; plugin servers and connectors count as duplicates when they point at the same address or command. The winning entry is used as a whole; fields aren't combined.

Don't put secrets directly in a shared .mcp.json. It accepts variables such as ${API_KEY} or ${API_BASE_URL:-https://api.example.com}, which each person sets in their own environment.

Sign in to a server that needs an account

  1. Start Claude Code with claude.
  2. Type /mcp. The panel lists the servers that still need you to sign in.
  3. Select the server and follow the browser sign-in. The token is stored on your computer and refreshed for you.
  4. Alternatively, from your shell run claude mcp login name. Sign out with claude mcp logout name.

Some services require you to register an app with them first. In that case add the server with --client-id, --client-secret (you'll be asked to type it) and, if their setup asks for a fixed redirect, --callback-port.

Check that it works

Remove a server with claude mcp remove name.

Good to know

If it doesn't work

Sources

Frequently asked questions

Is this the same as connectors on claude.ai?

They're related but set up separately. Claude.ai connectors can also load in Claude Code, but they come last in priority: if a server you added with claude mcp add points at the same address, yours is used. See our guide to Claude connectors for the web and desktop apps.

Does removing a server sign me out of the service?

Not fully. claude mcp remove deletes the stored sign-in on your computer but doesn't revoke it. Run claude mcp logout name first if you want the token revoked.

Can I add a server from a JSON snippet?

Yes. claude mcp add-json name followed by the JSON config works. For a remote server, include "type": "http" in the JSON, or it's treated as a local command and fails.