You need to add an MCP server to Claude Desktop. Which file do you edit and what goes in it?
`claude_desktop_config.json` is the per user JSON file Claude Desktop reads at launch. Its `mcpServers` map gives each server a name and either `command + args + env` for stdio or `url` for remote HTTP.
Imagine a laptop that cannot detect USB devices by itself. To make a device work, you write its name on a sticky note inside a notebook the laptop checks every time it boots up. That notebook is `claude_desktop_config.json`. Each sticky note says: here is the device name, here is how to start it (a command line for something local, or a web address for something remote), and here are any secret passwords it needs. When Claude Desktop launches, it reads the notebook, starts every local entry as a background process, connects to every remote entry, and lists whatever tools each one offers. Change the notebook, restart the laptop, and the new tools show up. There is no other way to add servers: no settings menu, no drag and drop, just the file.
Detailed answer & concept explanation~6 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
3 min: name the file and its per OS path, describe the `mcpServers` schema with the two entry shapes, explain the startup only read model, and close with the secrets hygiene consideration.
Real products, models, and research that use this idea.
- Adding the filesystem server: an entry named `fs` with `command: npx` and `args: ["@modelcontextprotocol/server-filesystem", "/Users/me/Documents"]` so the model can read and edit local files during a conversation.
- Adding the GitHub server: `command: docker` or npx, plus `GITHUB_PERSONAL_ACCESS_TOKEN` under `env`, giving Claude the ability to list PRs and create issues.
- Adding a remote MCP server hosted on Cloudflare Workers: a single `url` field pointing at the streamable HTTP endpoint, with OAuth handled through a browser flow on first connection.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhy does Claude Desktop require a full restart instead of watching the file for changes?
QWhat happens if two entries expose tools with the same name?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Editing the file and expecting changes to take effect immediately. Claude Desktop reads it only at startup, so a full quit and relaunch is required.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.