
Margin MCP server
Tests cheaper models against your own evals and opens a pull request to switch only when quality holds.
read 2026-11-26
How to connect
Add the server to your MCP client config. Claude Desktop, Cursor and most other clients read this shape:
{
"mcpServers": {
"margin": {
"type": "http",
"url": "https://trymargin.io/api/mcp?tools=core"
}
}
}Add it
Claude Code, in a terminal
claude mcp add --transport http trymargin https://trymargin.io/api/mcp?tools=coreclaude.ai, ChatGPT and other clients: add https://trymargin.io/api/mcp?tools=core as a custom connector in the settings.
margin_jobsWhere YOUR project's money goes, per job: each model-calling step over the last 30 days with its calls, cost, live model and whether any eval has exercised it, plus how concentrated the spend is in the top 5/10/20 jobs. A job is labelled…
margin_optimizeWHAT TO TEST NEXT for YOUR project: every candidate change Margin can name, ranked, each labelled by its basis: measured (a face-off ran and gave a verdict), detected, prior, or untested. A listed move is a candidate, not a verdict; the…
margin_faceoff_statusYOUR project's latest measured run, every face-off queued against it with its status and verdict, and the post-merge watch on each change you registered (holding, slipped, or still waiting for graded outcomes). Pull requests open from the…
margin_test_movechanges dataAsk Margin to TEST one move on YOUR project: a cheaper model, an output cap or a host pin, exactly as a move listed by margin_optimize (pass its level, target and lever). Margin re-runs your own evals with the move applied, in its…
margin_test_modelchanges dataAsk Margin to face off ONE model you name (an OpenRouter slug such as openai/gpt-4.1-mini, or a release from this week) against YOUR project's latest measured run, on your own evals, in Margin's sandbox. Optionally name one `agent` to…
margin_delegate_keychanges dataHand a narrower agent key to another agent: a boss agent to a department agent, a department agent to one agent. Pass a spend limit (taken out of YOUR key's limit), an optional label, an optional list of agent files it may test (inside…
margin_my_keysYOUR agent key: its spend limit, how much is reserved, which agents it covers, and the keys it has handed out to other agents. Needs an agent key.
margin_fit_checkBefore spending anything: can YOUR eval set prove a model switch? Pass the export's text (a promptfoo results file, a Braintrust or LangSmith dataset export, or JSONL of {input or messages, expected, check}). Returns how many cases Margin…
margin_replay_datasetchanges dataReplay YOUR eval dataset against a candidate model, with no repo run: each case goes to `baseline` and `candidate` with the same messages (and the same structured-output schema, when the case has one), is graded by the case's own check…
margin_check_experimentsDid this change help or hurt, and is it proven? Compares two experiments your team ALREADY ran and scored (Braintrust export or experiment id; or LangSmith, with source langsmith or an ls:<experiment id or name>; or two Inspect .json logs…
margin_report_outcomechanges dataAfter a change Margin gave a verdict on has shipped (or did not ship): record what happened. `verdict_id` is the one the replay or check returned; `outcome` is held, regressed or not_shipped; `note` says how you know (an incident, a…
margin_change_recordOne verdict as a change record you can attach to your customer's change notice: what changed, the decision, the cases and the gap with its 95% bound, each segment's reading, the cases that got worse, cost per case, a review of the case…
margin_verdict_receiptOne verdict as a receipt someone outside your team can check: an in-toto Statement in a DSSE envelope (`receipt`), signed by Margin with Ed25519 when `signed` is true, with the decoded `statement` beside it. It carries the decision, the…
margin_track_recordMargin's verdicts for your project and how they turned out: how many said ship, do not ship or not enough evidence, and of the ship verdicts your team reported on, how many held. Unreported ones are pending, never counted as held. Free.
margin_draft_checkschanges dataWhen the fit check says your cases cannot be graded (free-text answers, common for support, ops and finance agents): pass what the agent is for (`task`, with its rules written out, e.g. 'never offer a coupon') and up to 20 real outputs…
margin_pin_drift_checkchanges dataWatch one setup for quality drift (a provider changing a model under its name, your retrieval or tools moving): pin your eval cases (`dataset`, the export's text) and a `model`, at a `cadence` of daily or weekly. Each run replays the…
How we checked it
Should an agent connect it
- Whether its tools do the product's job has not been judged yet.
- Checked on 4 of the 7 days it takes to judge reliability.
Once connected
- For "test cheaper models against your own eval suite", the likely first call is margin_optimize.
Said by rules from the measurements above. The likely first call is a model's pick from the tool list; read its description before relying on it.
Measured daily
- INITE MCP scoreafter a weeka score needs 7 daily checks: 4 so far
- Answeredmeasuring4 of the 7 daily checks it takes to print a share
- Median first answer142 ms
- Space in an agent's context≈ 5,584 tokensthe definitions of all its tools (16), which an agent carries on every turn
- Tool definitionsA · 98 of 100
- Typed results0 of 16 toolsdeclared outputSchema: results come typed, read once
- Parameters without a description: in 2 of 16
What an agent can do with it
- can do · test cheaper models against your own eval suite
- not sure · open pull requests for cheaper model switches that pass
- not sure · revert a model switch when quality slips
Each of the product's use cases, put to Jev against this server's tool list: can an agent do it with these tools?
Worth a look
None of the five warning signs in these definitions.
A program checks the server once a day: initialize and tools/list, no model. Tokens are the definitions' length at about four characters a token. The grade averages six checks of every tool's name, description, schema and annotations; it says how well the tools are described, not whether they work. The score weighs what was measured and nothing else: answering (25%), doing the product's job (25%), definitions (20%), context (10%), use (10%) and how readily a client connects (10%). A part that was not measured is left out, and a hidden instruction caps the score at 40. The state of vendors' MCP servers: method and numbers →
- Stateanswerschecked 2026-11-27
- Tools16
- Server calls itselfmargin
- Server version0.1.0
- Protocol version2025-06-18
On 2026-11-27 the server answered initialize and tools/list without a sign-in. First answer in 116 ms.
- Registry nameio.trymargin/marginverified in the MCP registry
The registry name sits under trymargin.io. The registry only lets a publisher use that namespace after proving control of the domain through DNS or HTTP.
Each line is something a program found when it went looking: the registry entry, the server's own answer, a spec that parses. A missing line means we did not find it, not that it does not exist.
Before we count this visit
Analytics and ad measurement tell us which pages and which of our ads do their job: Google Analytics and Google Ads, the Meta pixel, Yandex Metrica, and one first-party id of our own. Nothing is stored until you answer, and declining changes nothing about the site.