What does `claude mcp serve` expose to another MCP client, and who must confirm each tool call that client makes through it?
answer
- Claude Code on the other side
- stdio, so a silent terminal
- its own tools, nothing more promised
- confirmation moves to the client
- full path when PATH misses
basics
~20 sclaude mcp serve runs Claude Code as a stdio MCP server exposing Claude Code's own tools, such as reading and editing files, to the connecting client. It prints nothing on start, and the client must confirm individual tool calls.
solid answer
~40 s`claude mcp serve` turns Claude Code around: instead of being the host that connects to servers, it becomes a **stdio MCP server** that another application, such as Claude Desktop, launches and talks to over stdin and stdout. It exposes Claude Code's tools, so the client's model can read files, make edits and so on through it. The command prints nothing when it starts; a silent, blocked terminal means it is waiting for a client. The docs are explicit that it only exposes the tools, so the **connecting client** is responsible for implementing user confirmation for individual tool calls. In the client's configuration the `command` must reach the `claude` executable: if it isn't on the client's `PATH`, use the full path from `which claude`, or the launch fails with `spawn claude ENOENT`.
go deeper
Recall that claude mcp serve makes Claude Code act as an MCP server over stdio, and that a silent terminal is normal.
Explain how a client is configured to launch it, why the full executable path matters, and what the role reversal from host to server means.
Show that you would verify the client confirms edits and shell commands before connecting it, since the docs put that responsibility on the client.
Judge when exposing Claude Code's tools to another host is worth the shifted approval responsibility, compared with running Claude Code itself.
## Host versus server Most of the time Claude Code is an **MCP host**: you add servers, and Claude Code connects to them and offers their tools to Claude. `claude mcp serve` reverses the roles. It starts Claude Code as an **MCP server**, so another application acting as a host can connect to it and use Claude Code's tools. The roles themselves (host, client, server) are the MCP topology material's subject; what matters here is what this command gives the other side. ## What the command does - It runs a **stdio** server: the client launches `claude mcp serve` as a subprocess and exchanges messages over stdin and stdout. How stdio framing works is the transport material's subject. - It **prints nothing** when started by hand. Because stdin and stdout are the protocol channel, a silent, blocked terminal means the server is running and waiting for a client, not that it hung. - It **exposes Claude Code's tools** to the connecting client, so the client's model can, for example, read files in a directory and make edits. ## Wiring it into a client A desktop client that reads an `mcpServers` block, such as Claude Desktop through `claude_desktop_config.json`, needs an entry like this: ```json { "mcpServers": { "claude-code": { "type": "stdio", "command": "claude", "args": ["mcp", "serve"], "env": {} } } } ``` 1. Make sure `command` reaches the Claude Code executable. A desktop app often has a different `PATH` from your shell. 2. If it doesn't, run `which claude` and put the **full path** in `command`. 3. Without a reachable executable the client fails with an error like `spawn claude ENOENT`. ## Who approves the tool calls This is the part people get wrong. The docs state that this server **only exposes Claude Code's tools to your MCP client**, so **your own client is responsible for implementing user confirmation for individual tool calls**. In an interactive session Claude Code shows its own permission prompts; here the terminal running `claude mcp serve` is busy carrying protocol messages, and the documented place for confirmation is the client. | Question | Claude Code as host (`claude`) | Claude Code as server (`claude mcp serve`) | | :- | :- | :- | | Who drives the model? | Claude Code | the connecting client | | Transport | whatever each added server uses | stdio | | Who confirms tool calls? | Claude Code's permission prompts and rules | the connecting client | | What it offers | your servers' tools, resources and prompts | Claude Code's own tools | So before pointing a client at it, check that the client actually asks before tool calls that edit files or run commands; a client that auto-approves everything turns `claude mcp serve` into unattended file and shell access. ## Troubleshooting a connection 1. **The client reports `spawn claude ENOENT`:** the client couldn't find the executable; use the full path from `which claude`. 2. **Running it by hand shows nothing:** expected; stdio servers are silent, so test from a configured client. 3. **The client connects but tool calls do things you didn't approve:** that is the client's confirmation policy, not Claude Code's; tighten it in the client. 4. **You expected your own MCP servers to appear in the client:** the docs promise Claude Code's tools, nothing more; connect those servers to the client directly. The `env` object in the client entry passes environment variables to the `claude` process it launches, the same way it would for any stdio server, so settings that Claude Code reads from the environment can be supplied there. ## When to use it, and when not - **Use it** to let another MCP-capable application borrow Claude Code's file and shell tools for a project on your machine. - **Don't use it** expecting a full Claude Code session: the client's own model does the reasoning and only calls the exposed tools. - **Don't confuse it** with the Agent SDK, which embeds the Claude Code agent loop in your own program; that is a separate material's subject.
- You run claude mcp serve in a terminal to test it and nothing appears. Is it broken?Probably not. A stdio MCP server uses stdin and stdout for protocol messages, so `claude mcp serve` prints nothing on start; a silent, blocked terminal means it is running and waiting for a client. Test it from an MCP client configured to launch it rather than by watching the terminal.
- What should you check in the client before connecting it to claude mcp serve?That the client asks a person before tool calls, especially edits and shell commands. The server only exposes Claude Code's tools, and the docs put user confirmation for individual calls on the client. Also check that the `command` reaches the `claude` executable, using the full path from `which claude` if the client's `PATH` lacks it.
- claude mcp serve opens an HTTP endpoint for remote clients
- Nothing printing on start means claude mcp serve has hung
- Claude Code's own prompts confirm every call made through it
- It hands the client a full Claude Code session, model included
- The client finds claude automatically whatever its PATH is