Technical

How to add an MCP server to Claude Code

By , Development5 min read
Contents
  1. Add a remote MCP server
  2. Add a local MCP server
  3. Sign in, check and remove servers
  4. Example: deploy a tool from Claude Code with Inhaus
  5. Add an MCP server in the Claude app instead
  6. Common problems and fixes

To add an MCP server to Claude Code, run one command in your terminal:

claude mcp add --transport http <name> <url>

That covers most servers today, because most are remote and run over HTTP. This guide shows the command for remote and local servers, how to choose where the server is available, how to sign in, check and remove servers, and how to add the same server to the Claude app. Commands are from the Claude Code docs as of November 2026.

To deploy from Claude with the Inhaus MCP server, follow the guide to deploying from Claude with MCP.

Add a remote MCP server

A remote server runs on the internet and you connect to it by URL. Give it a short name and paste the URL the server's docs give you:

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

If the server uses an API key instead of a sign-in, pass it as a header:

claude mcp add --transport http secure-api https://api.example.com/mcp \
  --header "Authorization: Bearer your-token"

-t and -H are short for --transport and --header. Older servers that use SSE still work with --transport sse, but SSE is deprecated, so use HTTP where the server offers it.

Choose where the server is available

By default, a server works only in the project folder you added it from, and only for you. Add --scope to change that:

ScopeFlagWorks inSaved in
Local (default)--scope localThis project, only for you~/.claude.json, under the project path
Project--scope projectThis project, for everyone who clones it.mcp.json in the project folder
User--scope userAll your projects~/.claude.json

Use --scope user for a tool you want everywhere, like a deploy or notes server. Use --scope project when your whole team should get the same servers through version control. Claude Code asks each person to approve project servers before it uses them.

Add a local MCP server

A local server is a program Claude Code starts on your own machine, often with npx. Put the server's command after --:

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

Everything after -- goes to the server unchanged. Claude Code's own options, like --env, --transport and --scope, go before it. Keep another option between --env and the server name, as above, or Claude Code reads the name as one more KEY=value pair and rejects it.

If a server's docs give you a JSON config instead, use claude mcp add-json <name> '<json>'. That's also the way to add WebSocket servers, which --transport doesn't accept.

Sign in, check and remove servers

To do thisRun
Sign in to a server that uses OAuth/mcp inside a Claude Code session, then finish the sign-in in your browser
Sign in from the terminalclaude mcp login <name>
See all your serversclaude mcp list
See one server's detailsclaude mcp get <name>
Remove a serverclaude mcp remove <name>
Sign out of a serverclaude mcp logout <name>
Reset your approvals for project serversclaude mcp reset-project-choices

Removing a remote server also deletes its saved sign-in. If the same server is set up in more than one place, Claude Code uses the local entry first, then project, then user.

Example: deploy a tool from Claude Code with Inhaus

Here's the whole flow with one real server. Inhaus (our product) puts tools you build with Claude behind your company login, and it connects as a remote MCP server.

  1. Add the server for all your projects:

    claude mcp add --transport http --scope user inhaus https://mcp.inhaus.dev/mcp
    
  2. Start Claude Code, run /mcp, choose inhaus and sign in with your work account in the browser.

  3. Build or open a web tool, then ask: "Deploy this to Inhaus and share it with the sales team."

  4. Inhaus checks the code for keys written into it before it goes live. If it finds one, Claude gets a prompt to fix it and deploy again.

  5. Your team gets an email invite and signs in with their Google or Microsoft work account. They don't need Claude Code or an Inhaus account.

The same steps work for any remote server: add it, sign in with /mcp, then ask Claude to use it.

Add an MCP server in the Claude app instead

In Claude on the web and Claude Desktop, a remote MCP server is added as a custom connector. An MCP server is the tool or data source. A connector is how you add that server to Claude.

On Pro and Max:

  1. Go to Customize > Connectors.
  2. Click + Add, then Add custom connector.
  3. Enter a name and the server URL, then click Continue.
  4. Check the sign-in settings Claude detected, then click Add.
  5. In a chat, click +, choose Connectors and turn the connector on.

On Team and Enterprise, an Owner adds the connector once in Organization settings > Connectors. Everyone else finds it under Customize > Connectors and clicks Connect. Free plans can add one custom connector.

Two limits to know: the server has to be reachable on the public internet over HTTPS on port 443, and connections come from Anthropic's cloud, not your computer. A local server that only runs on your machine works in Claude Code but not as a connector.

Common problems and fixes

ProblemFix
The server shows but its tools failRun /mcp and sign in. Servers that use OAuth need a sign-in before their tools work
The server works in one folder but not anotherIt was added with the default local scope. Remove it and add it again with --scope user
The server is slow to start and times outStart Claude Code with a longer startup timeout, for example MCP_TIMEOUT=10000 claude for 10 seconds
A tool returns too much outputThe default limit is 25,000 tokens. Raise it with MAX_MCP_OUTPUT_TOKENS=50000
--env gives an error about the server namePut another option, like --transport stdio, between --env and the name
A teammate's project server doesn't loadThey need to approve it the first time. They can reset past choices with claude mcp reset-project-choices
A connector won't connect in the Claude appThe URL must use HTTPS on port 443 and be reachable from the internet

Sources

Put your team’s AI-built tools live

Build in Claude, ChatGPT or Cursor, then deploy and share it behind your company login.

Get started free

Best seen on a laptop

Inhaus is where you deploy and share the tools you build with AI, so it is made for a bigger screen. Open inhaus.dev on your laptop to get the full experience.

Continue on this phone anyway