Lesson 15 / 25
Registering a Server in a Host
Add a local server to a desktop host and to Claude Code.
A command and arguments
For a stdio server the host needs to know how to start it: a command and its arguments. Desktop hosts usually read this from a JSON config under a key named mcpServers. Claude Code can add one with claude mcp add. Restart the host after changing a config file.
Register once, use everywhere
Each host has a way to register servers. After that, the model sees the tools like any others.
Two ways to register
Use absolute paths in config files, because the host may start the process from a different working directory.
// desktop host config (JSON)
{
"mcpServers": {
"calculator": {
"command": "python",
"args": ["/home/me/mcp/server.py"]
}
}
}
// Claude Code (shell)
// claude mcp add calculator -- python /home/me/mcp/server.pyFix "server not found" first
Most connection failures are a wrong path, a missing virtual environment or a command not on the host's PATH. Run the exact command in a terminal first; if it fails there, it will fail in the host.
Quick check: Why use absolute paths in a host config?
- Relative paths are illegal JSON
- The host may launch the process from a different working directory
- Absolute paths are faster
- The model requires it
Answer
The host may launch the process from a different working directory — A relative path may not resolve from where the host starts the server.