Delegate bulk code edits to a cheap worker model. Gated, atomic. PHP and Python.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Rewrite 200 methods with a cheap model, without a single line of the result passing through the expensive one's context β and without writing anything to disk that does not compile.
An MCP server that takes code work already analysed and split up by an orchestrating model, extracts the exact target block with the language's own parser, delegates the rewriting to a cheaper worker model, validates the result, applies it atomically, and records the whole thing outside the orchestrator's context.
The head decides. The muscle types. Bifrost is the nerve between them β and the part that guarantees nothing reaches disk broken.
In the examples below the head is Claude and the muscle is DeepSeek, which is simply the model that was to hand. Neither is a requirement. See The worker for why a 7B model on your own machine may be the more interesting choice.
A large codebase edited by an LLM has one real bottleneck, and it is not intelligence: it is context. Reading a 4,600-line file to change thirty lines of it burns the orchestrator's window on text it will never use again.
Bifrost's premise is that the mechanical half of coding β writing the replacement text β does not need the expensive model, and does not need to pass through its context at all.
| Orchestrator does it all | Via Bifrost | |
|---|---|---|
| 202 methods Γ ~800 tok | ~161,000 tok β exceeds a context window | ~15,000 tok |
The honest version (see RF-4): for a single small edit the saving is real but modest, because the orchestrator usually had to read the code anyway to say what it wanted. The order-of-magnitude win is in volume β transformations across many symbols where the instruction can be written without reading anything.
That is the use case this is built for. Not "fix this bug."
And the number the log reports is a counterfactual. The test suites in this repository were written through Bifrost itself: 97,909 bytes applied from 1,608 bytes of instruction, which the formula scores at 61Γ. The realised saving was zero, because the blocks were composed by the orchestrator rather than by a worker, and every one of those bytes was paid before Bifrost saw them. The log records what crossed the boundary, not where it was written. The worked example is in Β§11, kept unflattering on purpose.
patch_group gives atomicity, not sequencing.How this sits next to Aider, Serena and fast-apply models β including where
they are better β is in docs/comparison.md.
The orchestrator decides what and how. The worker decides nothing. The server is the only component allowed to touch disk, and it refuses until every gate passes.
| Gate | Checks | Default |
|---|---|---|
| 0 β offsets | the block on disk is byte-identical to what we sent the worker | on |
| 1 β syntax | the rebuilt file passes php -l / ast.parse() | on |
| 2 β one symbol | the returned block defines exactly one symbol β a class counts as one, whatever it holds | on |
| 3 β substance | no call, variable or control keyword vanished silently | off |
Three are on by default, not four. The substance gate is a coarse regex
check that never fired during calibration, and a gate that rejects good
patches is worse than one waiting to be armed. Enable it with
substance_gate=True before bulk work.
A "perimeter check" comparing bytes outside the target range was specified,
built, and then deleted: the server rebuilds the file as
original[:start] + block + original[end:], so the perimeter is preserved by
construction and the check can never fail. Calibration confirmed it β the
gate reported 9/9 while three files were left syntactically broken. See
RF-1.
Git is already a content-addressed database, so it is used as one.
git hash-object -w before each patch yields a blob SHA that goes in the
log; reverting is git cat-file blob. Deduplicated and compressed for free,
works with a dirty working tree, and there is no bespoke snapshot format to
maintain.
DeepSeek is what was to hand, and every number in this repository was measured against it. It is not a requirement, and it is probably not the most interesting way to run this.
The worker's job is deliberately narrow. It receives one isolated block and one instruction, and returns one block. It does not choose files, plan changes, decide what to edit, or see anything else in the codebase. That is a task a 7B coding model can do β and the gates exist precisely so a weak worker's mistakes are caught before they reach disk rather than after.
Which makes the local case the more compelling one:
That last one is the real argument. Delegating code generation to a small local model is normally a bad idea because you cannot trust the output and checking it by hand costs more than writing it. Bifrost's answer is that the checking is mechanical, and the machine can do it.
Any OpenAI-compatible endpoint works β Ollama, llama.cpp's server, LM Studio, vLLM:
No key is needed when the endpoint is not the default one.
No local model has been measured yet. The endpoint is configurable and the protocol is a plain OpenAI-compatible chat completion, but this repository does not publish claims it has not measured β and that includes claims in its own favour.
The instrument exists. Point it at your endpoint:
| Worker | Valid JSON | Byte-identical (identity task) | No lines lost | Unfenced | Latency |
|---|---|---|---|---|---|
DeepSeek (deepseek-chat, API) | 9/9 | 3/3 | 3/3 | 9/9 | 2.6 s |
| your model here |
If you run it, open a PR with the row. Numbers that make a model look bad are as useful as numbers that make it look good β the table exists to say which workers this actually works with, not to advertise.
One thing to expect. DeepSeek returned zero of nine responses wrapped in markdown fences. Smaller models fence almost everything, and that is a parsing problem rather than a capability one. Bifrost already strips fences; if your model is otherwise sound but still fails on them, report it as a bug here rather than as a mark against the model.
The unit of work sent to a worker is one parsed block β a single method β and never the file it came from. That is a consequence of the design rather than a feature added to it: if the replacement code does not pass through the orchestrator's context, it does not pass through anywhere else either.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/mcp-bifrost)<a href="https://allmcps.com/mcp/mcp-bifrost"><img src="https://allmcps.com/api/badge/mcp-bifrost?style=directory" alt="MCP Bifrost on AllMCPs" /></a>