# Claude Code MCP — Run Claude as Agent-in-Agent > MCP server that runs Claude Code CLI in one-shot mode inside other AI tools. Enables Cursor, Windsurf, and Claude Desktop to delegate complex tasks to Claude Code. 1.2K+ stars, MIT. ## Install Merge the JSON below into your `.mcp.json`: ## Quick Use Add this to your `.mcp.json` (Cursor, Windsurf, or Claude Desktop): ```json { "mcpServers": { "claude-code-mcp": { "command": "npx", "args": ["-y", "@steipete/claude-code-mcp@latest"] } } } ``` Prerequisites: 1. Node.js v20+ 2. Claude CLI installed with `--dangerously-skip-permissions` flag pre-accepted 3. Restart your AI tool after adding the config --- ## Intro Claude Code MCP is an MCP server that lets you run Claude Code CLI in one-shot mode inside other AI tools like Cursor, Windsurf, and Claude Desktop. With 1,200+ GitHub stars and MIT license, it turns Claude Code into an "agent inside your agent" — your primary AI tool can delegate complex file editing, git operations, and terminal commands to Claude Code without interactive permission prompts. This is particularly useful when Claude Code outperforms other editors at complex multi-file operations. Best for: developers using Cursor or Windsurf who want Claude Code's file editing power as a sub-agent. Works with: Cursor, Windsurf, Claude Desktop. --- ## Claude Code as a Sub-Agent ### Why Use Claude Code MCP? When your primary AI coding tool (Cursor, Windsurf) hits its limits on complex operations, Claude Code MCP lets it call Claude Code as a specialist: - **Complex file editing** — Claude Code handles multi-file refactors better than most editors - **Git operations** — Stage, commit, push without switching tools - **Terminal execution** — Run build commands, tests, deployments - **Web search** — Access web information during coding sessions - **Context offloading** — Saves your primary tool's context window by delegating tasks ### How It Works 1. Your AI tool (e.g., Cursor) encounters a complex task 2. It calls the `claude_code` MCP tool with a prompt 3. Claude Code CLI executes the task with full file system access 4. Results are returned to your primary AI tool 5. No interactive permission prompts interrupt the flow ### Configuration Options #### Basic Setup (Recommended) ```json { "mcpServers": { "claude-code-mcp": { "command": "npx", "args": ["-y", "@steipete/claude-code-mcp@latest"] } } } ``` #### With Custom Claude CLI Binary ```json { "mcpServers": { "claude-code-mcp": { "command": "npx", "args": ["-y", "@steipete/claude-code-mcp@latest"], "env": { "CLAUDE_CLI_NAME": "claude-custom" } } } } ``` ### Config File Locations | Tool | Path | |------|------| | Cursor | `~/.cursor/mcp.json` | | Windsurf | `~/.codeium/windsurf/mcp_config.json` | | Claude Desktop (macOS) | `~/Library/Application Support/Claude/claude_desktop_config.json` | ### FAQ **Q: What is Claude Code MCP?** A: An MCP server that runs Claude Code CLI inside other AI tools like Cursor and Windsurf, enabling them to delegate complex tasks to Claude Code without interactive prompts. **Q: Is Claude Code MCP free?** A: Yes, it is open source under the MIT license. You need a Claude API subscription for the underlying Claude Code CLI usage. **Q: Does it work with Claude Code itself?** A: It's designed for tools other than Claude Code (Cursor, Windsurf, Claude Desktop) that want to use Claude Code as a sub-agent. --- ## Source & Thanks > Created by [steipete](https://github.com/steipete). Licensed under MIT. > > [claude-code-mcp](https://github.com/steipete/claude-code-mcp) — ⭐ 1,200+ Thanks to steipete for enabling seamless agent-in-agent workflows across AI coding tools. --- ## Quick Use Add the following JSON to your `.mcp.json` (Cursor, Windsurf, or Claude Desktop): ```json { "mcpServers": { "claude-code-mcp": { "command": "npx", "args": ["-y", "@steipete/claude-code-mcp@latest"] } } } ``` Prerequisites: 1. Node.js v20+ 2. Claude CLI installed, with `--dangerously-skip-permissions` pre-accepted 3. Restart your AI tool after adding the config --- ## Introduction Claude Code MCP is an MCP server that runs the Claude Code CLI in single-execution mode from inside Cursor, Windsurf, Claude Desktop, and other tools. 1,200+ GitHub stars, MIT open source. It turns Claude Code into an "agent inside an agent" — your primary AI tool can delegate complex file edits, Git operations, and terminal commands to Claude Code, without interactive permission prompts. --- ## Why Use Claude Code MCP? - **Complex file editing** — Claude Code outperforms most editors on multi-file refactors - **Git operations** — stage, commit, push without switching tools - **Terminal execution** — run build, test, and deploy commands - **Context offload** — delegate tasks to Claude Code to conserve your primary tool's context window ### How It Works 1. The primary AI tool encounters a complex task 2. It calls the `claude_code` MCP tool with a prompt 3. Claude Code CLI executes the task with full filesystem permissions 4. Results are returned to the primary AI tool --- ## Source & Thanks > Created by [steipete](https://github.com/steipete). Licensed under MIT. > > [claude-code-mcp](https://github.com/steipete/claude-code-mcp) — ⭐ 1,200+ --- Source: https://tokrepo.com/en/workflows/claude-code-mcp-run-claude-agent-agent-095f9359 Author: MCP Hub