Forgehand
You can inspect Forgehand's health and registered repositories, delegate bounded coding tasks to a local OpenAI-compatible worker, and review compact task receipts.
forgehand_health: view the active worker, safety limits, registered repositories, and paths.forgehand_delegate: run one complete implementation task against a registered repository with bounded scope, acceptance criteria, constraints, base revision, iteration limits, worktree retention, and change requirements.forgehand_delegatealso accepts supervisor-authoredargvcommands by ID without a shell, requires explicit risk acknowledgement when commands are present, and can enforce required command IDs before success.forgehand_tasks: list recent compact task receipts without loading raw logs or diffs.forgehand_result: retrieve one compact task receipt by task ID.Tasks run in detached Git worktrees with scoped paths; approved commands inherit host network and OS permissions, so only trusted commands should be approved.
Runs delegated coding tasks against registered Git repositories in detached worktrees, constraining edits to declared paths and returning diffs and test results for review.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Forgehand Fix the failing tests in src/parser using a local model and show me the diff."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Forgehand is a small, model-agnostic MCP server for delegating complete coding tasks to an OpenAI-compatible local model. Each step receives bounded current state, deterministic repository facts, and only the latest observation — never the accumulated chat transcript.
Bounded batch reads let the worker inspect up to eight scoped files in one model round-trip without turning the conversation transcript into memory.
Em português
O Forgehand é um servidor MCP (stdio) em Python para delegar uma tarefa de código inteira a um modelo local com API compatível com a da OpenAI. O Codex planeja e revisa. O modelo local implementa num worktree Git separado, só nos caminhos que o contrato da tarefa declara, e roda apenas os comandos aprovados, sem shell. A cada passo ele recebe o estado atual, fatos do repositório e a última observação, em vez do histórico inteiro da conversa. No fim, devolve um recibo com o diff, os testes, as incertezas e os tokens gastos.
Num microbenchmark com o mesmo contrato, o loop conversacional original gastou 25.826 tokens do modelo local, e o Forgehand, 10.708 (58,54% a menos), para a mesma alteração em um arquivo. Ficou 5,52% mais lento, porque o modelo precisou repetir algumas saídas estruturadas. É uma medição preliminar e vale só para os tokens do modelo local.
Limite: não há sandbox do sistema operacional. Os comandos aprovados herdam a rede e as permissões da máquina, então aprove só comandos em que você confia.
Stack: Python 3.11 ou superior, Git, MCP, Pydantic, httpx, PyYAML e SQLite. Para instalar, veja o Quick start. O projeto adapta, sob licença MIT, o codex-hermes-worker (detalhes em NOTICE).
Related MCP server: cc-delegate
Why
Cloud coding agents are excellent architects and reviewers. They are also an expensive place to repeat file reads, compiler runs, failed tests, and mechanical edits. Forgehand moves that inner loop to your machine and returns a compact receipt with the patch, tests, token usage, and uncertainties.
You → Codex → one task contract → Forgehand → one local model
↑ │
└──── compact receipt ────┘Quick start
Requirements: Python 3.11+, Git, Codex, and one local server exposing an
OpenAI-compatible /v1/chat/completions endpoint with structured JSON output.
python -m pip install "forgehand-local @ git+https://github.com/JVCSampaio/forgehand.git"
forgehand init
forgehand repo add /path/to/your/repository
forgehand doctor
codex mcp add forgehand -- forgehand mcpThe default example is Ornith 1.5 9B at http://127.0.0.1:1234/v1. Choose any
compatible local model during setup:
forgehand init --model your-model-id --worker-name "My local worker" --forceThen ask Codex:
Use Forgehand to update the parser. Only modify
src/parserandtests/parser. Require the approved parser tests to pass, inspect the final diff, and review the result. I acknowledge that approved commands inherit host permissions and network.
Codex can call four MCP tools: forgehand_health, forgehand_delegate,
forgehand_tasks, and forgehand_result.
Open the private, read-only dashboard at any time:
forgehand dashboardIt binds only to 127.0.0.1, hides full repository paths, and reports measured
local-worker usage. It never presents those numbers as estimated Codex savings.
What stays bounded
exact Git roots must be registered by the user;
every task runs in a detached worktree;
the worker can access only declared repository-relative paths;
commands are supervisor-provided
argvarrays selected by ID, without a shell;host commands require an explicit risk acknowledgement in every task contract;
required command IDs must all exit zero before
successis accepted;common credential-bearing environment variables and interactive Git prompts are removed;
state, observation, output, steps, changed files, and retries have hard limits;
repeated commands on an unchanged tree are rejected, and action-rejection budgets stop unproductive local loops early;
implementation contracts can set
requires_changes=trueso an empty diff cannot be reported as success;full logs and diffs stay local; compact receipts return to the supervisor;
Codex review is always required before integration.
Forgehand does not provide an OS-level process sandbox. Approved commands still inherit the host network stack and OS permissions, even though they run without a shell and with a scrubbed environment. Only approve commands you trust. See the task contract and security model.
Token evidence
In one same-contract microbenchmark, the original conversational worker loop used 25,826 local-worker tokens. Forgehand used 10,708 — 58.54% fewer — while producing the same one-file change. Forgehand was 5.52% slower in that run because the worker needed several structured-output retries.
This is preliminary local-worker evidence, not a promise of 58.54% Codex, API, credit, cost, or latency savings. See Token accounting.
Design
Forgehand is inspired by the bounded-state execution described in SKILL.state. It adds coding-specific controls: transactional SQLite revisions, typed state operations, deterministic Git facts, scoped tools, worktree isolation, durable artifacts, and per-attempt usage.
History is archived, not attended.
Forgehand deliberately ships without self-evolving skills, multi-model routing, an unrestricted shell, or automatic cloud fallback. Experimental learning belongs in a separate optional project until it demonstrates net savings.
Status
Forgehand is alpha software. Use it on repositories with version control, inspect every patch, and rerun critical validation yourself.
License and attribution
MIT licensed. Forgehand evolved from ideas and MIT-licensed work in RANJIANG23/codex-hermes-worker. See NOTICE for attribution.
Available Tools
4 toolsforgehand_delegateA
Run one complete implementation task with bounded files and commands.
The repository must be registered first. Scope contains the only paths the worker may read or edit. Commands are supervisor-authored argv arrays invoked by ID without a shell, but inherit host permissions and network. Set the risk acknowledgement explicitly whenever commands are present. Required command IDs must all exit zero before the worker can return success.
Inputs: scope (required), objective (required), repository_root (required), acceptance_criteria (required), +10 more. Returns: object
forgehand_healthARead-onlyIdempotent
Return active worker, safety limits, registered repositories, and paths.
Inputs: no named parameters. Returns: object
forgehand_resultARead-onlyIdempotent
Return one compact task receipt by ID.
Inputs: task_id (required). Returns: object
forgehand_tasksARead-onlyIdempotent
List compact receipts for recent tasks without loading raw logs or diffs.
Inputs: limit. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: health reports status, delegate starts execution, tasks lists receipts, and result retrieves one receipt by ID. There is no meaningful overlap or ambiguity between them.
All tools use the same forgehand_ prefix and snake_case style, but the second segment is inconsistent in form: delegate is a verb while health, tasks, and result are nouns. The pattern is still predictable and readable.
Four tools is well-scoped for a focused task-execution server. The set covers status, submission, listing, and retrieval without unnecessary extras or obvious bloat.
The core submit-to-retrieve workflow is covered along with health/status, but there is no cancellation tool, and repository registration appears to be a prerequisite handled outside the MCP surface. These are minor gaps for a one-shot task runner.
Maintenance
Related MCP Connectors
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
Persistent memory and cross-session learning for AI coding assistants (hosted remote MCP).
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
A full backend your AI coding agent can set up over MCP
Related MCP Servers
- AlicenseAqualityDmaintenanceDelegate coding tasks to external AI coding agents in isolated git worktrees with independent verification, enabling any MCP client to orchestrate multi-agent workflows.5MIT
- AlicenseAqualityCmaintenanceDelegates heavy development tasks from a supervisor to an autonomous worker on a cheaper model via MCP, with isolated git worktrees and provider-agnostic support.31MIT
- AlicenseAqualityCmaintenanceEnables MCP clients to delegate routine coding tasks to a local model in isolated git worktrees, using test results as a gate and the client as the reviewer before changes are merged.5MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to route coding tasks across local and cloud models with explicit budgets, repository planning and execution, and independent validation/repair checks.Apache 2.0