Asset 20 8 2
Does AI recommend your business? Run the free check →

Join 15,000 business owners, marketers and entrepreneurs. The Sunday newsletter you'll be annoyed only arrives once a week.

Article

Claude Code MCP (2026): How to Add a Server, Pick the Right Scope and Sign In

To connect Claude Code to another tool with MCP, you run claude mcp add with a transport, a name for the server and its address, then type /mcp inside a session to sign in if the server asks. The scope you pick decides who sees it: local (the default, only you, only this project), project (shared with your team through a .mcp.json file) or user (only you, every project).

This page is about Claude Code, the terminal and editor tool. If you use MCP through the Claude chat app instead, how MCP works in Claude chat is a different set of menus and a different set of problems.

What an MCP server gives Claude Code

The Model Context Protocol is an open standard that lets Claude Code reach your tools, databases and APIs. The Claude Code docs give a practical test for when to bother: connect a server when you find yourself copying data into chat from another tool, like an issue tracker or a monitoring dashboard. Once connected, Claude reads and acts on that system directly instead of working from whatever you paste.

Reviewed connectors are listed in the Anthropic Directory, and any remote server listed there can be added with claude mcp add. Before you add anything, read the warning the docs put right at the top: verify you trust each server before connecting it, because servers that fetch external content can expose you to prompt injection. A server is a door into your session, so treat it like one.

Add a server: the three commands you'll use

A remote HTTP server

This is the recommended option and the most widely supported for cloud services. The docs' own example connects Notion:

Add a remote HTTP server

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

An older SSE server

SSE is deprecated, but some services still only offer it. From Claude Code version 2.1.265, the same --transport http command tries HTTP first and switches to SSE if the server doesn't accept it. On an earlier version, use the SSE transport directly, as in the docs' Asana example:

Add a remote SSE server on an older version

claude mcp add --transport sse asana https://mcp.asana.com/sse

A local server that runs on your computer

Local stdio servers run as processes on your machine, which suits tools that need direct system access. The double dash is the bit that trips people up. Everything after it goes to the server untouched, so Claude Code's own options, such as --transport, --env and --scope, go before it:

Add a local stdio server

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

One more quirk from the docs: --env accepts several KEY=value pairs, so if the server name comes straight after --env, the command reads the name as another pair and rejects it. Keep another option, such as --transport stdio, in between. WebSocket servers are the exception to all three commands: they're added through a .mcp.json file or claude mcp add-json, because --transport doesn't accept them.

If a server's setup guide was written for Claude Desktop or Cursor and gives no claude mcp add command, look for one of three things. A URL means a remote server. A launch command such as an npx line means a local one. A JSON block under mcpServers goes into claude mcp add-json, using the object inside mcpServers rather than the wrapper, and adding a type field if the entry has a url but no type.

Which scope to choose

ScopeLoads inShared with your teamStored in
Local (default)Current project onlyNo~/.claude.json in your home directory
ProjectCurrent project onlyYes, through version control.mcp.json in the project root
UserAll your projectsNo~/.claude.json in your home directory

Add --scope project or --scope user to the command to change it. Now the catch the docs flag themselves: local scope for MCP isn't the same as Claude Code's general local settings. Local-scoped servers live in ~/.claude.json in your home directory, while local settings live in .claude/settings.local.json inside the project. If you go looking for your server in the project folder, you won't find it.

Work with me

Want AI doing the heavy lifting in your marketing?

I build the systems that handle the boring 80 percent, so you get your week back. Done properly, with the human kept in.

When the same server is defined in more than one place, Claude Code uses one definition in this order: local, then project, then user, then servers that come with Claude Code plugins, then claude.ai connectors. It takes the whole entry from the winner and doesn't merge fields across scopes.

Project servers ask first, and that's a good thing

Because a .mcp.json file can arrive in a repository someone else wrote, Claude Code prompts for approval in interactive sessions before it uses project-scoped servers. A cloned repository can't approve its own servers either: approvals committed to the project's settings are ignored until you've trusted that folder. If you change your mind later, claude mcp reset-project-choices clears those approval choices. I'd open the .mcp.json and read it before saying yes, every time.

Know the gap, though. In claude -p runs, Agent SDK sessions and some cloud sessions, Claude Code can't show that prompt and loads project-scoped servers without asking.

Signing in to a remote server

Many cloud servers need you to sign in, and Claude Code supports OAuth 2.0 for that. It flags a server in /mcp when the server answers 401 Unauthorized or 403 Forbidden. The flow from the docs, using their Sentry example:

  1. Add the server: claude mcp add --transport http sentry https://mcp.sentry.dev/mcp
  2. Start a Claude Code session and type /mcp.
  3. Follow the steps in your browser to log in. Tokens are stored securely and refreshed automatically.
  4. Later, choose Re-authenticate on the server in /mcp to sign in again, or Clear authentication to revoke access.

You can also run claude mcp login sentry from your shell, and claude mcp logout sentry to clear stored credentials. Two details worth knowing. A claude -p or Agent SDK run has no /mcp panel, so sign in from an interactive session first. And removing a server deletes the tokens Claude Code stored but doesn't revoke them where they were issued, so run claude mcp logout before claude mcp remove.

When a server won't show up

Start with claude mcp list. It shows a status next to each server, such as Connected, Needs authentication or Failed to connect, plus a few that aren't connection attempts at all:

  • Pending approval: a .mcp.json server you haven't approved yet. Run claude interactively to review it.
  • Disabled for this project: you toggled it off in /mcp. Toggle it back on there; the configuration is still saved.
  • A url with no type: Claude Code reads an entry with no type as a local server, so it skips it. Add a type of http, sse or ws.
  • Hidden whitespace: usually a pasted token with a trailing newline. Claude Code names the field but doesn't trim it for you.
  • Reserved names: names of built-in servers, such as workspace or computer-use, are rejected. Pick another name.

My advice for a first server

I'd start with one remote HTTP server from the Anthropic Directory, added at local scope, so it touches nothing but you and one project. Skip project scope until you've used the server for a while and know your team needs it. Skip local stdio servers from unknown sources entirely, because they run on your own machine. If the terminal itself is new to you, my Claude Code walkthrough covers the basics first.

If you're connecting Claude Code to the tools your team already uses and want it done safely, that's the kind of AI enablement I help with. I run AI training and workshops for teams, and help businesses with AI enablement and workflow automation, so the busywork runs itself and people get time back. Most of that work is with SaaS marketing teams and small businesses. Here's how we can work together.

Frequently asked questions

How do I add an MCP server to Claude Code?

Run claude mcp add with a transport, a name and the server's address, for example claude mcp add --transport http notion https://mcp.notion.com/mcp. For a local server, put the launch command after a double dash.

Where does Claude Code store MCP servers?

Local and user scope servers are stored in ~/.claude.json in your home directory. Project scope servers are stored in a .mcp.json file in the project root, which you can commit for your team.

What's the default MCP scope in Claude Code?

Local. A local-scoped server loads only in the project where you added it and stays private to you.

How do I sign in to an MCP server in Claude Code?

Type /mcp in a Claude Code session and follow the browser steps, or run claude mcp login with the server name from your shell. OAuth works with HTTP servers.

Is it safe to add any MCP server?

Only if you trust it. The Claude Code docs say to verify you trust each server first, because servers that fetch external content can expose you to prompt injection.

Published and maintained by the Lilach Bullock team, covering marketing, AI and business growth.
Your buyers are asking AI who to use. Does it say you?

See for free whether ChatGPT, Claude, Perplexity, Gemini and Google name you, and get the plan to become the answer.

Check my AI visibility →
Sundays only

Get the Sunday newsletter.

One email a week. AI experiments, marketing tactics, and the workflows Lilach is building right now in her own business.

Subscribe free

Let’s get your marketing running on AI.

Book a free 30-minute call

We figure out what you need, where AI fits in, and what working together would look like.

Book the call →

Or take the 30-second calculator

You’ll see the hours and the money quietly leaking out of your week, and the three workflows worth building first.

Take the calculator →

Or grab the free AI resource library

Prompt packs, templates, checklists, and swipe files. The exact tools I build for paying clients. Yours, free.

Get the library →
Keep reading

More from the blog.