Day 2, 25 minutes · advanced
Why it matters
A remote server is only useful when an AI application connects to it. For a stdio server, the host needs the command that starts it. For a remote server, it only needs the address. That makes adding one much simpler, and it is how hosted services such as company tools are usually connected.
Today Romy's HTTP server from lesson 1 meets two clients. First Claude Code, which connects to it with one command and calls its tools. Then the Claude API's MCP connector, which lets your own code use remote MCP tools without writing an MCP client. You will see why the connector cannot reach Romy's server yet. At the end Claude Code has answered a stock question from your remote server, and you have a plan for what the connector needs.
The words you need today
- claude mcp add --transport http: the Claude Code command for a remote server. You give it a name and the address of the MCP endpoint.
- MCP connector: a feature of the Claude API that connects to remote MCP servers for you, inside a normal Messages API request.
- Beta header: an extra request header that switches on a feature that is still in beta. The connector needs one.
- authorization_token: the field where your code passes an OAuth access token to the connector. Lesson 3 explains tokens.
Remote servers in Claude Code
The Claude Code MCP page calls HTTP servers "the recommended option for connecting to remote MCP servers". The shape is claude mcp add --transport http <name> <url>. No -- and no start command: the server already runs, Claude Code only connects. The scopes from the beginners course still apply. The default is local, so the server only shows up in this folder.
A few things from the same page are worth knowing:
- In a JSON config, such as
.mcp.json, a remote server needs"type": "http". The typestreamable-httpis accepted as another name for it. An entry with aurlbut notypeis an error, because Claude Code then reads it as a stdio server. claude mcp listshows✔ Connected,! Needs authenticationor✘ Failed to connect. A failure means Claude Code could not reach the server, not that the list command failed.- Claude Code has two client runtimes and picks one itself. The newer one asks servers whether they support protocol version 2026-07-28 and uses it with those that do.
- A server that answers
401 Unauthorizedis marked as needing authentication, and you sign in from/mcpor withclaude mcp login <name>. Lesson 3 builds such a server.
Remote servers from the Claude API
When you write your own program with the Claude API, the MCP connector can call remote MCP tools for you. You add two things to a normal Messages API request, as the connector page shows:
- An
mcp_serverslist. Each entry hastype(alwaysurl), theurlof the server, a uniquename, and optionally anauthorization_token. - A
toolsentry of typemcp_toolsetwith the same server name. It can turn all tools on, or only some, withdefault_configandconfigs.
The request also needs the beta header anthropic-beta: mcp-client-2025-11-20 (or the newer mcp-client-2026-09-15). This fragment shows the shape. It is not something to run today: Romy has no public server and you need an API key for it.
{
"mcp_servers": [
{
"type": "url",
"url": "https://example-server.modelcontextprotocol.io/sse",
"name": "example-mcp",
"authorization_token": "YOUR_TOKEN"
}
],
"tools": [
{ "type": "mcp_toolset", "mcp_server_name": "example-mcp" }
]
}
Why the connector cannot reach Romy yet
The connector page lists three limits that matter here:
- Only tool calls are supported, not resources or prompts.
- The server must be publicly exposed through HTTP, and the
urlmust start withhttps://. The server has to be reachable from the internet, sohttp://localhost:8000/mcp, which only exists on your own computer, cannot work. - For a server that needs OAuth, your own code gets and refreshes the access token and passes it in
authorization_token.
So the path to the connector runs through a real host name with HTTPS and an authorization server, which is exactly what lessons 3 and 6 prepare. Do not open your laptop to the internet to try it: lesson 6 shows what can go wrong.
The steps
- Check that Romy's HTTP server is running.
- Add it to Claude Code with one command.
- Check the status with
claude mcp list. - Ask a stock question and watch the requests arrive at the server.
- Remove the server again, so it does not fail in later sessions.
- Write down what the connector would need.
Follow the steps below.
Today's actions
Ticks are not saved without an accountDo it in Claude API
Claude API
- Make sure
quillfeather_remote.pyfrom lesson 1 is running in its own terminal. If not, start it again.uv run quillfeather_remote.py - In a second terminal in the quillfeather folder, add the server. It prints
Added HTTP MCP server quillfeather-remoteand the file it changed. The scope is local: only you, only this folder.claude mcp add --transport http quillfeather-remote http://localhost:8000/mcp - Check the status. You should see
quillfeather-remote: http://localhost:8000/mcp (HTTP) - ✔ Connected. If you see Failed to connect, check that the server terminal still runs.claude mcp list - Ask a stock question that only Romy's server can answer. This one-shot command allows only the stock tool. Watch the
POST /mcplines appear in the server terminal.claude -p "Use the quillfeather-remote server to check whether Moby Dick is in stock. Answer in one sentence." --allowedTools "mcp__quillfeather-remote__check_stock" - You can ask the same question in a normal session too: start
claude, ask it, and approve the tool call when Claude Code asks. - Remove the server when you are done, so it does not fail to connect in later sessions when the server is off.
claude mcp remove quillfeather-remote - In
mcp-notes.txt, write what the Claude API MCP connector would need for Romy's server: a publichttps://address, a name, a token if the server asks for one, and which tools to enable.
Note: Run claude mcp add in your normal terminal, not inside a Claude Code session. If the answer does not mention the server, check claude mcp list first.
Paid planClaude Code needs a Pro, Max, Ultra, Team or Enterprise plan or a Console account. The free claude.ai plan is not on that list.
Create a free account to save your progress
Free, and no payment details. Your ticks and finished lessons are kept, on every device.
Create a free account I already have an accountCreate a free account to save your progress. Sign in or sign up