MCP ConfigsApr 9, 2026·3 min read

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.

MC
MCP Hub · Community
Quick Use

Use it first, then decide how deep to go

This block should tell both the user and the agent what to copy, install, and apply first.

Add this to your .mcp.json (Cursor, Windsurf, or Claude Desktop):

{
  "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)

{
  "mcpServers": {
    "claude-code-mcp": {
      "command": "npx",
      "args": ["-y", "@steipete/claude-code-mcp@latest"]
    }
  }
}

With Custom Claude CLI Binary

{
  "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. Licensed under MIT.

claude-code-mcp — ⭐ 1,200+

Thanks to steipete for enabling seamless agent-in-agent workflows across AI coding tools.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets