opencode-foreman
Provides git worktree-based task isolation and branch management: creates per-task worktrees and branches, merges or discards branches when finishing tasks, and cleans up worktrees.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
opencode-foreman
A Claude Code plugin that makes Claude the foreman and opencode the worker. Claude splits work, briefs opencode sessions, reviews their output, sends fixes back, and merges. The heavy implementation tokens are spent on whatever model you run in opencode.
It ships:
An MCP server (
server/foreman.ts) with these tools:list_modelsstart_tasktask_statuswait_tasksend_messagelist_taskscancel_tasktask_detailsfinish_task
The
opencode-foremanskill, which teaches Claude the dispatch → review → fix → merge loop. It is a replacement for subagent-driven development.
Requirements
Node ≥ 23.6. The server is plain
.tsrun by Node's built-in type stripping, with no npm dependencies and no build step.opencodeon PATH, already working with your models.git (for worktree tasks).
Related MCP server: opencode-mcp
Install
/plugin marketplace add KoonPaT/claude-code-foreman
/plugin install opencode-foreman@claude-code-foremanRestart Claude Code. /mcp should then list opencode-foreman.
How it works
The opencode server. The MCP talks to an
opencode serveatFOREMAN_OPENCODE_URL(defaulthttp://127.0.0.1:4096). If nothing answers there, it starts one detached and leaves it running. Workers survive Claude restarts, and several Claude windows share one server.Tasks. Each task is one opencode session, and the task id is the session id. Sessions are tagged (
[foreman]title prefix plus metadata), solist_tasksstill works after a restart.Status.
start_taskandsend_messagereturn immediately.wait_taskblocks until any of the given tasks finishes. A task's status is one of:runningdoneneeds_input: the worker ended with aQUESTION:lineerror
Permissions. Workers run unattended with a per-session ruleset. The ruleset denies
git push,npm publish,sudo, destructiverm -rf, writes outside the task directory, and interactive questions. A denied command is reported back and never hangs the task. Your own opencode config is untouched. The bash deny list is a best-effort pattern match, not a sandbox: a determined worker can still find a way to write or push.Worktrees. With
worktree: true, the task runs in its own git worktree at<repo>/../<repo>.foreman/<slug>, on the branchforeman/<slug>.finish_taskmerges or discards the branch and removes the worktree. A conflicting merge is aborted cleanly and the worktree is kept.
Usage
Just ask Claude, naming a model if you want one:
ใช้ opencode model opencodex/gpt-5.5 ทำหน้า login ตามแผนนี้ แล้วให้ opencode/big-pickle review
Use opencode with opencodex/gpt-5.5 to implement the plan in docs/plan.md, two tasks in parallel.
If you name no model, Claude asks you to pick one. To control the choices,
set your favorites in ~/.claude/settings.json:
"env": { "FOREMAN_MODELS": "opencodex/gpt-6-luna,opencodex/tokenme/google/gemma-4-31b-it" }list_models shows them first, under favorites:.
Watching workers
Every start_task returns a web: URL and a watch: command for the new
session. Open the web: URL in a browser to watch the worker live, or run
the watch: command (opencode attach <url> --session <id>) to attach.
list_tasks gives a quick summary of running and finished tasks.
Tests
npm test # unit + MCP protocol + git tests
FOREMAN_E2E=1 node --test test/e2e.test.ts # real opencode, free model opencode/big-pickleLicense
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted coding agent: start, follow up on and stop tasks that can open GitHub pull requests.
Deploy, monitor, and manage your OpenClaw AI assistants via natural language.
Create projects, nodes, and tasks in UluP Spaces by conversation with Claude.
Claude Code / MCP skills for the dev pipeline: discover, spec, design, build, ship, operate.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables Claude to create, manage, and clean up git worktrees automatically, including dependency installation and GitHub PR creation.5MIT
- AlicenseAqualityBmaintenanceEnables Claude Code to delegate tasks to OpenCode subagents asynchronously, with tools for starting tasks, polling status, and fetching results.7630 npm6MIT
- AlicenseAqualityCmaintenanceEnables Claude Code to run cursor-agent tasks in isolated git worktrees, manage asynchronous and parallel jobs, review diffs, and safely apply changes back to the repository.16MIT
- AlicenseAqualityBmaintenanceEnables Claude Code to delegate software-engineering tasks to OpenCode agents running in the same workspace/worktree, with the model and provider chosen per agent. Exposes tools for task delegation, persistent sessions, diffs, and agent listing so an orchestrator can research, edit, review, and test code.7139 npmMIT