MartinLoop

Puts budgets, verifier gates and run receipts around coding-agent jobs started from an MCP host

By Keesan (individual) JavaScript Local · stdio Developer toolsAI and MLGit and code hosting

43 popularity score ★ 296 ↓ 473/wk

Connect your client

Local (npm)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add martinloop -- npx -y @martinloop/mcp
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "martinloop": {
      "command": "npx",
      "args": [
        "-y",
        "@martinloop/mcp"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "martinloop": {
      "command": "npx",
      "args": [
        "-y",
        "@martinloop/mcp"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "martinloop": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@martinloop/mcp"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.martinloop]
command = "npx"
args = ["-y", "@martinloop/mcp"]
Gemini CLITerminal
gemini mcp add --scope user martinloop npx -- -y @martinloop/mcp

What it does

MartinLoop is a control layer for coding agents, and @martinloop/mcp is its MCP server. You give it an objective, a verifier command such as `npm test`, a spend ceiling and an attempt cap. It then hands the work to an agent CLI (Claude Code, Codex or Gemini CLI) and re-runs the verifier after each attempt. It stops when the checks pass, when the budget or attempt limit is reached, or when a policy check blocks the run. Every run ends with a VERIFIED, STOPPED or NEEDS REVIEW outcome and a stored receipt.

The server walks a host through set steps: martin_doctor, martin_plan and martin_preflight, then martin_run. In server.ts, martin_run checks the recorded workflow first and fails with policy_blocked, listing the missing steps, if the host skipped any. Further tools pause, continue or cancel a live run, read saved runs, attempts and verifier evidence, grade a run, check a PR body against the evidence, and draft or open a GitHub pull request from the receipts. Run records are kept as local JSONL files, each signed with HMAC, so later edits to a record can be detected.

In v0.8.10 the default full profile lists 24 tools, while the MCP tool reference names only 21. Missing from the reference are martin_estimate, which gives a read-only cost and route estimate, and two Arcade tools defined in arcade/capabilities.ts. martin_arcade opens a view-only panel in hosts that support MCP Apps, and martin_arcade_status reads the evidence behind that panel. The server also offers 26 martin:// resources and 16 prompts. It talks over stdio by default. Pass --http and it serves Streamable HTTP on 127.0.0.1:3033 at /mcp instead (--host, --port and --path change that), and --tool-profile directory trims the tool list.

What it needs

RuntimeNode.js 20+
Runs onmacOS, Windows, Linux
Claude Code, Codex or Gemini CLIAn agent CLI signed in to its provider, for martin_run. Its model usage is billed by that provider.
GitHubFreeOnly for martin_create_pr with execute=true, through a signed-in gh CLI.
Also
  • An agent CLI on PATH: claude, codex or gemini
  • GitHub CLI (gh) for opening pull requests
  • A git workspace with a verifier command such as a test suite

npx needs Node.js 20 or later. The package brings no agent CLI: install and sign in to Claude Code, Codex or Gemini CLI yourself before calling martin_run. Install and sign in to the GitHub CLI (gh) before calling martin_create_pr with execute=true. Runs only finish as VERIFIED when you give a verifier command that your workspace can run.

Limits

  • Limit A VERIFIED outcome covers only the checks your verifier runs. The README says it does not mean the code is bug-free or safe to merge.
  • Cost For Codex, cost and token figures are labelled estimated unless the host reports real usage.
  • Not covered martin_run is refused with policy_blocked until the earlier workflow steps for the same task are on record.
  • Limit The MCP tool reference leaves out martin_estimate, martin_arcade and martin_arcade_status, which v0.8.10 registers.
  • Not covered The minimal, diagnostic, full-local and github-review profiles come from `martin-loop mcp print-config`. The server takes only `--tool-profile full|directory`, full by default.
  • Limit Hosted sync of run evidence needs MARTIN_API_TOKEN and MARTIN_TELEMETRY_ENDPOINT, set through the separate martin-loop CLI.

Who it suits

Developers who already use Claude Code, Codex or Gemini CLI and want hard spend and attempt limits, a required test pass, and an auditable record around each delegated task, started from inside their MCP host. It writes code through the agent it starts and can open pull requests, so it is a poor fit if you only want read-only help. The `directory` tool profile or a host allow-list narrows what it exposes. It does not take the place of CI, code review or the coding agent itself. It is not published by Anthropic, OpenAI or Google.

Tools 24

19 only read, 5 change things. A ? marks an optional parameter.

martin_doctor
Checks the local setup, agent CLIs, workspace and run store before work startsworkingDirectory?: stringrunsDir?: stringengine?: enum
martin_estimate
Estimates cost and route for an objective before anything is spentobjective: stringengine?: enumbudgetUsd?: numberfileScope?: arrayworkingDirectory?: string
martin_plan
Sets out scope, verification and budget for a task before a runobjective: stringworkingDirectory?: stringcontext?: stringpolicyPack?: enumverificationPlan?: arrayallowedPaths?: arraydeniedPaths?: arraymaxUsd?: numbermaxIterations?: integermaxTokens?: integermaxMinutes?: integermaxFilesChanged?: integermaxCommands?: integer
martin_preflight
Checks a proposed run contract (verifier, scope, budget) before executionobjective: stringworkingDirectory?: stringengine?: enummodel?: stringcontext?: stringpolicyPack?: enummaxUsd?: numbermaxIterations?: integermaxTokens?: integermaxMinutes?: integermaxFilesChanged?: integermaxCommands?: integerverificationPlan?: arrayallowedPaths?: arraydeniedPaths?: arrayworkspaceId?: stringprojectId?: string
martin_run changes
Starts a coding run through the chosen agent CLI, held to budget and verifier gatesobjective: stringworkingDirectory?: stringengine?: enummodel?: stringfallbackEngines?: arraymaxUsd?: numbermaxIterations?: integermaxTokens?: integerverifyTimeoutMs?: integerproviderExecutionTimeoutMs?: integerverificationPlan?: arrayallowedPaths?: arraydeniedPaths?: arrayworkspaceId?: stringprojectId?: string
martin_status
Reports the state of the live or most recent runloopJson?: stringfile?: stringloopId?: stringrunsDir?: stringlatest?: boolean
martin_logs
Reads recent events, ledger entries and control receipts for one runfile?: stringloopId?: stringrunsDir?: stringlatest?: booleanlimit?: integer
martin_pause changes
Asks a running loop to pause at the next safe point and writes a control receiptfile?: stringloopId?: stringrunsDir?: stringlatest?: booleanreason?: stringrequestedBy?: string
martin_continue changes
Resumes a paused loop from its saved contextfile?: stringloopId?: stringrunsDir?: stringlatest?: booleanreason?: stringrequestedBy?: string
martin_cancel changes
Stops a running loop and writes a control receiptfile?: stringloopId?: stringrunsDir?: stringlatest?: booleanreason?: stringrequestedBy?: string
martin_inspect
Opens a saved loop recordfile?: stringrunsDir?: string
martin_list_runs
Lists saved run records, with filters by status, model and daterunsDir?: stringlimit?: integerstatus?: stringlifecycleState?: stringadapterId?: stringmodel?: stringupdatedAfter?: string
martin_triage_runs
Ranks saved runs by urgency and missing evidencerunsDir?: stringlimit?: integerstatus?: stringlifecycleState?: stringadapterId?: stringmodel?: stringupdatedAfter?: stringincludeHealthy?: boolean
martin_get_run
Fetches one saved runfile?: stringloopId?: stringrunsDir?: stringlatest?: boolean
martin_get_attempt
Fetches a single attempt within a runfile?: stringloopId?: stringrunsDir?: stringattemptIndex?: integer
martin_get_verification_results
Returns the stored verifier evidence for a runfile?: stringloopId?: stringrunsDir?: string
martin_run_dossier
Builds a compact dossier for a runfile?: stringloopId?: stringrunsDir?: stringlatest?: boolean
martin_dossier
Returns the run dossier in JSON, Markdown or GitHub PR formfile?: stringloopId?: stringrunsDir?: stringlatest?: booleanformat?: enum
martin_eval
Grades a run on verifier coverage, regression risk and reviewabilityfile?: stringloopId?: stringrunsDir?: stringlatest?: boolean
martin_pr_summary
Drafts a pull-request summary from a run's receiptsfile?: stringloopId?: stringrunsDir?: stringlatest?: booleanformat?: enum
martin_create_pr changes
Previews a GitHub pull request, or opens one through gh when execute is truefile?: stringloopId?: stringrunsDir?: stringlatest?: booleanformat?: enumtitle?: stringbase?: stringexecute?: boolean
martin_review_pr
Checks a PR body against the run's evidence and returns a verdict with findingsfile?: stringloopId?: stringrunsDir?: stringlatest?: booleanformat?: enumprBody?: string
martin_arcade
Opens the view-only Arcade panel in hosts that support MCP Apps
martin_arcade_status
Reads the run evidence the Arcade panel shows, for one run or the latestloopId?: string

Resources 27

martin://server/health
Server health and environment readiness
martin://runs/recent
Previews of recent runs
martin://runs/triage
Runs ranked by how much attention they need
martin://runs/latest
Full dossier of the latest run
martin://runs/latest/summary
Short summary of the latest run
martin://runs/latest/proof-card
Small Markdown receipt for the latest run
martin://runs/latest/budget-status
Budget, token and stop-condition snapshot for the latest run
martin://runs/latest/verifier-evidence
Verifier evidence and warnings for the latest run
martin://runs/latest/rollback-evidence
Rollback and artifact evidence for the latest run
martin://verifiers/results
Latest verifier results
martin://policies/current
Local policy packs and the one suggested for this repo
martin://repo/risk-map
Sensitive parts of the repo and the suggested policy pack
martin://agent/next-step
The single next tool, prompt or resource to use
martin://agent/governance-status
Whether work is governed, budget left and runs without receipts
martin://agent/mode-status
Current working mode and how to switch it
martin://agent/memory-summary
Stored preferences, consent signals and budget patterns gathered over time
martin://guides/mcp-usage
Suggested workflow over MCP
martin://guides/agent-start
Short start guide for agents
martin://guides/command-map
Which tool or resource to pick for each job
martin://guides/ide-onboarding
Setup guide for IDE hosts
martin://guides/operating-rules
Rules on when agents must call the tools before working
martin://guides/publish-readiness
Checklist for MCP publish-readiness reviews
martin://runs/{loopId}
One saved loop record
martin://runs/{loopId}/dossier
Dossier for one saved run
martin://runs/{loopId}/attempts/{attemptIndex}
One attempt and its verification event
martin://runs/{loopId}/verification
Verification events for one run
ui://martinloop/arcade/index.html
The Arcade panel page, for hosts that support MCP Apps

Prompts 16

martin_start
Starts a governed workflow with minimal context
martin_preflight
Prepares the preflight payload before a run
martin_triage
Sorts run-store failures and picks what to inspect next
martin_resume
Picks up from an earlier run using its evidence
martin_prove
Builds a receipt from the latest or a chosen run
martin_release_check
Release-readiness review using the server's evidence
martin_governed_coding_kickoff
Frames a coding request before preflight
martin_debug_failed_run
Diagnoses a failed run from its saved attempts and checks
martin_publish_readiness_review
Publish-readiness review of the MCP package
martin_triage_run_store
Ranks saved runs and picks one to debug
safe_bug_fix
Small scoped bug fix through doctor, plan, preflight, run and dossier
write_tests_first
Failing tests first, then a small fix
small_refactor
Keeps a refactor small, path-scoped and checked by the verifier
security_review
Reviews a risky change using risk, scope and verifier evidence
pr_review
PR review checklist built from dossier and eval evidence
release_check
Release check based on run evidence

Similar servers