loop-verify

loop-verify

An MCP server that performs independent verification of artifacts against criteria using a different AI model lineage (codex, OpenAI, or Gemini) to catch defects that same-family checks might miss.

Category
访问服务器

README

loop-verify

Have a different AI grade the work your AI just did.

loop-verify is an independent checker for the self-verification loop — the part the loop-kit loop honestly admits it cannot do.

When an AI checks its own work, it shares its own blind spots. Free loop-kit checks Claude's work with Claude (same family → the same misses slip through). loop-verify hands the grading to a different model lineage (codex / GPT / Gemini), so defects the self-check waves through get caught. The verdict format is identical to loop-kit's validator, so it's a drop-in replacement for the same-family check.

Open source (MIT). Just a tool — no accounts, no metering, no billing.

What it does

  • In: your frozen YES/NO acceptance criteria + the artifact to inspect (a diff or file contents).
  • Out: a verdict — PASS/FAIL, each criterion OK/NG, any defects outside the criteria, and concrete fix_instructions. (Same contract as loop-kit's validator.)
  • The point: the grader is a different model family from whoever wrote the work, so it doesn't share their blind spots. That independence is the whole value — and it's measurable (see the edge bench).

Three ways to use it: as an MCP server, as a Python function, or via the edge bench.

Install

python3 -m venv ~/.venvs/loop-verify
~/.venvs/loop-verify/bin/pip install -r requirements.txt

Demo (one command, runs anywhere)

python demo/run_demo.py                  # deterministic, offline (mock backend)
python demo/run_demo.py --backend codex  # the REAL edge (costs codex quota)

Exit code 0 iff the demo's invariants held, so it doubles as a smoke test. With --backend codex it shows the independent checker catching planted defects a naive same-family check misses.

Run as an MCP server

# local (stdio), codex backend:
LOOP_VERIFY_BACKEND=codex ~/.venvs/loop-verify/bin/python -m loop_verify.server

# HTTP transport (binds 127.0.0.1:8000 by default; localhost-only Host check):
LOOP_VERIFY_BACKEND=codex ~/.venvs/loop-verify/bin/python -m loop_verify.server --transport http

# ...to serve other hosts, bind all interfaces and allow their Host header:
LOOP_VERIFY_HOST=0.0.0.0 LOOP_VERIFY_PORT=8000 LOOP_VERIFY_ALLOWED_HOSTS=myhost:8000 \
LOOP_VERIFY_BACKEND=codex ~/.venvs/loop-verify/bin/python -m loop_verify.server --transport http
# (LOOP_VERIFY_ALLOWED_HOSTS="*" disables the Host check; binding 0.0.0.0 alone also
#  opens it. Host/port are read at startup — set them via env, not flags.)

# OpenAI backend (needs OPENAI_API_KEY + `pip install openai`):
OPENAI_API_KEY=... LOOP_VERIFY_BACKEND=openai \
  ~/.venvs/loop-verify/bin/python -m loop_verify.server

# Gemini backend (needs GEMINI_API_KEY + `pip install google-genai`):
GEMINI_API_KEY=... LOOP_VERIFY_BACKEND=gemini \
  ~/.venvs/loop-verify/bin/python -m loop_verify.server

Tools: independent_verify(criteria, artifact) and info(). Backend selected by LOOP_VERIFY_BACKEND (codex default | openai | gemini | mock). For http, bind with LOOP_VERIFY_HOST / LOOP_VERIFY_PORT (read at startup).

Verify the http transport is reachable end to end (boots a server, runs a real MCP client round-trip, no key needed):

python demo/http_smoke.py

Deploy (Docker)

The codex backend needs the codex CLI (not in the image), so a container uses a key-based backend:

docker build -t loop-verify .
docker run --rm -p 8000:8000 \
  -e LOOP_VERIFY_BACKEND=openai -e OPENAI_API_KEY=sk-... \
  loop-verify
# MCP endpoint: http://localhost:8000/mcp

The image binds 0.0.0.0, so FastMCP's DNS-rebinding Host check is off by default (the container accepts any Host header). To restrict it, add -e LOOP_VERIFY_ALLOWED_HOSTS=myhost:8000.

Use it from Python

from loop_verify.service import run_independent_verify

result = run_independent_verify(criteria, artifact, backend="codex")
# -> {"verdict": "PASS"|"FAIL", "passed": bool, "criteria": [...],
#     "defects_outside": [...], "fix_instructions": str, "checker": ..., "lineage": ...}

Does independence actually help? (the edge bench)

python bench/edge_bench.py --backend codex   # independent checker -> GO/NO-GO
python bench/edge_bench.py --backend mock     # naive/blind baseline -> typically NO-GO

The gap between an independent checker (catches planted defects) and a naive one (misses them) is the whole reason to use this. Exit code = the edge verdict, so it can gate CI.

Measured on the bundled 9 fixtures (4 clean / 5 buggy, diverse bug classes): the codex backend scored recall 1.0, false-positive 0.0 → GO (every real bug flagged, every clean artifact passed), while the naive same-family baseline misses them → NO-GO.

Honest limits

  • codex backend cost: the codex backend runs on the operator's personal ChatGPT Plus quota — fine for personal/local use, not for serving many users. Use the OpenAI backend with your own key for that.
  • Independent ≠ ground truth: a different lineage reduces shared blind spots; it does not eliminate error.
  • The edge is the point: if the bench ever shows the independent checker ≈ a naive one, there is no reason to use it — that is a NO-GO, reported honestly, not buried.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选