hybrid_local
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.
Hybrid Codex and local LLM
Status: experimental prototype. The worker has been tested with mocked inference, MCP stdio, and real Docker validation. Live DGX Spark, Open WebUI, and Home Assistant integration still needs verification in your environment. Start with a disposable repository and review every patch before applying it.
Codex owns task design, review and acceptance. A local stdio MCP worker delegates patch generation to one OpenAI-compatible model on the DGX Spark. It applies proposals to a detached Git worktree, runs optional offline validation and returns a structured review result. Open WebUI and Home Assistant use the same vLLM server independently.
Upstream credits
The worker adapts the MIT-licensed unified-diff parser from local-llm-delegator. See the included license notice.
The bounded implementation and repair loop draws inspiration from local-vibes.
Related MCP server: codex-opencode-orchestrator
Project guides
Install the worker
Use Python 3.11+, Git, and a local Docker engine in Linux-container mode for validation. Install in a virtual environment. On Windows:
python -m venv .venv
.venv/Scripts/python.exe -m pip install -r requirements.txt
docker pull python:3.12-slim
Copy-Item worker.example.toml worker.tomlOn Linux or macOS use .venv/bin/python as the interpreter and cp for the config. If your Python installation ships without pip, create the environment with uv venv and install using uv pip install --python <venv-python> -r requirements.txt.
Set the target Git checkout root and a private task-state directory outside it in worker.toml. The target needs a committed HEAD. Authorize exact text file paths and select trusted container images and argv for your checks. Use a locally pulled, preferably digest-pinned image with the project's test dependencies already installed. The validation container gets a read-only copy of the task's approved text files, so include all source modules, test files and config required by your check. Checks that need write access can use /tmp. Restrict the developer host's Docker engine to trusted local administrators.
Connect to inference
Use an existing authenticated OpenAI-compatible Chat Completions endpoint or follow the DGX setup. Set the endpoint, served model ID, and key in the shell that will launch Codex. For example, in PowerShell 7:
$env:LOCAL_LLM_BASE_URL = 'http://10.44.0.2:8000/v1'
$env:LOCAL_LLM_MODEL = 'spark-local'
$env:LOCAL_LLM_API_KEY = Read-Host 'Local inference API key' -MaskInput
.venv/Scripts/python.exe server.py smoke --capabilitiesReplace the example URL and model with your own. .env.example lists optional streaming, timeout, retry, and output settings. The worker reads the process environment.
Chat Completions is the baseline. The probe reports streaming, structured JSON schema and automatic tool round-trip separately. Set LOCAL_LLM_STREAM=1 only after SSE works with the selected endpoint. The worker uses plain JSON in assistant text and local patch validation, so it works without native tool calling or server-side structured outputs. Start with small scopes when a model struggles to emit JSON or correct diff hunks.
Run your first task
For a disposable example that matches worker.example.toml, create and commit a calculator and a test that expects an explicit error message:
$demoRepo = Join-Path ([System.IO.Path]::GetTempPath()) ("hybrid-demo-" + [guid]::NewGuid())
$demoState = "$demoRepo-state"
New-Item -ItemType Directory -Path "$demoRepo/tests" | Out-Null
@'
def divide(numerator, denominator):
return numerator / denominator
'@ | Set-Content -Encoding ascii "$demoRepo/calculator.py"
@'
import unittest
from calculator import divide
class CalculatorTests(unittest.TestCase):
def test_normal_division(self):
self.assertEqual(divide(6, 2), 3)
def test_zero_denominator(self):
with self.assertRaisesRegex(ZeroDivisionError, "denominator must be nonzero"):
divide(1, 0)
'@ | Set-Content -Encoding ascii "$demoRepo/tests/test_calculator.py"
git -C $demoRepo init
git -C $demoRepo -c core.autocrlf=input add calculator.py tests/test_calculator.py
git -C $demoRepo -c user.name=Demo -c user.email=demo@example.invalid commit -m 'Add calculator fixture'
$demoRepo -replace '\\', '/'
$demoState -replace '\\', '/'Put the two printed paths in
worker.tomlasrepositoryandstate_directory. Keep the sample file allowlists andunitcheck for this fixture.Merge codex.example.toml into your user Codex
config.toml. Use absolute paths to the worker files and virtual environment. From the shell with the inference variables set, runcodex mcp listand confirmhybrid_localis listed. Start the local session withcodex -C $demoRepo. This setup uses a Codex client with access to local stdio MCP. Codex MCP configurationGive Codex this prompt:
Use local_implement to make calculator.py raise ZeroDivisionError with the message "denominator must be nonzero" when the denominator is zero. Set write_paths to ["calculator.py"], read_paths to ["tests/test_calculator.py"], and checks to ["unit"]. Poll local_task_status and show me the diff and test result. If the change needs revision, send review feedback through local_fix and show me the revised result.
Review the diff and the
unitresult. For this example, the approved diff should preserve normal division and the check should pass. You can inspect the staged changes yourself withgit -C "<worktree from task status>" diff --cached. Apply only the diff you approve through your usual Git workflow.
local_implement and local_write_tests accept task, write_paths, optional read_paths and optional named checks. Paths apply to a committed snapshot, so stage and commit prerequisite work yourself before delegation. Use local_write_tests with only test files in write_paths. local_fix(task_id, feedback) carries the same base, files and checks into a new worktree, starting from the prior diff.
Poll the returned ID using local_task_status. Terminal states are ready_for_review, checks_failed and failed. Status includes an iteration counter when running, modified paths, cumulative staged diff, executed tests, summaries and errors. A ready result with an empty tests list had no automated validation. Inspect the patch and test output for correctness. Accept by integrating the reviewed diff yourself through your regular Git workflow, or reject by leaving it unapplied. The worker never commits or merges an implementation.
Successful and failed worktrees are retained. To remove a terminal task's worktree after review, run python server.py --config worker.toml cleanup <task_id> --yes. The JSON record and diff remain available. If the stdio worker is interrupted, its record may still say queued or running. After confirming the worker is stopped, use git worktree list and inspect the task path. Remove only that identified worktree with Git's worktree removal command after preserving any useful diff. An interrupted Docker check may leave a container named hybrid-check-<id>. Inspect it and remove the identified container after stopping the worker.
Boundaries and troubleshooting
Use a trusted target repository and trusted Git configuration. The worker owns the task directories and should be the only process modifying their files or staged changes. Git hooks and global/system Git config are disabled for the worker. Local Git configuration still applies. Keep repository filters and local config under developer control.
Only specified UTF-8 Git blobs are sent to the model. Review task descriptions, approved files and validation output for secrets and personal data. Keep credentials out of the authorized files. API credentials travel in the inference request header. The model has no filesystem access or shell tool.
The Git worktree isolates changes from your primary checkout. Docker is the execution boundary for generated code, with no network, a read-only snapshot, no repository metadata or host credentials, a bounded tmpfs, a non-root user and resource limits. The worker requires Docker for validation and has no host execution fallback. For adversarial repositories or stronger isolation, use a dedicated VM with a local Docker engine. Keep the engine and validation images patched.
If the worker returns HTTP 401, check the token and
/v1URL. For timeouts, check WireGuard routes, firewall rules, vLLM queue depth and the configured deadlines. For truncated replies, reduce the allowed context or raise the generation budget within the model context limit.If a check cannot import modules, add the required approved files to the task's read scope and use a trusted image with dependencies installed. If Git rejects a patch on Windows, use normalized LF source in Git and verify the task's base and paths. Invalid patches appear in task errors.
Tests
Run .venv/Scripts/python.exe -m unittest discover -s tests -v. These tests create a temporary Git repo and start a local mocked HTTP endpoint. To also exercise real Docker validation, automatic repair and the MCP correction loop, pull python:3.12-slim, set HYBRID_TEST_DOCKER=1 and rerun. No DGX is needed. On live infrastructure, run the inference smoke test, the concurrent shared-model smoke test, and Assist acceptance checks.
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
Autonomous AI developers on your own infrastructure: assign a task, get a pull request.
Git collaboration for AI agents and people: tasks, hand-offs, reviews, teams, shared memory.
No-data MCP handoff for local Claude Code to Codex harness moves. $49 lifetime.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables Codex to delegate bounded coding tasks to MiMo Code through a shared local daemon, supporting task boundaries, Git Worktrees, and a collaborative review workflow.3MIT
- FlicenseNot gradedqualityCmaintenanceEnables Codex to delegate bounded tasks to multiple AI model workers through a persistent OpenCode 2 service, with isolated Git worktrees and safe patch review and application.-
- AlicenseAqualityBmaintenanceEnables Claude Code to delegate coding tasks—investigation, review, long-running background jobs, and optional file edits—to a locally installed OpenAI Codex CLI, with the model and reasoning effort chosen per task and read-only execution by default. Follow-up requests reuse Codex's existing context, and write-enabled delegations can be confined to a managed git worktree so the user's own checkout stays untouched.975 npm1MIT
- AlicenseNot gradedqualityCmaintenanceEnables Codex to delegate explicitly assigned subtasks to a local runtime that executes them with user-configured models such as DeepSeek, Qwen, or Claude. All project modifications are gated behind generated diffs and human approval before being applied.MIT