엄격한 예산 및 반복 횟수 제한을 통해 코딩 에이전트가 소프트웨어 작업을 실행, 검증 및 복구할 수 있도록 거버넌스 계층을 제공합니다.
다른 이름 Keesan12/martin-loop, martin-loop, @martinloop/mcp
- 스타
- 286
- Tools
- —
- 다운로드, 30일
- —
- 최신 버전
- 0.9.0
- 마지막 커밋
- 2026년 11월 4일
- 라이선스
- Apache-2.0
Martin Loop MCP란?
Martin Loop은(는) MCP server입니다. 엄격한 예산 및 반복 횟수 제한을 통해 코딩 에이전트가 소프트웨어 작업을 실행, 검증 및 복구할 수 있도록 거버넌스 계층을 제공합니다.
프로젝트 README에서 생성된 요약
Martin Loop MCP server 정보
Martin Loop는 코딩 에이전트를 사용하는 개발자가 엄격한 경계 내에서 소프트웨어 작업을 관리할 수 있도록 거버넌스 계층을 제공합니다. 에이전트 주변에서 제어 시스템 역할을 수행하며, 정의된 성공 기준과 검증 단계를 통해 작업이 집중력을 유지하고 책임감 있게 수행되도록 보장합니다. 사전 점검, 제어된 실행, 실행 후 분석을 포함하는 구조화된 라이프사이클을 구현함으로써 에이전트가 목표를 벗어나거나 과도한 리소스를 소비하는 것을 방지합니다.
사용자는 --budget-usd 플래그로 최대 지출 한도를 설정하고 --max-iterations로 시도 횟수를 제한하여 비용과 실행 한도를 관리할 수 있습니다. 이 시스템은 모델에 구애받지 않으며 다양한 런타임과 함께 작동하므로, 개발자는 작업 정의를 일관되게 유지하면서 워커를 교체할 수 있습니다. 주로 npx 명령어나 글로벌 npm 설치를 통해 로컬에서 사용되지만, MARTIN_API_TOKEN을 사용하여 대시보드로 증거를 전송하는 호스팅 동기화 옵션도 제공합니다. 개발자는 audit 명령을 실행하여 기존 에이전트 지출 내역을 감사하고 수정 및 재시도 루프에 얼마나 많은 비용이 소모되었는지 확인할 수 있습니다.
활용 사례
- 1엄격한 작업 예산 강제개발자는 특정 달러 금액을 설정하여 AI 에이전트가 코딩 작업에 사용하는 비용을 제한할 수 있습니다.
- 2에이전트 재시도 횟수 제한작업에 허용되는 총 반복 횟수를 제한하여 에이전트가 무한 루프에 빠지는 것을 방지할 수 있습니다.
- 3코드 완료 자동 검증AI 클라이언트는 특정 명령을 사용하여 작업이 완료되기 전 요구되는 성공 기준을 충족하는지 증명할 수 있습니다.
- 4에이전트 지출 내역 감사개발자는 이전 에이전트 세션에 사용된 금액을 분석하고 비효율적인 재시도 루프를 식별할 수 있습니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
Martin Loop MCP 설치 방법
형식 확인: 2026년 11월 10일Cursor에 추가Goose에 추가Claude Code에 Martin Loop MCP 설치
$ claude mcp add martin-loop -- npx -y @martinloop/mcpCursor에 Martin Loop MCP 설치
~/.cursor/mcp.json
{
"mcpServers": {
"martin-loop": {
"command": "npx",
"args": [
"-y",
"@martinloop/mcp"
]
}
}
}VS Code에 Martin Loop MCP 설치
.vscode/mcp.json
{
"servers": {
"martin-loop": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@martinloop/mcp"
]
}
}
}VS Code CLI에 Martin Loop MCP 설치
$ code --add-mcp '{"name":"martin-loop","type":"stdio","command":"npx","args":["-y","@martinloop/mcp"]}'Claude Desktop에 Martin Loop MCP 설치
claude_desktop_config.json
{
"mcpServers": {
"martin-loop": {
"command": "npx",
"args": [
"-y",
"@martinloop/mcp"
]
}
}
}Codex에 Martin Loop MCP 설치
$ codex mcp add martin-loop -- npx -y @martinloop/mcpCodex config.toml에 Martin Loop MCP 설치
~/.codex/config.toml
[mcp_servers.martin-loop] command = "npx" args = ["-y", "@martinloop/mcp"]
Gemini CLI에 Martin Loop MCP 설치
$ gemini mcp add -s user martin-loop npx -- -y @martinloop/mcpGemini settings.json에 Martin Loop MCP 설치
~/.gemini/settings.json
{
"mcpServers": {
"martin-loop": {
"command": "npx",
"args": [
"-y",
"@martinloop/mcp"
]
}
}
}자동 검사
2026년 11월 12일에 실행됨전체 보고서 →자동 검사를 통과했습니다. 이는 보안 감사가 아닙니다. 코드를 직접 읽고 서버에 필요한 최소한의 권한만 부여하십시오. 검사 방식
- 소스 저장소 연결 및 접근 가능통과
- 오픈 소스 라이선스 (OSI)통과
- 최근 1년 내 커밋 또는 릴리스통과
- 패키지 이름이 인기 패키지와 유사하지 않음통과
- 원격 엔드포인트가 HTTPS 사용검사되지 않음
- 파괴적인 도구에 라벨 표시됨검사되지 않음
- 모델에 대한 숨겨진 지침 없음통과
- 패키지 및 해당 종속성에 중요한 보안 권고 없음통과
README
GitHub에서 보기MartinLoop
Give coding agents more work. Watch them less. Ship more.
MartinLoop lets you give coding agents real software jobs without babysitting every step.
Your coding agent still writes the code. MartinLoop keeps the job focused, bounded, and accountable — with limits, stop conditions, verification, recovery, and a clear outcome when the run ends.
Trust your coding agents with real work.
Built from thousands of agent runs where the problem was not just intelligence — it was whether you could give the agent a real job and confidently walk away.
Measure your loop tax: npx -y martin-loop@latest audit
Get started: npx -y martin-loop@latest start
Try the demo: npx -y martin-loop@latest demo
MartinLoop is part of the NVIDIA Inception program.
Start Here
Audit first — run npx -y martin-loop@latest audit to see how much API-equivalent Claude Code spend went into fix-and-retry loops. Add --offline for zero network access or --share for a shareable summary.
Install / onboard — run npx -y martin-loop@latest start, or install it globally with npm install -g martin-loop@latest.
Governed run — define an objective, verifier, budget, and iteration cap with martin run.
Verifier — completion requires fresh verifier evidence bound to the active run and workspace. A configured verifier proves only the checks it runs; VERIFIED is not a claim that the code is bug-free or automatically safe to merge.
Budget — set a hard spend ceiling with --budget-usd and an attempt ceiling with --max-iterations.
Receipts — inspect the latest result with martin dossier --latest and validate stored integrity with martin runs verify --latest.
Hosted sync (optional) — governed work is local-first. Configure MARTIN_API_TOKEN and MARTIN_TELEMETRY_ENDPOINT, then use martin sync status and martin sync flush to send preserved evidence to a dashboard later. See the quickstart.
MCP — install @martinloop/mcp@latest in a supported host or generate host configuration with martin mcp print-config.
Documentation — continue with the quickstart, CLI reference, or MCP setup.
When --model is provided, MartinLoop passes it through unchanged. Without --model, the authenticated host runtime chooses its own default. MartinLoop does not inject a hidden fallback model.
For AI Agents
MartinLoop is the system around the coding job.
The coding agent still writes the code. MartinLoop keeps the job, limits, verification, recovery, outcome, and history consistent around the work.
Use MartinLoop when a coding task needs:
- clear job and success criteria
- preflight readiness before agent spend
- hard budget and iteration limits
- allowed or denied edit scope
- controlled retries and stop conditions
- independent verifier commands
- recovery and rollback evidence
- a finite completion decision
- run receipts, dossiers, history, failure classification, and post-run analysis
- one consistent workflow across supported coding-agent runtimes
Canonical lifecycle:
DEFINE
-> PREFLIGHT
-> CONTROL
-> VERIFY
-> RECOVER
-> PROVE
-> ANALYZE
The product-level flow is Definition of Done -> Controlled Run -> Verified Handoff.
For machine-readable context start with llms.txt, llms-full.txt, and MartinLoop for AI Agents.
One System Around the Run
Teams should not need to stitch together a separate script or point tool for every part of coding-agent execution. MartinLoop connects the control path around the agent from preflight through post-run evidence.
| Stage | MartinLoop role |
|---|---|
| Define | Capture the objective, verifier, budget, scope, and finish line. |
| Preflight | Check readiness and required workflow evidence before agent spend. |
| Control | Enforce budgets, attempts, path boundaries, policy, and stop conditions while the coding agent works. |
| Verify | Run configured checks and bind the evidence to the active run and workspace. |
| Recover | Preserve recovery and rollback state when another attempt or human review is required. |
| Prove | Produce the authoritative VERIFIED, STOPPED, or NEEDS REVIEW handoff plus receipts. |
| Analyze | Inspect run history, cost provenance, failure classes, dossiers, and shareable evidence after execution. |
MartinLoop does not replace Git, GitHub, CI, dedicated security scanners, observability platforms, code review, or the coding agent itself. It gives those workflows one governed execution record to inspect.
Change the worker. Keep the job.
MartinLoop is model-agnostic by design. The job, limits, verification, recovery, and outcome are separate from the worker underneath.
Native coding-agent CLIs and OpenAI-compatible model runtimes use different execution paths, so MartinLoop only describes a worker as fully supported when that execution path has been publicly released and validated.
Why MartinLoop
AI coding agents can create more software than ever. The problem is trusting them with bigger jobs without turning yourself into their full-time manager.
Agents drift. They retry. They break unrelated things. They say "done" too early. And a run that was supposed to save time can create even more work to review.
MartinLoop keeps the job accountable outside the agent itself: clear boundaries, hard limits, configured checks, recovery information, and an explicit outcome.
The goal is simple:
Give the agent more responsibility without giving it unlimited freedom.
Why Teams Adopt MartinLoop
- Less babysitting — give agents larger jobs without watching every step.
- Clear boundaries — keep scope, attempts, and spend inside the limits you set.
- Checks before "done" — configured verification decides whether the evidence passed.
- Understand failures — know why the run stopped instead of digging through logs.
- Recover cleanly — preserve enough evidence to retry, repair, roll back, or hand off.
- One workflow across agents — keep the job consistent as the worker underneath changes.
More software. Less supervision.
See Your Loop Tax
Before changing your workflow, measure it:
npx -y martin-loop@0.9.0 audit
MartinLoop reads Claude Code session history locally and reports how much API-equivalent agent spend happened inside fix-and-retry loops, how often verifier commands failed, the longest retry chain, and sessions that ended red. Session contents stay local. Use --offline to disable even the public pricing lookup, and --share to create a screenshot-ready SVG plus Markdown summary.
Then put limits around the next run:
npx -y martin-loop@0.9.0 enable --engine codex
npx -y martin-loop@0.9.0 run "<task>" --verify "npm test" --budget-usd 2 --max-iterations 3
2-Minute Install Path
If MartinLoop detects more than one supported coding-agent runtime, save the one you want to use before the first governed run. For example:
npx -y martin-loop@latest enable --engine codex
Replace codex with claude or gemini when that is your intended runtime.
npx -y martin-loop@latest start
npx -y martin-loop@latest demo
cd martin-loop-demo
npm install
npx -y martin-loop@latest run "Summarize the demo workspace and prove tests still pass" --verify "npm test" --budget-usd 2 --max-iterations 1
Quick Start
Try MartinLoop in a disposable demo workspace:
npx -y martin-loop@latest enable --engine codex
npx -y martin-loop@latest start
npx -y martin-loop@latest demo
npx -y martin-loop@latest --version
cd martin-loop-demo
npm install
npx -y martin-loop@latest run "Summarize the demo workspace and prove tests still pass" --verify "npm test" --budget-usd 2 --max-iterations 1
npx -y martin-loop@latest dossier --latest
npx -y martin-loop@latest share --latest
Optional global install:
npm install -g martin-loop
martin-loop --version
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. Use --proof only when you intentionally want an explicit no-spend lane.
Inspect-first flow:
npx -y martin-loop@latest enable --engine codex
npx -y martin-loop@latest doctor
npx -y martin-loop@latest session-start
npx -y martin-loop@latest preflight "Summarize the demo workspace and prove tests still pass" --verify "npm test"
share --latest writes three files into the selected run directory under share/: run-receipt.json, run-receipt.md, and proof-card.svg.
Release notes for MartinLoop 0.6.5: MartinLoop 0.6.5.
Release notes for MartinLoop 0.6.6: MartinLoop 0.6.6.
Release notes for MartinLoop 0.6.7: MartinLoop 0.6.7.
Release notes for MartinLoop 0.6.8: MartinLoop 0.6.8.
Release notes for MartinLoop 0.7.0: MartinLoop 0.7.0.
Release notes for MartinLoop 0.7.1: MartinLoop 0.7.1.
Release notes for MartinLoop 0.8.0: MartinLoop 0.8.0.
Release notes for MartinLoop 0.8.1: MartinLoop 0.8.1.
Release notes for MartinLoop 0.8.2: MartinLoop 0.8.2.
Release notes for MartinLoop 0.8.3: MartinLoop 0.8.3.
Release notes for MartinLoop 0.8.4: MartinLoop 0.8.4.
Release notes for MartinLoop 0.8.5: MartinLoop 0.8.5.
Release notes for MartinLoop 0.8.6: MartinLoop 0.8.6.
Release notes for MartinLoop 0.8.7: MartinLoop 0.8.7.
Release notes for MartinLoop 0.8.8: MartinLoop 0.8.8.
Release notes for MartinLoop 0.8.9: MartinLoop 0.8.9.
Release notes for MartinLoop 0.9.0: MartinLoop 0.9.0.
Swarm Mode Demo
Run the deterministic 15-agent launch-board demo without provider calls or spend:
npx -y martin-loop@0.9.0 demo --swarm
That default result is local simulation evidence only: it is non-governed, is not persisted to the Swarm run store, and does not evaluate signed receipt integrity. Inspect simulation output through the demo --swarm human view or demo --swarm --json, plus the local files created under --dir. Do not use swarm status, swarm inspect, swarm dossier, swarm verify, or swarm share for the default simulation output.
To exercise the persisted provider-free governance path, use:
npx -y martin-loop@0.9.0 demo --swarm --governed --agents 15 --max-concurrency 5 --budget-usd 0
An approved live Codex qualification uses the same persisted route with --live, an explicit positive budget, and a clean repository baseline. Persisted modes use --cwd and --runs-dir; they reject the simulation-only --dir and --force flags. Live failures exit nonzero and never fall back to simulation.
Persisted demo runs and runs created by swarm plan plus swarm run are valid inputs to swarm status, swarm inspect, swarm dossier, swarm verify, and swarm share. A stored run is not automatically verified: rely on the verifier and receipt-integrity result, not the command route alone.
Model and Engine Support
MartinLoop governs the job independently of the coding worker.
- Native agent CLIs: Codex, Claude Code, Gemini CLI
- OpenAI-compatible endpoints: Kimi K2, NVIDIA Nemotron, DeepSeek, Qwen/Qwen Coder, Mistral/Codestral, OpenRouter/Together/Fireworks routes, Ollama, LM Studio, llama.cpp, and other compatible endpoints
- Use
--engine openaifor OpenAI-compatible model endpoints.
The worker changes; MartinLoop's budget, scope, verifier, receipt, and integrity contract does not.
More detail: Model and engine support
The Run From Start to Handoff
MartinLoop's terminal presentation is built around the governed lifecycle, not around a single verifier command.
Governed Run Plan shows the configured finish line before work starts, including the task, budget posture, verifier plan, scope, and execution boundaries.
Controlled Run keeps the coding agent working inside those boundaries while MartinLoop tracks attempts, cost, stop conditions, and recovery state.
Verified Handoff closes the loop with one authoritative outcome:
VERIFIEDwhen the configured evidence supports the Definition of DoneSTOPPEDwhen a configured hard boundary ends the runNEEDS REVIEWwhen completion cannot be established from the available evidence
The handoff can include verifier steps, scope state, attempt count, cost provenance, unresolved evidence, recovery state, receipt integrity, and the next safe action. The exact fields depend on what the run actually established.
Visual Proof
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.
MartinLoop Arcade
Long governed runs do not have to mean staring at a spinner. In an interactive terminal, MartinLoop Arcade can be offered while the coding agent continues working in the background.
Arcade is presentation-only. It cannot change the agent, budget, verifier, policy decision, run outcome, or receipt evidence. It stays out of JSON, CI, non-interactive, and other machine-readable execution paths.
Use --arcade to offer Arcade immediately for a supported interactive run, or --no-arcade to suppress it for that run.
Proof Receipts
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:
npx -y martin-loop@latest run "Summarize the demo workspace and prove tests still pass" --proof --verify "npm test"
npx -y martin-loop@latest runs verify --latest
npx -y martin-loop@latest share --latest
Example receipt files: Markdown and JSON.
Verify the Public Release Yourself
Use this lane from a clean temp directory to verify the public CLI flow exactly as shipped:
npx -y martin-loop@0.9.0 enable --engine codex
npx -y martin-loop@0.9.0 --version
npx -y martin-loop@0.9.0 start
npx -y martin-loop@0.9.0 demo
cd martin-loop-demo
npm install
npx -y martin-loop@0.9.0 run "Summarize the demo workspace and prove tests still pass" --verify "npm test" --budget-usd 2 --max-iterations 1 --json
npx -y martin-loop@0.9.0 dossier --latest --json
npx -y martin-loop@0.9.0 share --latest --json
For deterministic installs, pin the package line (martin-loop@0.9.0) or use martin-loop@latest. Plain npx martin-loop can resolve a stale local cache on some machines.
Expected share bundle outputs:
share/run-receipt.jsonshare/run-receipt.mdshare/proof-card.svg
See It In Action
The 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-50
Ralph-Style Loops
A 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:
- stop before budget overspend
- classify unsafe or invalid actions before execution
- write an audit record for every attempt
- preserve rollback and verifier evidence for review
- reduce runaway context growth with compact run summaries
Failure Taxonomy (13 Runtime Classes)
When a coding agent fails, "something went wrong" is not useful enough.
MartinLoop classifies runtime failures into 13 canonical classes so a failed run can tell you what happened, what needs attention, and what future runs can learn from.
See the canonical table: Failure Taxonomy (13 Runtime Classes).
What It Does
- Budget caps stop the next attempt before a configured USD, token, or iteration limit is exceeded.
- Verifier gates require a real check, such as
npm test, before a run can count as complete. - Policy checks block unsafe verifier commands, risky path changes, and secret-like task inputs before execution.
- Failure classification uses canonical runtime classes for triage and reporting. See Failure Taxonomy (13 Runtime Classes).
- Run receipts capture stop reason, verifier evidence, budget posture, integrity state, and the next safe action.
martin share --latestturns the latest governed run into a local share bundle with a redacted JSON receipt, Markdown recap, and proof-card SVG.- MCP integration gives hosts one write-capable execution entrypoint plus richer planning, inspection, and review helpers.
How It Works
| 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, and direct-provider 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. |
Trust Boundaries
- Cost and token outputs always include provenance (
actual,calculated,estimated, orunavailable). - For Codex specifically, MartinLoop reports authoritative usage only when the host exposes it; otherwise MartinLoop labels usage as estimated and avoids presenting it as settled accounting.
- Receipt integrity must be
verifiedbefore a run is treated as trustworthy evidence for external review.
Martin Loop MCP 질문
Martin Loop MCP를 Claude Code에 추가하려면 어떻게 하나요?
터미널에서 claude mcp add martin-loop -- npx -y @martinloop/mcp를 실행합니다. 모든 프로젝트에서 사용할 수 있게 하려면 --scope user를 추가합니다.
Martin Loop MCP를 Cursor에 추가하려면 어떻게 하나요?
~/.cursor/mcp.json를 열고 mcpServers 아래에 서버를 추가합니다. 위 설치 섹션에 표시된 Cursor 구성을 사용합니다.
코딩 에이전트 실행 비용을 어떻게 제한할 수 있나요?
실행 중 --budget-usd 플래그를 사용하여 최대 지출 한도를 설정할 수 있습니다.
MartinLoop가 코딩 에이전트 자체를 대체하나요?
아니요, 코딩 에이전트는 여전히 코드를 작성하며, MartinLoop는 작업에 대한 제어 경로, 제한 및 검증을 제공합니다.
에이전트 재시도 루프에 지출된 비용을 감사할 수 있나요?
네, audit 명령을 실행하여 수정 및 재시도 루프에 사용된 API 상당 지출액을 확인할 수 있습니다.
검증 프로세스가 코드가 버그가 없음을 보장하나요?
아니요, 설정된 verifier는 프로그래밍된 특정 체크 항목만 증명합니다.