FOR YOUR AGENTLOCAL STDIO / READ-ONLY

Your agent.
A better playbook.

Connect the library to Claude Code or another MCP client. Find a loop, inspect its boundaries, and turn it into a runnable protocol.

Connect the library ↗
01browse_catalog()Know what’s available
02pick_loop_for_goal("speed up CI")A shortlist, with reasons
03render_run_protocol("ci-optimization")Bounded work, clear exit

The server retrieves and prepares. Your agent executes within the boundaries you set.

30 seconds

02

Install for Claude Code

One Python file, standard library only, Python 3.9+. Read-only: no write tools, no auth, no shell execution.

mkdir -p ~/.ai-loop-library
curl -fsSL https://ailooplibrary.com/mcp/server.py -o ~/.ai-loop-library/server.py
claude mcp add ai-loop-library -- python3 ~/.ai-loop-library/server.py

Verify before trusting it: run the offline self-test.

python3 ~/.ai-loop-library/server.py --self-test   # 43 checks, no network

Third-party checks: listed in awesome-mcp-servers under Knowledge & Memory, and graded on Glama for tool definition quality and server coherence. Live Glama quality score for the AI Loop Library MCP server

03

Install for Cursor and other MCP clients

Add to ~/.cursor/mcp.json (or your client's MCP config). Point AI_LOOP_LIBRARY_CATALOG_PATH at a downloaded catalog.json to run fully offline.

{
  "mcpServers": {
    "ai-loop-library": {
      "command": "python3",
      "args": ["/Users/you/.ai-loop-library/server.py"],
      "env": {
        "AI_LOOP_LIBRARY_CATALOG_URL": "https://ailooplibrary.com/catalog.json"
      }
    }
  }
}
04

Use it without MCP

Option one: the Claude Code skill, which prefers MCP tools when connected and falls back to fetching the catalog over HTTPS.

mkdir -p .claude/skills/ai-loop-library
curl -fsSL https://ailooplibrary.com/agent-pack/claude-code/SKILL.md \
  -o .claude/skills/ai-loop-library/SKILL.md

Option two: zero install. The catalog is public JSON; paste this into any tool-using agent.

Fetch https://ailooplibrary.com/catalog.json, pick the loop that fits this goal, and run it
bounded: one change per round, the same verification every round, state in
docs/loops/<id>/, stop on verifier pass / budget / blocker / approval boundary.

Full install guide CLAUDE.md drop-in MCP server on GitHub

05

Tool reference

ToolArgumentsReturns
browse_catalogcategory?~2k-token digest of every loop; the agent judges it directly
search_loopsquery, category?, limit?=8Ranked loops with id, title, category, url, one-line why-matched
get_loopid_or_slugFull loop spec + canonical URL, verifier strength, loop kind
pick_loop_for_goalgoal, constraints?, limit?=5Ranked shortlist + confidence signal; the calling agent makes the final call
render_run_protocolid_or_slug, goal?, risk_posture?, kind?=auto|session|scheduled-tick, max_rounds?, max_minutes?Executable protocol + state-file skeleton + paste-ready prompt
critique_looploop_description0–10 lint against the anti-pattern rubric, with per-check fixes
design_loopgoal, constraints?, cadence?, context?Draft loop spec: verifier suggestion, MVL check, nearest catalog loops
list_categories—Category counts with library filter URLs
catalog_stats—Loop count, featured loops, last_updated, catalog source

Resources: ailooplibrary://catalog and ailooplibrary://loop/{id}. Full server docs at /mcp/README.md.

Demo

06

What picking looks like

Ask for an outcome, get a loop with reasons, then render it and go.

> pick_loop_for_goal("speed up CI")

{
  "goal": "speed up CI",
  "confidence": "high",
  "confidence_note": "top match covers most goal terms and leads clearly",
  "shortlist": [
    {
      "id": "ci-optimization",
      "title": "CI Optimization",
      "category": "Engineering",
      "url": "https://ailooplibrary.com/loops/ci-optimization/",
      "verifier_type": "deterministic-leaning",
      "why_matched": "title matches ci; tags matches ci; use when matches ci"
    },
    {
      "id": "test-flake-stabilizer",
      "title": "Test Flake Stabilizer",
      "verifier_type": "deterministic-leaning",
      "why_matched": "tags matches ci; goal terms (ci, speed) map to the Engineering category"
    }
  ],
  "your_call": "A ranked shortlist, not a verdict. You have operator context this server lacks; pick accordingly, or pick none."
}

The heuristic is documented in the server source and labels itself in every response; a 20-query golden eval holds it to a ≥85% top-3 hit rate. The calling agent always makes the final call.

07

What's in the library

68bounded loop patterns
10categories
21engineering loops
7Paul originals

Every loop ships with a trigger, objective, allowed actions, verification, stop condition, budget, and approval boundary: the seven parts that keep an agent from spending your tokens looking busy.

Browse the library Loop linter Loop template Loop engineering

Explore the protocolsTry the design rubric