AI Loop Library MCP

AI Loop Library MCP

Provides coding agents with 63+ bounded, verifiable work loops, enabling goal-driven loop selection and executable protocol generation via MCP tools.

Category
访问服务器

README

AI Loop Library MCP server

A read-only MCP server that gives coding agents the AI Loop Library: 63+ bounded, verifiable work loops with a trigger, one-change-per-round discipline, a verification check, durable state, a stop condition, a budget, and human approval gates.

The design premise: the calling agent is the best ranker available — it knows the operator's repo, data, and constraints, and this server doesn't. So the tools hand the agent clean, compact evidence instead of pretending to judge for it: browse_catalog returns the whole library as a ~2k-token digest to judge from, pick_loop_for_goal returns an honest lexically-ranked shortlist with a confidence signal (never a single blind verdict), and render_run_protocol turns the chosen loop into an executable markdown protocol with a state-file skeleton, stop conditions, and a paste-ready prompt. critique_loop lints any loop design against the anti-pattern rubric, and design_loop scaffolds a new spec when nothing in the catalog fits.

Single file, Python 3.9+ standard library only. No dependencies, no auth, no write tools.

Install

From a clone of this repo:

python3 server.py --self-test   # verify: 43 offline checks
python3 server.py --eval        # 20 golden ranking queries vs the live catalog

Or grab the single file straight from the live site:

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

Claude Code

claude mcp add ai-loop-library -- python3 ~/.ai-loop-library/server.py

Cursor / generic MCP client

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

Optional: pip install

pip install -e .             # installs the ai-loop-library-mcp console script
claude mcp add ai-loop-library -- ai-loop-library-mcp

Catalog source

Resolution order:

  1. AI_LOOP_LIBRARY_CATALOG_PATH — local JSON file (catalog.json or data/loops.json shape)
  2. AI_LOOP_LIBRARY_CATALOG_URL — defaults to https://ailooplibrary.com/catalog.json
  3. Repo-local fallback (../catalog.json, ../data/loops.json) when the server runs inside the site repo; otherwise an embedded 2-loop sample keeps --self-test fully offline

Fetched catalogs are cached in memory for 5 minutes.

Tools

Tool What it does
browse_catalog(category?) The whole catalog as a ~2k-token digest (id, category, use_when, verifier strength) — one call, then the agent judges against operator context
search_loops(query, category?, limit?) Ranked loops with a one-line why-matched
get_loop(id_or_slug) Full loop spec + canonical URL, with verifier strength and loop kind
pick_loop_for_goal(goal, constraints?, limit?) Lexically ranked shortlist (5 by default) with use_when, verification, and an honest confidence signal — the agent makes the final call
render_run_protocol(id_or_slug, goal?, risk_posture?, kind?, max_rounds?, max_minutes?) Executable markdown protocol: done contract, one-change-per-round, verification, state files, stop conditions, budget, risk-colored approval boundary, proof format. Scheduled-tick business loops (SEO, ads, product metrics) get experiment logs, undo-losers discipline, and notify-the-human ticks
critique_loop(loop_description) Deterministic lint against the anti-pattern rubric (verifier, stop condition, budget, one-change-per-round, state, MVL, risk gates…) — 0–10 score with per-check fixes
design_loop(goal, constraints?, cadence?, context?) Scaffold a new loop spec from a stated bottleneck, with a domain-matched verifier suggestion and the nearest catalog loops
list_categories() Category counts with library filter URLs
catalog_stats() Loop count, featured loops, last_updated, catalog source

All tools declare readOnlyHint. Resources: ailooplibrary://catalog and ailooplibrary://loop/{id}.

Ranking is a transparent lexical heuristic — IDF-weighted keyword overlap (computed from the catalog at load, so template boilerplate scores near zero) with light stemming, a small documented synonym/expansion map, damped brand tokens, and a goal-term-to-category map. It is documented in server.py (_score_loop, SYNONYMS_RAW, CATEGORY_HINTS) and labeled as such in tool output. --eval holds it to 20 golden queries at a ≥85% top-3 hit rate. No model, no magic — and when confidence is low, the output says so.

Design constraints

  • Read-only. No write tools, no shell execution of user code, no posting, no auth, no PII.
  • stdio transport only (newline-delimited JSON-RPC 2.0, MCP protocol 2024-11-05 through 2025-06-18).
  • Errors from tools return isError: true with a plain-text explanation, never a crash.

Related

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选