Token导航 LogoToken导航

MCP Server · 开发工具

Claude Code Control MCP

Claude Code Control MCP Server 是一个基于Claude AI的代码任务自动化服务平台,提供程序化代码执行、文件操作、代码搜索和状态监控等功能,适用于自动化编码工作流。

stdio官方级别未说明来源级核验工具 6
代码搜索PythonClaude工作流自动化

快速开始

作者 / 组织
marc-shade
提供方
marc-shade
运行时
Python

工具数量

6

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

0

仓库热度

收录来源

2 个

MCP World

选型结论

Claude Code Control MCP 属于开发工具类 MCP Server,公开资料标注 6 个工具,通过stdio 本地进程接入,适配 Claude,有可以直接复制的安装命令;接入前要先准备 API Key。

分类

开发工具

传输方式

stdio

认证方式

API Key

部署方式

公开资料未说明

安装与配置

安装命令

python3 server.py

客户端配置示例

{
  "mcpServers": {
    "claude-code-control-mcp": {
      "command": "python3",
      "args": [
        "server.py"
      ]
    }
  }
}

按公开安装命令拼出来的示例,字段名和参数以仓库 README 为准;带 YOUR_API_KEY 这类占位符的位置记得换成自己的值。

上手步骤

  1. 1

    准备运行环境

    stdio 服务在本地起进程,需要先装好 Python,再按安装命令拉取依赖。

  2. 2

    安装服务

    复制下面的安装命令执行;命令里带占位符的位置换成自己的密钥或路径。

  3. 3

    写入客户端配置

    在客户端的 MCP 配置里填启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4

    验证是否可用

    连接成功后客户端会列出 6 个工具,随便调一个只读工具确认能返回结果。

接入前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

详细介绍

克劳德代码控制MCP服务器

Claude Code用于代理工作流的自动化和控制。

部分 代理系统 -具有持久内存的24/7自主AI框架。

使用Claude AI进行自主编码工作流的编程任务执行。

概述

Claude代码控制MCP允许通过模型上下文协议执行编程代码任务。它为AI代理和工作流提供了一个桥梁,使用Claude Sonnet 4.5执行编码任务,具有全面的文件跟踪、命令执行和状态监控功能。

特性

  • 程序化任务执行:自主执行自然语言编码任务
  • 文件操作:读取、写入、编辑和跟踪文件更改
  • 代码搜索:在代码库中进行类似Grep的搜索
  • 命令执行:运行带有输出捕获的shell命令
  • 变更追踪:监控执行过程中的所有文件修改
  • 状态监测:实时执行状态和历史

建筑

┌─────────────────────────────────────────────────────────┐
│                  MCP Client (Claude Code)               │
└────────────────────┬────────────────────────────────────┘
                     │ MCP Protocol
┌────────────────────▼────────────────────────────────────┐
│         Claude Code Control MCP Server                  │
│  ┌──────────────┐  ┌───────────────┐  ┌─────────────┐ │
│  │   Server     │  │   Executor    │  │   Tracker   │ │
│  │   (MCP)      │  │  (Claude AI)  │  │   (Files)   │ │
│  └──────────────┘  └───────────────┘  └─────────────┘ │
└────────────────────┬────────────────────────────────────┘
                     │ Anthropic API
┌────────────────────▼────────────────────────────────────┐
│         Claude Sonnet 4.5 (Anthropic API)              │
└─────────────────────────────────────────────────────────┘

安装

  1. 安装依赖项:
cd ${AGENTIC_SYSTEM_PATH:-/opt/agentic}/mcp-servers/claude-code-control-mcp
pip3 install -r requirements.txt
  1. 设置API密钥:
export ANTHROPIC_API_KEY="sk-ant-..."
  1. 使用克劳德代码注册:

添加 ~/.claude.json:

{
  "mcpServers": {
    "claude-code-control": {
      "command": "python3",
      "args": [
        "${AGENTIC_SYSTEM_PATH:-/opt/agentic}/mcp-servers/claude-code-control-mcp/server.py"
      ],
      "env": {
        "ANTHROPIC_API_KEY": "sk-ant-..."
      },
      "disabled": false
    }
  }
}
  1. 重新启动Claude代码:
# Exit current session and restart

MCP工具

execute_code_task

使用自主工具使用Claude AI执行编码任务。

输入:

{
  "task_description": "Add error handling to the API endpoint in server.py",
  "working_directory": "${AGENTIC_SYSTEM_PATH:-/opt/agentic}/api",
  "context_files": ["server.py", "tests/test_api.py"],
  "max_iterations": 20
}

输出:

{
  "success": true,
  "task_description": "Add error handling...",
  "working_directory": "${AGENTIC_SYSTEM_PATH:-/opt/agentic}/api",
  "iterations": 8,
  "tool_uses": [
    {
      "tool": "read_file",
      "input": {"path": "server.py"},
      "result": "File content..."
    }
  ],
  "file_changes": {
    "total_changes": 2,
    "files_modified": ["server.py"],
    "files_created": [],
    "files_deleted": []
  },
  "duration_seconds": 12.5,
  "final_message": "Successfully added error handling..."
}

读_贬值

使用glob模式读取和分析多个文件。

输入:

{
  "patterns": ["*.py", "src/**/*.ts"],
  "working_directory": "${AGENTIC_SYSTEM_PATH:-/opt/agentic}",
  "max_files": 50
}

输出:

{
  "files_read": 12,
  "files": [
    {
      "path": "server.py",
      "size": 2048,
      "content": "#!/usr/bin/env python3..."
    }
  ]
}

搜索代码

在代码库中搜索代码模式。

输入:

{
  "query": "async def.*execute",
  "working_directory": "${AGENTIC_SYSTEM_PATH:-/opt/agentic}",
  "file_pattern": "*.py",
  "case_sensitive": true,
  "max_results": 100
}

输出:

{
  "query": "async def.*execute",
  "total_matches": 5,
  "matches": [
    "executor.py:42:async def execute_task(...)",
    "server.py:156:async def execute_command(...)"
  ]
}

修改文件

使用批处理操作修改多个文件。

输入:

{
  "changes": [
    {
      "path": "config.py",
      "action": "write",
      "content": "DEBUG = True\n"
    },
    {
      "path": "server.py",
      "action": "edit",
      "old_content": "port = 8080",
      "new_content": "port = 9000"
    }
  ],
  "working_directory": "${AGENTIC_SYSTEM_PATH:-/opt/agentic}"
}

输出:

{
  "modifications": [
    {"path": "config.py", "status": "written"},
    {"path": "server.py", "status": "edited"}
  ],
  "file_changes": {
    "total_changes": 2,
    "files_created": ["config.py"],
    "files_modified": ["server.py"]
  }
}

run_命令

使用输出捕获执行shell命令。

输入:

{
  "commands": [
    "python3 -m pytest tests/",
    "black --check *.py"
  ],
  "working_directory": "${AGENTIC_SYSTEM_PATH:-/opt/agentic}",
  "timeout": 30
}

输出:

{
  "command_results": [
    {
      "command": "python3 -m pytest tests/",
      "exit_code": 0,
      "stdout": "===== 5 passed in 2.5s =====",
      "stderr": ""
    },
    {
      "command": "black --check *.py",
      "exit_code": 0,
      "stdout": "All done! ✨",
      "stderr": ""
    }
  ]
}

获取执行状态

获取当前或最近执行的状态。

输入:

{
  "include_history": true
}

输出:

{
  "current_execution": {
    "task_description": "Add error handling...",
    "success": true,
    "iterations": 8
  },
  "executor_initialized": true,
  "execution_history": [...]
}

使用示例

示例1:自动代码重构

# Using from Python with anthropic client
import anthropic

client = anthropic.Anthropic()

response = client.messages.create(
    model="claude-sonnet-4-5-20250929",
    max_tokens=4096,
    tools=[...],  # MCP tools from claude-code-control
    messages=[{
        "role": "user",
        "content": "Refactor the authentication module to use async/await"
    }]
)

示例2:自主修复Bug

# Using from Claude Code
claude --prompt "Fix the memory leak in server.py using the claude-code-control MCP"

示例3:集成测试

# Using from workflow automation
from anthropic import Anthropic

client = Anthropic()

# Execute task
result = await mcp_execute_tool(
    "execute_code_task",
    {
        "task_description": "Add integration tests for the API endpoints",
        "working_directory": "${AGENTIC_SYSTEM_PATH:-/opt/agentic}/api",
        "context_files": ["server.py", "models.py"]
    }
)

print(f"Tests created: {result['file_changes']['files_created']}")

集成点

临时工作流

@workflow.defn
class CodeTaskWorkflow:
    @workflow.run
    async def run(self, task_description: str) -> dict:
        # Execute code task via MCP
        result = await workflow.execute_activity(
            execute_via_mcp,
            args=[task_description],
            start_to_close_timeout=timedelta(minutes=5)
        )
        return result

n8n工作流

使用HTTP请求节点调用MCP服务器:

{
  "method": "POST",
  "url": "http://localhost:PORT/execute",
  "body": {
    "tool": "execute_code_task",
    "arguments": {
      "task_description": "{{$json.task}}"
    }
  }
}

智能代理

from intelligent_agents.sdk_agents import ClaudeAgent

agent = ClaudeAgent()

# Agent uses MCP tools automatically
result = agent.execute(
    "Refactor authentication to use OAuth2",
    mcp_tools=["claude-code-control"]
)

文件跟踪

MCP服务器跟踪执行过程中的所有文件更改:

  • 已创建文件:写入新文件
  • 已修改的文件:现有文件已更改
  • 已删除的文件:文件已删除
  • 读取文件:用于读取的文件

变更包括:

  • 文件哈希(SHA256)
  • 尺寸变化
  • 时间戳
  • 线路变更统计数据(如果可用)

错误处理

服务器优雅地处理错误:

  • 工具执行错误:返回错误详细信息
  • 文件操作错误:已记录并返回给呼叫者
  • 命令执行错误:已捕获退出代码和stderr
  • API错误:随上下文传播的人类API错误

安全考虑

  1. API密钥管理:商店 ANTHROPIC_API_KEY 安全地
  2. 文件访问:仅限于指定的工作目录
  3. 命令执行:Shell命令以用户权限运行
  4. 输入验证:执行前验证所有输入
  5. 输出消毒:从输出中过滤敏感数据

演出

  • 典型任务执行:5-30秒
  • 文件 操作:每个文件小于1秒
  • 代码搜索:对于大型代码库,\<5秒
  • 内存使用:执行过程中约50-100MB

故障排除

服务器无法启动

# Check API key
echo $ANTHROPIC_API_KEY

# Test server directly
python3 server.py

# Check logs
tail -f ~/.claude/logs/mcp-servers.log

工具执行失败

# Verify dependencies
pip3 list | grep anthropic
pip3 list | grep mcp

# Test executor
python3 test_executor.py

文件跟踪问题

# Check permissions
ls -la ${AGENTIC_SYSTEM_PATH:-/opt/agentic}/

# Verify working directory
pwd

发展

运行测试

cd ${AGENTIC_SYSTEM_PATH:-/opt/agentic}/mcp-servers/claude-code-control-mcp
python3 test_server.py

添加新工具

  1. 将工具定义添加到 list_tools()
  2. 在中实现处理程序 call_tool()
  3. 更新文档
  4. 添加测试

调试

启用调试日志记录:

logging.basicConfig(level=logging.DEBUG)

路线图

  • \[\]批量任务执行
  • \[\]任务排队和调度
  • \[\]与增强型内存MCP集成
  • \[\]代码分析工具(复杂性、覆盖率)
  • \[\]Git集成(提交、推送、PR创建)
  • \[\]支持多文件重构
  • \[\]流媒体执行更新
  • \[\]用于监视的Web UI

贡献

欢迎投稿!需要改进的地方:

  1. 其他工具实现
  2. 性能优化
  3. 增强的错误处理
  4. 文档改进
  5. 测试覆盖率

许可证

代理系统项目的一部分。请参阅主许可证文件。

支持

对于问题和疑问:

  • 检查日志: ~/.claude/logs/
  • 审查MCP文件:https://modelcontextprotocol.io
  • API无烟煤文件:https://docs.anthropic.com

相关文件

______________________________________________________________________

MCP生态系统的一部分

该服务器与其他MCP服务器集成,以实现全面的AGI功能:

服务器用途
增强记忆mcp语义搜索的四层持久记忆
代理运行时mcp持久任务队列和目标分解
agi mcp使用21个工具进行完整的AGI编排
集群执行mcp跨节点的分布式任务路由
节点聊天mcp节点间AI通信
恩伯·麦克普仅生产政策执行

看 代理系统oss 对于完整的框架。

工具与能力

工具数量

6

资源数量

0

提示词数量

0

能力标签

代码自动化Python本地部署AI编程工作流自动化文件管理代码搜索

支持客户端

Claude

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

让助手直接读代码

把仓库、提交记录和 issue 交给模型检索,补全和重构时不用来回复制文件。

在对话里跑命令

触发构建、测试和脚本,执行结果直接回到上下文,省去切终端。

接进开发流程

把 PR、CI 状态和代码审查接进助手,减少在几个工具之间跳。

选择建议

值得选的地方

  • 只提供 6 个工具,职责集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 公开说明写得比较完整,接入前能看清能力边界。

先想清楚的地方

  • stdio 方式要求本地装好 Python,换机器要重新装一遍。
  • 需要自备API Key,没有凭据没法直接试。
  • 第三方目录整理,版本更新和行为细节以官方仓库为准。

更适合

  • 需要在开发工具场景里让模型直接调用外部能力的人。
  • 已经在用 Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 暂时拿不到API Key的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
Claude Code Control MCP

MCP World · 本页

6stdio有2 个2026-05-17
Git 838e2ec1

MCP World

12stdio有2 个2026-05-17
Markitdown MCP 2c653a5f

MCP World

1stdio有1 个2026-05-17
Context7 MCP C671e75a

MCP World

0stdio有1 个2026-05-17
Context7 831acf40

MCP World

0stdio有1 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

Claude Code Control MCP 怎么安装?

公开资料给出的安装命令是 python3 server.py,运行环境为 Python。装完后按客户端要求写进 MCP 配置,重启客户端生效。

Claude Code Control MCP 怎么在 Claude Desktop、Cursor 里配置?

它是stdio 本地进程,客户端配置里要写启动命令和参数,运行环境是 Python;保存后完全退出客户端再打开,配置才会生效。

Claude Code Control MCP 收费吗?

本站只整理公开资料,不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Claude Code Control MCP 需要 API Key 吗?

公开资料标注的认证方式是API Key,也就是要先拿到凭据才能连上;凭据只填在自己本地的配置里,不要写进公开仓库。

Claude Code Control MCP 支持哪些客户端?

公开资料标注支持 Claude;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

来源信息

继续浏览同类 MCP