
让 Claude 通过 MCP 向无头 OpenCode 代理发送调度编码——持久的 SQLite 队列、自动工作器、双向问题、工作树隔离
概览
通过持久的SQLite队列,将Claude的真实编码工作分发给无头OpenCode代理。 Claude 通过 MCP 提交任务。自动工作者在大约 60 秒内接收任务,运行在独立工作树中的 Opencode 代码,返回结构化摘要、支持 git 的差异、日志和用例供 Claude 读取。可在 Claude Desktop(标准版)、任何 HTTP 上的 MCP 客户端,反过来——OpenCode 也能驱动 Claude。 Claude 是一个强大的规划工具,无法触及你的文件系统。OpenCode 在本地运行代码,但存在于 Claude 的上下文之外。桥接器闭合了循环: - — 分解工作、委派并阅读结果。- — 无头且可重复地编辑、测试、壳体。- — 能够经受重启,支持重试、优先级、依赖和双向问题。
概述(AI 翻译)
Claude 计划。OpenCode 构建。 通过持久的 SQLite 队列,将 Claude 的真实编码工作派发给无头 OpenCode 代理。
Claude 通过 MCP 提交任务。自动工作程序在 ~ 60 秒内接收任务,在隔离工作树中运行 opencode run,返回结构化摘要、支持 git 的差异、日志和使用情况供 Claude 读取。可在 Claude Desktop(标准版)、任何 HTTP MCP 客户端上运行,反之——OpenCode 也能驱动 Claude。
为什么会有这样的存在
Claude 是一个强大的规划工具,无法触及你的文件系统。OpenCode 在本地运行代码,但存在于 Claude 的上下文之外。桥接器闭合了循环:
- Claude 保持界面功能 — 拆解工作、委派并读取结果。
- OpenCode 执行——编辑、测试、壳层、无头且可重复。
- SQLite 是持久切换 — 能够经受重启,支持重试、优先级、依赖和双向问题。
特色
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
TaskBridge
Claude plans. OpenCode builds. Dispatch real coding work from Claude to headless OpenCode agents via a durable SQLite queue.
Claude submits tasks over MCP. An auto-worker picks them up in ~60 s, runs opencode run in an isolated worktree, and returns a structured summary, git-aware diff, logs, and usage for Claude to read. Works from Claude Desktop (stdio), any MCP client over HTTP, and in reverse — OpenCode can drive Claude too.
Why this exists
Claude is a powerful planner that can’t touch your filesystem. OpenCode runs code locally but lives outside Claude’s context. The bridge closes the loop:
- Claude stays the interface — breaks work down, delegates, and reads results.
- OpenCode does the execution — edits, tests, shell, headlessly and reproducibly.
- SQLite is the durable handoff — survives restarts, supports retries, priorities, dependencies, and two-way questions.
Features
- 17 MCP tools for Claude —
submit_task,submit_batch(up to 20),get_task/get_task_result,get_task_logs(live tail),wait_for,answer_task,list_tasks,queue_status/worker_heartbeat,restart_worker(recover a dead/stale worker through launchd, from the MCP server itself),add_task_note,cancel_task/clear_finished,list_models/set_default_model,ping. No polling loops, full observability. - Headless auto-worker (
worker.py) — launchd polls every 60 s, claims oldest-first by priority, streams output totask_logs/.log, returns structured{summary, files_touched, tests_run, open_questions}plus a git-aware diff. - Two-way questions — worker can pause with a
questionblock → task goeswaiting+ macOS banner → Claude answers viaanswer_task→ run resumes with the answer in context. - Worktree isolation — per-task branch +
git worktree, auto-committed on success, cleaned up unlessworktree_keep. - Honest permissions —
readonlyreverts writes and reportsrevertedfiles;no-network/no-shellare prompt-level and explicitly labeled. - Reverse bridge (
claude_control_mcp.py) — 6 tools for OpenCode to drive Claude:claude_ask(sync),claude_submit/claude_poll/claude_result/claude_cancel(background),claude_status. Uses Anthropic API ifANTHROPIC_API_KEYis set, elseclaude -p. - Public-URL mode (
install.sh/start_public.sh) — one command to expose MCP through a temporary Cloudflare quick tunnel (default, no account needed) or ngrok, with automaticMCP_ALLOWED_HOSTSpairing. The installer asks which tunnel to use.
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →