戳码
在沙盒工作区中运行自主编码代理的MCP服务器。克隆一个仓库,使用Claude Agent SDK或OpenCode CLI执行任务,查看差异,提交和推送——在整个MCP中。
特性
- 两台发动机 --Claude代码命令行界面和OpenCode命令行界面
- 规划第一个工作流程 —
plan→approve→implement用于受控执行 - 完整模式 --跳过快速修复计划
- 沙盒工作区 --每次运行都有自己的克隆仓库
- Webhook通知 --进度、完成和每个工具的事件回调
- 增强型挂钩 --Claude代码钩子用于读取、Glob、Grep、Bash、WebSearch、任务、编辑、写入、停止
- 上下文7 MCP -当
CONTEXT7_API_KEY已设置 - 认证 -API通过Bearer令牌进行密钥验证
快速开始
# Clone
git clone https://github.com/kacperkwapisz/poke-code.git
cd poke-code
# Configure
cp .env.example .env
cp config.example.yml config.yml
# Edit .env with your ANTHROPIC_API_KEY and MCP_API_KEY
# Run
pip install -r requirements.txt
python src/server.py服务器启动于 http://localhost:3000/mcp (流式HTTP传输)。
码头工人
docker build -t poke-code .
docker run -p 3000:3000 \
-e MCP_API_KEY=your-secret \
-e ENVIRONMENT=production \
poke-code或者从GHCR中提取:
# Latest (staging, built from main)
docker pull ghcr.io/kacperkwapisz/poke-code:latest
# Release
docker pull ghcr.io/kacperkwapisz/poke-code:1.0.0工具
| 工具 | 说明 |
|---|---|
clone_and_init | 克隆仓库并创建工作区 |
execute_task | 运行编码任务(mode: plan, implement,或 full) |
approve_plan | 在实施之前批准或拒绝计划 |
get_status | 轮询运行进度、阶段、成本和计划状态 |
get_output | 分页活动日志 |
get_diff | 工作区更改的Git差异 |
commit_and_push | 承诺并推动变革 |
cancel_task | 取消正在运行的任务 |
cleanup_run | 删除工作区和运行状态 |
list_runs | 列出所有跑步记录 |
get_server_info | 服务器运行状况和功能 |
工作流程
先计划(推荐)
clone_and_init(repo_url) → run_id
execute_task(run_id, task, mode="plan") → agent explores, produces plan
get_status(run_id) → poll until completed, read plan_text
approve_plan(run_id, approve=True) → approved
execute_task(run_id, task, mode="implement") → agent implements the plan
get_diff(run_id) → review changes
commit_and_push(run_id, message, branch)快速修复
clone_and_init(repo_url) → run_id
execute_task(run_id, task) → mode="full" by default
get_diff(run_id)
commit_and_push(run_id, message, branch)配置
看 config.example.yml 用于所有选项,包括引擎设置、并发限制和webhook配置。
环境变量
| 变量 | 必填 | 描述 |
|---|---|---|
MCP_API_KEY | 生产 | MCP认证的承载令牌 |
ENVIRONMENT | 否 | 设置为 production 要求 MCP_API_KEY |
CONFIG_PATH | 否 | 配置文件路径(默认: config.yml) |
PORT | 无 | 服务器端口(默认值: 3000) |
CONTEXT7_API_KEY | 否 | 启用Context7 MCP以自动查找文档 |
Claude Code CLI通过用户的现有订阅进行身份验证。不需要API密钥。
许可证
麻省理工学院
