Claude · Claude Code

How to Connect a Remote MCP Server to Claude From the Terminal

A remote MCP server gives Claude tools from a service that runs somewhere else, such as an issue tracker or a design tool. There are two places you can attach one from the terminal: your Claude Code configuration, or your claude.ai account as a connector. They behave differently, and picking the wrong one is the usual reason a server shows up in one place and not another.

GPTPrompts.AI Editorial

Steps verified against the vendor's own documentation · Last updated December 2026

Recommended toolMercorGet paid to use your expertise training and evaluating AI for leading AI labs.Join Mercor

Affiliate link, we may earn a commission at no extra cost to you.

01 · The steps

Pick the route that matches your situation

Add the server to Claude Code

Use this when you want a scope, custom headers or OAuth options. HTTP is the recommended transport for remote servers.

  1. 1In your shell, run: claude mcp add --transport http <name> <url>. For example: claude mcp add --transport http notion https://mcp.notion.com/mcp
  2. 2Look for a line starting with Added. That means the configuration was written.
  3. 3If the server uses a token instead of a browser sign-in, add the header to the same command: --header "Authorization: Bearer your-token"
  4. 4Run claude mcp list. Each server shows a status such as Connected, Needs authentication or Failed to connect.
  5. 5Start Claude Code and run /mcp to see the server and its tools.

Sign in to a server that needs it

Claude Code supports OAuth 2.0 for remote servers.

  1. 1From your shell, run: claude mcp login <name>
  2. 2Or, inside a Claude Code session, run /mcp, select the server and sign in from its menu.
  3. 3Follow the steps in your browser. If the browser does not open, copy the URL the command prints and open it yourself.
  4. 4Over SSH, or with no local browser, open the printed URL on your own machine, then paste the full redirect URL from the address bar back at the prompt. Add --no-browser to force this.
  5. 5Run claude mcp list again and check the server shows as connected.

Add it to your claude.ai account as a connector

The connector lives on your claude.ai account, so your Claude Code configuration does not change. Needs a claude.ai login.

  1. 1Run: claude mcp add --web <name> <https url>. For example: claude mcp add --web notion https://mcp.notion.com/mcp
  2. 2Put the address in quotes if it contains a question mark or an ampersand.
  3. 3Claude Code usually opens claude.ai in your browser. If it does not, visit the link the command prints, using the same account and organization that Claude Code is signed in to.
  4. 4On claude.ai, do what the command tells you: select Connect, add the connector then connect it, or finish connecting.
  5. 5Wait for the command to finish. It checks for up to 10 minutes. Press Enter to check right away.
  6. 6In an open session, run /reload-plugins, or start a new session. Then run /mcp to check the connector is listed.

Check, sign out and remove

Removing a server does not revoke its tokens at the service.

  1. 1List every configured server: claude mcp list
  2. 2See one server's details: claude mcp get <name>
  3. 3To revoke tokens where the service supports it, run claude mcp logout <name> first.
  4. 4Remove the server: claude mcp remove <name>
  5. 5A claude.ai connector cannot be removed this way. Remove it at claude.ai/customize/connectors.

02 · Copy and adapt

Commands to copy

Replace the name and URL with your server's. The Notion address is the example Anthropic's documentation uses.

Add, sign in, check

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

Available in all your projects

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

Shared with your team through .mcp.json

claude mcp add --transport http shared-server --scope project https://example.com/mcp

Add as a claude.ai connector

claude mcp add --web notion https://mcp.notion.com/mcp

03 · Read this first

What most guides leave out

The default scope is one project

Without --scope, the server is local: it loads only in the project where you added it and is private to you. If it is missing in another folder, that is why. Use --scope user for all your projects.

Project scope is shared and needs approval

--scope project writes the server to a .mcp.json file at the project root, meant for version control. Claude Code asks for approval in interactive sessions before using servers from that file. Do not put tokens in it.

Some services only work as connectors

Anthropic-hosted connectors such as Microsoft 365, Gmail and Google Calendar do not support local OAuth from Claude Code. Connect those at claude.ai/customize/connectors and they appear in Claude Code automatically.

Connectors need a claude.ai login

Connectors from claude.ai load only when your active sign-in is a claude.ai subscription. They are not loaded while an API key such as ANTHROPIC_API_KEY, or a third-party provider such as Amazon Bedrock, is active. Run /status to see which is in use.

A bad header stops OAuth

If you set an Authorization header and the server rejects it, Claude Code reports the connection as failed instead of falling back to the browser sign-in. Fix the token, or remove the header.

Adding the same name twice fails

Running claude mcp add again with the same name at the same scope fails with an already exists message. Remove the old entry first, or pick another name.

Your own entry hides a matching connector

A server you added in Claude Code takes precedence over a claude.ai connector that points at the same URL. /mcp lists the connector as hidden.

Only add servers you trust

With --web, an address that does not match a verified listing opens a form instead of a Connect button. Check the name and address, and make sure you trust the server before you add it.

04 · Questions

Frequently asked questions

How do I add a remote MCP server to Claude Code?

Run claude mcp add --transport http, then a name and the server's URL, in your shell. For example: claude mcp add --transport http notion https://mcp.notion.com/mcp. Then sign in with claude mcp login if the server needs it.

What does claude mcp add --web do?

It adds a remote MCP server to your claude.ai account as a connector, instead of to your Claude Code configuration. It needs a claude.ai login and Claude Code v2.1.330 or later on Pro, Max or Ultra, or v2.1.332 or later on Team or Enterprise.

How do I sign in to an MCP server from the terminal?

Run claude mcp login followed by the server's name. It runs the server's OAuth flow from your shell. Inside a session you can run /mcp and sign in from the server's menu instead.

How do I check that an MCP server is connected?

Run claude mcp list. It shows a status next to each server, such as Connected, Needs authentication or Failed to connect. Inside Claude Code, /mcp shows the same servers and their tools.

Why is my MCP server missing in another project?

The default scope is local, which loads the server only in the project where you added it. Add it again with --scope user to make it available in all your projects.

How do I remove an MCP server from Claude Code?

Run claude mcp remove followed by the name. Claude Code deletes the OAuth tokens it stored but does not revoke them at the service. Run claude mcp logout with the name first if you want them revoked.

Can I sign in to an MCP server over SSH?

Yes. claude mcp login prints the authorization URL when no local browser is available. Open it on your own machine and paste the full redirect URL back at the prompt. Connect with ssh -t, because the paste step needs an interactive terminal.

Sources

Menu names change. If a step no longer matches what you see, the vendor documentation above is the authority.

Keep going

Recommended toolMercorGet paid to use your expertise training and evaluating AI for leading AI labs.Join Mercor

Affiliate link, we may earn a commission at no extra cost to you.

Don't stop here

What to read next

Hand-picked guides our readers explore right after this one.