
MCP Claude Code
Claude Code-style coding agent over MCP: read/edit files, run commands, search code, delegate to sub-agents.
Add to your client
Copy the config for your MCP client and paste it into its config file.
uvx --from mcp-claude-code claudecode --installPaste into ~/Library/Application Support/Claude/claude_desktop_config.json
{
"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.
Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf
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
About MCP Claude Code
An MCP server implementing Claude Code-like functionality so that MCP clients can analyze codebases, make targeted file edits with permission handling, run shell commands, search code with ripgrep and AST context, read/edit Jupyter notebooks, manage structured task lists, and delegate complex tasks to concurrent read-only sub-agents using any LiteLLM-compatible model. Filesystem access is restricted to directories specified via --allow-path.
Tools & capabilities (16)
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.
run_commandExecute shell commands (also used for directory creation, file moving, and directory listing).
notebook_readExtract and read source code from all cells in a Jupyter notebook with outputs.
notebook_editEdit, insert, or delete cells in a Jupyter notebook.
thinkStructured space for complex reasoning and analysis without making changes.
dispatch_agentLaunch one or more agents that can perform tasks using read-only tools concurrently.
batchExecute multiple tool invocations in parallel or serially in a single request.
todo_writeCreate and manage a structured task list.
todo_readRead a structured task list.
When to use it
- Give Claude Desktop the ability to read, edit, and refactor files in a local project with permission controls.
- Search large codebases quickly using ripgrep and AST-aware matching.
- Run build, test, or shell commands and manage files from within an MCP client.
- Read and edit Jupyter notebooks, including cell outputs.
- Delegate complex multi-step research tasks to concurrent sub-agents backed by a configurable LLM.
Security notes
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 FAQ
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.
What transports are supported?
The default transport is stdio; the `--transport` option also supports `sse`.
Alternatives to MCP Claude Code
Compare all alternatives →Microsoft's official browser-automation MCP using Playwright's accessibility tree (no vision model).
Up-to-date, version-specific library documentation injected into your coding agent.
LSP-powered coding agent toolkit: semantic symbol search, references and structural edits.
Compare MCP Claude Code with: