# forge-delegate [Health: Active]

**Category:** 🤖 Coding Agents  
**Repository:** https://github.com/MuhamadBarzani/forge-delegate  
**GitHub Stars:** 4  
**npm Downloads (last month):** 2498  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/forge-delegate

## Description
MCP server that delegates coding work from Claude Code, Codex or opencode to any model opencode can run, so your main agent's context stays small

## Tools
Capabilities this server exposes over MCP:

- **ask_model** — Second opinion from another model (direct API, no file access)
- **delegate** — Model works **autonomously** via opencode's own tool loop — inline by default; `background:true` returns a job id to poll via `check_delegation
- **check_delegation** — Poll a background job (or list all with no id)
- **list_models** — List local/keyless, direct-API, and agentic models
- **get_delegate_config** — Read current configuration (default model, directory, autoApprove, profiles)
- **set_delegate_config** — Change configuration at runtime — no reinstall

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "forge-delegate": {
    "command": "npx",
    "args": ["-y","forge-delegate"]
  }
}
```

## Documentation

## What forge-delegate does

forge-delegate lets a primary coding agent hand off selected work to another model through opencode. The primary agents named by the project are Claude Code, Codex, and opencode. The delegated model handles its own tool loop locally, so file contents and high-volume interaction remain outside the primary agent's context; the primary agent receives a result summary, session information, and token usage.

It is aimed at low-risk, clearly specified work such as boilerplate, repetitive edits, tests, lint and type fixes, documentation updates, and straightforward migrations. Architecture, security-sensitive code, public interface decisions, ambiguous requirements, and difficult debugging are better kept with the primary agent.

## How it works

MCP clients communicate with forge-delegate over stdio. For an autonomous task, `delegate` invokes opencode with a selected model, working directory, agent, variant, and approval policy. Calls return inline by default. A caller can set `background: true` to receive a job identifier and use `check_delegation` to poll it; Claude Code may automatically background work that runs for roughly two minutes or longer.

The server can use free, no-auth `opencode/*` models, or any provider already configured in the user's opencode installation. Provider credentials stay in opencode and are not stored by forge-delegate. Results include token usage and, when the provider supplies pricing, cost information.

## Setup and configuration

The recommended installation uses Node.js 18 or newer and opencode version 2 or newer:

```bash
npx -y forge-delegate setup --model "opencode/deepseek-v4.1-flash-free" --targets "claude,codex,opencode"
```

The setup command registers the MCP server with selected agents, sets a default model, installs an update launcher for published installs, and adjusts Codex MCP timeouts. Running it without flags starts an interactive setup. Windows users can use the same npx command from cmd or PowerShell. A checkout can be configured with `node cli.mjs setup`.

Configuration is stored in `~/.forge-delegate/config.json` and is reread on every call. It can be changed through `get_delegate_config` and `set_delegate_config`, the `forge-delegate config` CLI, setup flags, or direct file edits. Supported settings include the default model and agent, reasoning variant, working directory, timeout, automatic approval, and named profiles. The `FORGE_OPENCODE_TIMEOUT` environment variable controls the delegation timeout.

The `user` scope writes agent configuration for all projects; `project` scope writes configuration inside the selected project and may require project trust or approval, depending on the host.

## Tools and capabilities

- `ask_model` requests a second opinion through a direct API call. It has no file access.
- `delegate` assigns work to opencode's autonomous tool loop and supports inline or background execution.
- `check_delegation` polls a background job or lists available jobs when called without an identifier.
- `list_models` shows local or keyless, direct-API, and agentic models available to the setup.
- `get_delegate_config` reads the active defaults and profiles.
- `set_delegate_config` changes those settings without reinstalling the server.

Setup also installs a `delegate-work` skill for Claude Code and Codex unless disabled. The skill keeps delegation guidance available throughout a long session, where one-time MCP instructions may become less prominent.

## Limitations and notes

Delegated work depends on a compatible opencode v2-or-newer installation. Older opencode binaries can fail because they do not support the command options used for working directories and variants. Non-free or non-`opencode/*` providers must be authenticated in opencode first; Ollama instead requires its local application to be running. Free model tiers may be rate-limited.

Automatic approval defaults to enabled for headless delegation, so review that setting before assigning tasks with meaningful permissions. The project specifically recommends retaining architecture, security, concurrency, performance-critical, ambiguous, and hard-to-detect correctness work on the primary agent.

_Full upstream README: https://allmcps.com/mcp/forge-delegate/readme_

