Governed MCP server for AI coding agents with budgets, verifier gates, and inspectable runs.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
Autonomous AI needs an independent control layer.
MartinLoop makes every agent action bounded, verified, reversible, priced, and provable.
Starting with software work across Claude, Codex, Gemini, Cursor, and internal agent systems.
Built from thousands of agent runs where the problem was not intelligence -- it was uncontrolled execution.
Get started: npx -y martin-loop@latest start
Try the demo: npx -y martin-loop@latest demo
Connect the MCP: npx -y @martinloop/mcp
AI coding agents are useful, but unbounded retry loops are expensive.
A task that looked like a small fix can become dozens of attempts, a blown token budget, and a diff nobody trusts. MartinLoop gives every run an explicit contract: objective, verifier, budget, scope, receipts, and a clear stop condition.
Use it when AI coding work needs to stay bounded, inspectable, and safe to review before it becomes expensive or destructive.
Teams use MartinLoop when they need governed agent execution that can be reviewed and trusted.
Try MartinLoop in a disposable demo workspace:
Optional global install:
If this flow is useful, open an issue with feedback so we can keep improving the public experience.
start prints the first-run guided path. run auto-checks doctor, session-start, and preflight, then executes when the environment is ready.
Inspect-first flow:
share --latest writes run-receipt.json and run-receipt.md into the selected run directory under share/. Proof-card images are opt-in with --with-proof-card or --proof-card-format.
Release notes for the current root package: MartinLoop 0.4.5.
Long governed runs can take a few minutes. MartinLoop Arcade keeps the terminal useful while you wait.
After 30 seconds, if the run is still going and you are in an interactive terminal, MartinLoop asks once:
Pressing y launches a terminal Space Invaders game. The governed run continues in the background β receipts, budget tracking, and the final result are untouched. The game closes automatically when the run finishes and the terminal is fully restored.
The prompt never appears in CI, piped output, JSON mode, or non-interactive environments.
MartinLoop turns an AI coding run into an inspectable execution record: budget used, verifier result, changed files, rollback evidence, and final receipt.
Ungoverned agents can retry until cost and scope drift. MartinLoop adds budget caps, verifier gates, and audit evidence so the run has a clear stop condition.
Proof receipts are local share bundles for governed AI coding runs. They show the task, spend, budget, verifier result, receipt integrity, and any evidence boundary that should not be rounded into confidence.
This real governed run spent $0.51 against a $3.00 budget. The verifier passed and the receipt integrity was signed, but the proof stayed at EVIDENCE_BOUNDARY because rollback evidence was not recorded.
Generate your own receipt after a governed run:
Example receipt files: Markdown and JSON.
Use this lane from a clean temp directory to verify the public CLI flow exactly as shipped:
For deterministic installs, pin the package line (martin-loop@0.4.3) or use martin-loop@latest. Plain npx martin-loop can resolve a stale local cache on some machines.
Default share bundle outputs:
share/run-receipt.jsonshare/run-receipt.mdOptional proof-card outputs:
share/proof-card-r<revision>-<hash>.svgshare/proof-card-r<revision>-<hash>.pngThe point is not that every governed run is always cheaper. The point is that every run becomes inspectable and enforceable: budget policy, verifier result, stop reason, and evidence are explicit.
For a deterministic public repro lane, use the benchmark workspace and compare governed execution to unbounded retry behavior:
npx martin-loop bench --suite under-3-challengenpx martin-loop bench --suite ralphy-engineering-50A Ralph-style loop is the failure mode where an AI coding agent keeps trying without knowing when continuing is unsafe, uneconomical, or unlikely to succeed.
MartinLoop keeps the useful part of the loop, then adds brakes:
Public governed runs use one canonical taxonomy: the 13 runtime FailureClass values from @martin/contracts.
See the canonical table: Failure Taxonomy (13 Runtime Classes).
npm test, before a run can count as complete.martin share --latest turns the latest governed run into a local share bundle with a redacted JSON receipt and Markdown recap. Proof-card images are generated only when explicitly requested.| Layer | Purpose |
|---|---|
| Task contract | Objective, verifier plan, repo root, allowed paths, denied paths, acceptance criteria, workspace, project, and budget. |
| Policy and budget | Defaults come from martin.config.yaml; CLI flags can override them. Budget preflight blocks attempts that would exceed policy. |
| Agent adapters | Claude CLI, Codex CLI, Gemini CLI, direct-provider, and verifier-only adapters normalize execution results. |
| Safety and verification | Scope checks, verifier command checks, prompt integrity, and grounding decide whether work can continue. |
| Persistence | JSONL run records, evidence summaries, and repo-backed artifacts make every run inspectable later. Each loop record is locally signed (HMAC, per-runs-root key) and dossier/runs get/runs verify/challenge/badge report an integrity verdict (verified / tamper_detected / unsigned) so post-hoc edits to a record are detectable, not just inspectable. |
actual, estimated, or unavailable).verified before a run is treated as trustworthy evidence for external review.Common options:
Examples below use npx martin-loop so they work without a global install. If you install martin-loop globally, the martin alias works too.
Use martin-loop share --latest after dossier when you want a redacted bundle you can hand to another person without sending raw run-store files.
More detail: CLI reference and configuration reference.
MartinLoop ships a public deterministic benchmark workspace in benchmarks/ plus the installed-package bench command.
From an installed package:
From a clean public clone:
Equivalent workspace-filter commands:
The installed-package command reads the shipped public fixtures. The repo-clone workflow runs the public benchmark workspace directly.
Related MCP servers commonly used alongside MartinLoop:
Run the standalone MCP package directly:
Add it to common hosts:
Generate host config from the root CLI:
The native installer supports user and project scopes for every host, plus Claude Code's local scope. copilot remains a compatibility alias for the VS Code target. Use mcp install --dry-run to preview changes. File-backed installs are atomic, backed up, and available to mcp verify-install, mcp rollback, and mcp uninstall. Governance files require the explicit --install-governance flag. The authoritative host-to-file and profile matrix is in the MCP setup guide.
The root martin-loop package and the standalone @martinloop/mcp package move on separate version lines. Machine-readable release truth lives in distribution/release-truth.json, and the human-facing release map lives in docs/release/VERSION-LEDGER.md.
The public MCP release train labels are:
0.1.4 operator foundation0.2.0 cockpit expansion0.2.5 public MCP package line0.2.7 usability and review release0.3.0 host adoption and onboarding release0.3.1 review and handoff releaseThe standalone MCP registry/server identifier is io.github.Keesan12/martin-loop.
More detail: MCP setup, MCP tool reference, and MCP compatibility.
The root SDK also exports createCodexCliAdapter, createGeminiCliAdapter, createDirectProviderAdapter, createOpenAiCompatibleAdapter, and createVerifierOnlyAdapter.
More detail: SDK reference and package map.
Requirements:
Standalone MCP validation:
Issues, bug reports, workflow feedback, and focused pull requests are welcome. Public-facing docs should stay concise, user-centered, and accurate.
Star this repo if you think AI coding needs budgets, brakes, and receipts.
martinloop.com Β· support@martinloop.com
MartinLoop is part of the NVIDIA Inception program.
Apache-2.0. See LICENSE.
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/martinloop-mcp)<a href="https://allmcps.com/mcp/martinloop-mcp"><img src="https://allmcps.com/api/badge/martinloop-mcp?style=directory" alt="MartinLoop MCP on AllMCPs" /></a>