MCP Configs2026年4月9日·1 分钟阅读

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.

Agent 就绪

这个资产会安全暂存

这个资产会先安全暂存。复制的指令会要求 Agent 读取暂存文件,并在激活脚本、MCP 配置或全局配置前先确认。

Stage only · 17/100策略:需暂存
Agent 入口
任意 MCP/CLI Agent
类型
Mcp Config
安装
Stage only
信任
信任等级:Established
入口
Claude Code MCP
安全暂存命令
npx -y tokrepo@latest install 095f9359-33aa-11f1-9bc6-00163e2b0d79 --target codex

先暂存文件;激活前需要读取暂存 README 和安装计划。

TL;DR
MCP server that lets Cursor, Windsurf, and Claude Desktop delegate complex tasks to Claude Code CLI in one-shot mode.
§01

What it is

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. 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.

It is designed for developers using Cursor or Windsurf who want Claude Code's file editing and codebase understanding capabilities as a sub-agent for complex multi-file operations.

§02

How it saves time or tokens

When your primary AI tool hits its limits on complex operations (multi-file refactors, large git diffs, cross-codebase analysis), it can hand off the task to Claude Code rather than attempting it with degraded quality. The one-shot mode avoids the overhead of interactive sessions, and results flow back to your primary tool seamlessly.

§03

How to use

  1. Install Node.js v20+ and Claude CLI
  2. Accept the --dangerously-skip-permissions flag on Claude CLI
  3. Add the MCP server config to your .mcp.json
  4. Restart your AI tool
§04

Example

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

Once configured, your primary AI tool can delegate tasks:

'Use Claude Code to refactor all API handlers to use the new error format'
'Ask Claude Code to analyze the git history and summarize recent changes'
'Have Claude Code fix the failing test suite in the backend module'
§05

Related on TokRepo

§06

Common pitfalls

  • The --dangerously-skip-permissions flag is required, which means Claude Code runs without confirmation prompts -- review the security implications before enabling
  • Node.js v20+ is a hard requirement; older versions cause silent failures
  • Each invocation starts a fresh Claude Code session, so context from previous calls is not retained between delegations

常见问题

Why would I use Claude Code MCP instead of Claude Code directly?+

Claude Code MCP is useful when your primary editor is Cursor or Windsurf but you want to leverage Claude Code's strengths for specific tasks. Your primary tool stays in control and delegates only when needed, keeping your workflow in one interface.

Does it work with Claude Desktop?+

Yes. Claude Desktop supports MCP servers, so you can add the claude-code-mcp config to Claude Desktop's MCP settings. This lets Claude Desktop delegate complex file operations to Claude Code CLI.

Is there a token or cost overhead?+

Each delegation creates a separate Claude Code session that consumes tokens independently. The one-shot mode is efficient, but complex tasks can use significant tokens. Monitor usage through your Anthropic dashboard.

Can multiple AI tools share the same MCP server?+

The MCP server runs per-client, so each AI tool launches its own instance. They do not share state or sessions. Each tool gets its own independent Claude Code sub-agent.

What permissions does Claude Code have in this mode?+

With --dangerously-skip-permissions, Claude Code can read and write files, execute shell commands, and perform git operations without asking for confirmation. This is necessary for one-shot mode but means you should only use it in trusted environments.

引用来源 (3)
🙏

来源与感谢

Created by steipete. Licensed under MIT.

claude-code-mcp — ⭐ 1,200+

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产