Skip to content
MCP Server Directory logo
developer-tools

Martin Loop

Make AI coding agents safe to scale autonomously: assign work, cap spend, enforce policy, verify output, roll back failures, learn from loops, and prove ROI across every repo.

Reviewed overview

MCP サーバー概要

What is MartinLoop? MartinLoop is a governance/control layer for autonomous AI coding agents. It bounds, verifies, prices, records, and (when needed) rolls back agent actions so agent-driven code work is safe, auditable, and cost-controlled across repos and providers (Claude, Codex, Gemini, Cursor, direct providers).

How to use MartinLoop?

  • Quick start (disposable demo):
    1. npx -y martin-loop@latest start
    2. npx -y martin-loop@latest demo
    3. cd martin-loop-demo && npm install
    4. npx -y martin-loop@latest run “Summarize the demo workspace and prove tests still pass” --verify “npm test” --budget-usd 2 --max-iterations 1
  • CLI and global install: npm install -g martin-loop or use the npx flow. Common commands: doctor, session-start, preflight, run, dossier, share, bench, mcp.
  • SDK: npm install martin-loop and use the MartinLoop class with adapters (createClaudeCliAdapter, createCodexCliAdapter, etc.) to programmatically run governed loops.
  • MCP: integrate with the Model Context Protocol server via @martinloop/mcp to provide host-level integration and managed execution entrypoints.

Key features

  • Governed runs with explicit task contracts (objective, verifier, workspace, allowed/denied paths, budget).
  • Hard budget caps (USD/token/iterations) and soft thresholds to prevent runaway spend.
  • Verifier gates (e.g., run tests) before accepting changes.
  • Policy-as-code checks to block unsafe commands or path changes.
  • Run receipts (JSON/Markdown) and proof artifacts capturing spend, verifier results, changed files, rollback evidence, and integrity signatures.
  • Failure taxonomy and classification (13 runtime FailureClass values) for triage and reporting.
  • Rollback-aware rules and atomic installation/rollback for MCP-managed governance files.
  • Adapters for multiple engines (Claude, Codex, Gemini, openai-compatible, verifier-only) and local signing/integrity checks for auditability.
  • Benchmarks, deterministic repro lanes, and a developer SDK for automation.

Use cases

  1. Bounded automated code fixes and refactors where spend and safety must be limited.
  2. CI/CD budget gates and verifier-based approvals for agent-produced changes (e.g., run tests before merging).
  3. Audit and compliance: produce inspectable run receipts for security/review teams.
  4. Comparing outcomes across different agent engines under a single governed flow.
  5. Enabling safe autonomous workflows in repositories, internal tools, or agent orchestration platforms via MCP.

FAQ (from the project)

  • Q: How do I get started quickly? A: Use the npx demo/start/run flow shown above; try npx -y martin-loop@latest demo and run with --verify and --budget-usd.

  • Q: Which engines are supported? A: Adapters exist for Claude, Codex, Gemini, Cursor, and open/openai-compatible providers; verifier-only and direct-provider adapters are available too.

  • Q: Where are receipts and proof bundles stored? A: Default share outputs are written to share/run-receipt.json and share/run-receipt.md; optional proof-card images are generated when requested.

  • Q: Is MartinLoop production-ready and auditable? A: It provides local signed run records (HMAC per-runs-root key) with integrity verdicts (verified / tamper_detected / unsigned) and is designed for repo-level auditing and MSP/MCP integration.

  • Q: What license and system requirements? A: Licensed under Apache-2.0. Requires Node.js >= 20 for development; pnpm recommended for repo development.

  • Q: Can I integrate with GitHub Actions or other hosts? A: Yes — examples include a GitHub Actions budget gate and MCP host integration guide; mcp install/print-config helps produce host configs.

  • Q: How do I limit what an agent can change? A: Use allow-path/deny-path flags and policy checks in the task contract plus preflight to block unsafe changes before execution.

For full reference, consult the repo: https://github.com/Keesan12/martin-loop (includes CLI reference, SDK docs, MCP setup, examples, and benchmark lanes).