Connect Clients
After you have a server, a host still needs a launch recipe. This chapter is config snippets only. Product menus, permission prompts, and troubleshooting live in each client course so we do not duplicate them.
Prove server.py in Inspector first, then edit host config. Replace paths with absolute paths on your machine.
Shared rules
Stdio command must be the interpreter that has mcp installed, or a launcher such as uv run --with "mcp[cli]" mcp run .... A bare python that points at a different global interpreter yields ModuleNotFoundError: mcp.
Cursor
Config files:
- Project:
.cursor/mcp.json - User:
~/.cursor/mcp.json(on Windows, typically$HOME\.cursor\mcp.json)
Stdio:
On Unix, set command to /home/you/mcp-demo/.venv/bin/python. You can also let uv fetch the extra:
Remote Streamable HTTP:
Cursor may still offer an SSE field or transport. That is the legacy path; see Transports. Product chapter: Cursor / MCP.
Claude Code
Prefer the CLI (user scope = every project):
Project-level .mcp.json can be committed and shared:
That python must resolve to an environment with mcp when Claude Code starts the server. Put secret names in env, not tokens, if the file is in git. Product chapter: Claude Code / MCP.
Codex
User-level: ~/.codex/config.toml
Project-level: .codex/config.toml (often loaded only after the project is trusted)
Unix:
HTTP:
Enterprises can restrict servers with allowed_mcp_servers. Confirm field names in the Codex config reference. Product chapter: Codex / MCP.
OpenCode
OpenCode declares MCP in the mcp field of opencode.json (stdio or a remote URL) and can gate tools in its permission table. This course does not repeat that JSON. See OpenCode / MCP and LSP.
After you save config
- Quit and restart the host (many products read MCP config only at startup)
- Confirm
workshopis connected in the tools / MCP panel, not stuck on “starting” - Ask: “Use the add tool to compute 19+23”—you want a tool call, not mental math
- On failure: run
python server.pyalone (it should block, not crash), then check which interpreter the host used
The same server.py can be registered in Cursor and Claude Code at once; see Practical Examples case 3.