Connecting a real host: Claude Code, Claude Desktop and Cursor
A server is only useful inside real applications. Claude Code, Claude Desktop and Cursor all run the same launch command from different config files.
Run these steps yourself: they change the settings of applications on your own computer.
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 lesson 15. 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.
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. 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.pymcp 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 installed, because the Inspector is a Node application. 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.
- 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.
Slow is fine. Stopping is the only problem.