How to Add a Remote MCP Server to Claude Code
One command connects a remote MCP server to Claude Code. The two details that catch people are the scope flag that decides whether it works in every project, and the type field a hand-written config needs.
Last verified August 9, 2026
How do I add a remote MCP server to Claude Code?
Run one command:
claude mcp add --transport http my-server https://mcp.example.com/mcp
Then run /mcp inside Claude Code to complete the browser OAuth. Add --scope user to the command to make the server available across all your projects rather than just the one you ran it in. That is the entire setup.
The scope decision
claude mcp add without a scope flag configures the server for the current project. That is a reasonable default for a project-specific tool and the wrong one for anything you want everywhere.
claude mcp add --transport http --scope user my-server https://mcp.example.com/mcp
Decide this up front. The symptom of getting it wrong is a server that works in the repo where you set it up and is silently absent everywhere else — which reads as a broken connection rather than a scoping choice.
Configuring by file instead
Claude Code reads remote MCP servers from a .mcp.json file:
{
"mcpServers": {
"my-server": {
"type": "http",
"url": "https://mcp.example.com/mcp"
}
}
}
The "type": "http" line is required. It tells Claude Code this is a remote Streamable HTTP server rather than a local command to run — without it, the entry is ignored.
.mcp.json is the project-scoped file, and it lives in the project directory. Claude Code treats it as team-shared — anyone who clones the project gets the server, and Claude Code prompts for approval before using a project-scoped server it has not seen before.
There is no home-directory .mcp.json. User scope is a different file: ~/.claude.json, written for you by claude mcp add --scope user. Claude Code does not read ~/.mcp.json, ~/.claude/mcp.json, or similar paths, so hand-placing a config there produces a server that silently never appears. Use the command rather than editing ~/.claude.json by hand.
Authorization
The first time Claude Code connects, it opens a browser window for authorization:
- The browser opens with the server's consent screen
- Sign in if prompted
- Review and approve
After approving, Claude Code stores the authorization token and reconnects automatically in future sessions. Run /mcp at any time to check server status or re-run the flow.
Verifying
Start a session and ask what tools it has access to. If the server's tools are listed, you are connected.
What usually goes wrong
| Problem | Fix |
|---|---|
.mcp.json not being picked up | Confirm the file is valid JSON, in the correct directory, and that the entry has "type": "http" |
| The server works in one project only | It was added at project scope. Re-add with claude mcp add --scope user, which writes it to ~/.claude.json |
Added by hand to ~/.mcp.json and nothing appears | Claude Code does not read that path. Run claude mcp add --scope user instead |
| A project-scoped server never loads | Claude Code asks for approval before using a project's .mcp.json servers. Run /mcp and approve it |
| Browser doesn't open for auth | Check that Claude Code can open your default browser |
| "Connection timeout" | Verify your internet connection and that the server URL is correct |
| Tools not appearing | Restart Claude Code after adding the configuration |
Running a different model underneath
Claude Code can be pointed at other providers' Anthropic-compatible endpoints, which makes it a common harness for open models. This does not affect your MCP setup at all: MCP lives in the harness, so a server configured here keeps working when the model underneath changes, and the model's API key never authorizes the server.
If you are going that route, the GLM guide covers the environment block in detail.
A worked example
With a real server — Tempreon, a hosted MCP server that gives your coding sessions a persistent memory of your architecture decisions and conventions:
claude mcp add --transport http --scope user tempreon https://api.tempreon.com/functions/v1/tempreon-mcp/mcp
Then /mcp and approve in the browser. The account-holder walkthrough is in the Claude Code setup doc.
Sources
The dated claims on this page were checked against this vendor document. Client UIs move constantly, so if one of these has changed since the date shown, trust the vendor over this page — and tell us.
- Connect Claude Code to tools via MCP — Claude Code docs — read 2026-08-09
Frequently asked questions
- How do I make an MCP server available in every Claude Code project, not just one?
- Run claude mcp add with --scope user. That writes the server to ~/.claude.json, which is where Claude Code keeps user-scoped servers, and makes it available across every project on your machine while staying private to your account. Do not hand-edit ~/.mcp.json for this — Claude Code does not read a .mcp.json in your home directory. A .mcp.json inside a project folder is the project-scoped file, and it is shared with anyone who clones that project.
- I added a server to .mcp.json but Claude Code doesn't recognize it.
- The entry needs a type field set to http. That tells Claude Code it is a remote Streamable HTTP server rather than a local command — without it the server is ignored. Confirm the file is valid JSON, then restart Claude Code so it picks up the change.
- How do I finish the login after adding the server?
- Run /mcp inside Claude Code. The first connection opens a browser for the server's consent screen; approve it and Claude Code stores the token and reconnects automatically in future sessions. If the browser doesn't open, check that Claude Code can reach your default browser.