
How to add MCP Claude Code to Claude Desktop
Claude Code-style coding agent over MCP: read/edit files, run commands, search code, delegate to sub-agents. Paste the config into ~/Library/Application Support/Claude/claude_desktop_config.json and restart Claude Desktop.
Last updated June 14, 2026 ยท 301โ ยท stdio ยท no auth
Claude Desktop config for MCP Claude Code
uvx --from mcp-claude-code claudecode --install{
"mcpServers": {
"mcp-claude-code": {
"command": "uvx",
"args": [
"--from",
"mcp-claude-code",
"claudecode",
"--allow-path",
"/path/allow",
"--project",
"/path/project1",
"--project",
"/path/project2"
]
}
}
}Requires `uv` (the Python package runner). Install it from https://docs.astral.sh/uv/ if `uvx` is not found.
Setup steps
- 1Open Claude Desktop โ Settings โ Developer โ Edit Config (this opens ~/Library/Application Support/Claude/claude_desktop_config.json).
- 2Paste the MCP Claude Code config below under the top-level "mcpServers" key.
- 3Fill in any placeholder secrets (API keys, paths) in the snippet.
- 4Save the file, then fully quit and reopen Claude Desktop.
- 5Open a chat and confirm MCP Claude Code's tools appear under the ๐ tools menu.
Before you start
- Python 3.12 or later
- Claude Desktop application (or another MCP client)
- uv/uvx or pip to install the mcp-claude-code package
- Optional: ripgrep for enhanced search performance
- Optional: an LLM provider API key (LiteLLM-compatible) to enable the agent tool
What MCP Claude Code can do in Claude Desktop
readRead file contents with line numbers, offset, and limit capabilities.
writeCreate or overwrite files.
editMake line-based edits to text files.
multi_editMake multiple precise text replacements in a single file operation with atomic transactions.
directory_treeGet a recursive tree view of directories.
grepFast pattern search in files with ripgrep integration for best performance.
content_replaceReplace patterns in file contents.
grep_astSearch code with AST context showing matches within functions, classes, and other structures.
Security
Access is restricted to directories passed via --allow-path; file modifications and command execution trigger permission handling, with input validation and sanitization. The run_command tool executes arbitrary shell commands within allowed paths, so only grant access to directories you trust. The optional agent tool requires an LLM provider API key (passed via --agent-api-key or environment variables such as OPENAI_API_KEY / ANTHROPIC_API_KEY).
MCP Claude Code + Claude Desktop FAQ
Where is the Claude Desktop config file?
Claude Desktop reads MCP servers from ~/Library/Application Support/Claude/claude_desktop_config.json. Paste the MCP Claude Code config there under the "mcpServers" key and restart the client.
Is MCP Claude Code safe to use with Claude Desktop?
Access is restricted to directories passed via --allow-path; file modifications and command execution trigger permission handling, with input validation and sanitization. The run_command tool executes arbitrary shell commands within allowed paths, so only grant access to directories you trust. The optional agent tool requires an LLM provider API key (passed via --agent-api-key or environment variables such as OPENAI_API_KEY / ANTHROPIC_API_KEY).
How do I install and configure it?
The recommended method is uvx: run `uvx --from mcp-claude-code claudecode --install` to auto-configure Claude Desktop, or add a manual `mcpServers` entry with command `uvx` and args `--from mcp-claude-code claudecode --allow-path /path/allow`. You can also `pip install mcp-claude-code` and use the `claudecode` command directly.
How is filesystem access secured?
The server only accesses directories you explicitly pass via `--allow-path` (multiple allowed). File modifications and command execution use permission handling, and inputs are validated and sanitized.
How do I enable the agent (sub-agent) tool?
Add `--enable-agent-tool` and configure an LLM provider with `--agent-model` (LiteLLM format, e.g. `openai/gpt-4o` or `anthropic/claude-3-5-sonnet-20241022`) plus `--agent-api-key`, or use environment variables like OPENAI_API_KEY / ANTHROPIC_API_KEY. It is disabled by default.