MCP hosts
A host is the application that runs your server and connects a model to it, such as Claude Code, Claude Desktop or Cursor.
Last updated: 29 Sep, 2026 · MCP 2.2
Run these steps yourself: they change the settings of applications on your own computer.
The MCP crash course connects its weather server to two hosts. uv run mcp install server/weather.py adds it to Claude Desktop's config, and asking Claude for the weather alerts in CA calls get_alerts. The entry it wrote is in Claude Desktop under Settings, Developer, Edit config, inside an mcpServers object. Cursor takes the same JSON in its MCP settings, which open its mcp.json, and the same question works there.
{
"mcpServers":{
"weather": {
"command": "uv",
"args": [
"run",
"--with",
"mcp[cli]",
"mcp",
"run",
"E:\\mcpcourse\\mcpcrashcourse\\server\\weather.py"
]
}
}
}The entry starts the server with uv run --with mcp[cli] mcp run and an absolute path. mcp install still exists in mcp 2.2 and now pins the mcp version you have installed, so mcp install shop.py works for the shop server too. The rest of this lesson writes the host settings for the shop server by hand.
Claude Code
claude mcp add shop -- python /absolute/path/to/shop.pyEverything after -- is the command Claude Code runs to start the server over stdio, which is why shop.py needs the mcp.run() from the stdio lesson. Use absolute paths, and the Python that has mcp installed, such as /path/to/.venv/bin/python. Inside a session, /mcp shows whether shop connected and lists its tools.
That command starts the server over stdio. The Streamable HTTP lesson changed the end of shop.py to serve over HTTP, so for this command put the ending from the stdio lesson back, mcp.run(). Or keep HTTP, start python shop.py yourself, and add the running server by its URL:
claude mcp add --transport http shop http://127.0.0.1:8200/mcpClaude Code then connects to the server instead of starting it, so the server has to be running whenever you use it.
Claude Desktop and Cursor
{
"mcpServers": {
"shop": {
"command": "/absolute/path/to/.venv/bin/python",
"args": ["/absolute/path/to/shop.py"]
}
}
}Both read an mcpServers object with a command and its arguments, and start the server over stdio, so they also need the mcp.run() ending. Restart the application after editing it. VS Code uses .vscode/mcp.json with the key servers instead, and a type on each entry.
The MCP Inspector
pip install "mcp[cli]==2.2.0"
mcp dev shop.py --with typermcp dev opens the MCP Inspector, a web page with a tab for tools, resources and prompts, where you call each one by hand through a form built from its schema. It needs Node.js, because the Inspector is a Node application, and uv, which starts your server; --with typer is explained in MCP Inspector with mcp dev. Use it to check a server before connecting a host to it.
When it does not show up
- A relative path. Hosts start the server from their own working folder, not yours.
- The wrong Python. The host's command must use the environment where
mcpis installed. - Something printing to standard output at start-up, before the SDK takes over. Log to standard error instead.
Starting the server vs connecting to one
| Command config | URL config | |
|---|---|---|
| The host | Starts the server over stdio | Connects to a running server |
| Server ending | mcp.run() | mcp.run(transport="streamable-http", ...) |
| Must be running first | No, launched on demand | Yes |
When each config fits
- The command form when the host should launch the server for you.
- The URL form when the server is already running and shared.
- The Inspector when you want to try a server before wiring a host to it.
mcp installed.Related
- Previous: MCP with FastAPI
- Next: MCP tools with an LLM
- Add the shop server to Claude Code and ask: "Where is order A17?" Watch which tool it asks to call.
- Open the Inspector, call
lookup_orderwithZ9, and read the error text the model would see. - Run
claude mcp list.
Every expert started right here.