rei-checker
rei-checker-mcp
Формальный верификационный чекер MCP v0.1.0a1 — принимает одну строку, возвращает истину или ложь. Не больше и не меньше.
Трёхзначный вердикт (VALID / INVALID / UNDECIDED). Никакой LLM в пути принятия решения. Каждый UNDECIDED сопровождается кодом причины и попадает в журнал опровержений, доступный только для добавления.
Лицензия: AGPL-3.0-or-later Спецификация: CHECKER_SPEC_v0.md Инварианты дизайна: CLAUDE.md
Запуск за 5 минут
Достаточно Python 3.9+. Внешних зависимостей нет (только stdlib).
git clone https://github.com/fc0web/rei-checker-mcp.git
cd rei-checker-mcp
python -m rei_checker verify "1 + 1 = 2"Ожидаемый вывод:
{
"verdict": "VALID",
"elapsed_ms": 0,
"checker_version": "rei-checker-mcp/0.1.0a1+spike-2026-08-22"
}Для неразрешимого ввода возвращается «не могу определить» (спец. §1.2):
python -m rei_checker verify "some unknown thing"{
"verdict": "UNDECIDED",
"elapsed_ms": 0,
"checker_version": "rei-checker-mcp/0.1.0a1+spike-2026-08-22",
"reason_code": "OUT_OF_SCOPE",
"detail": "MockBackend has no rule for this expression"
}код выхода: 0 = определённый (VALID/INVALID), 2 = UNDECIDED. В shell-скрипте можно напрямую ветвиться по условию «удалось ли определить».
Related MCP server: Chiasmus
Накопление журнала и статистика
Каждый вызов verify дописывается одной строкой в ledger.jsonl (спец. §4).
python -m rei_checker verify "1 + 1 = 2"
python -m rei_checker verify "1 + 1 = 3"
python -m rei_checker verify "<axiom-test>"
python -m rei_checker stats{
"total": 3,
"valid": 1,
"invalid": 1,
"undecided": 1,
"decision_rate": 0.6666666666666666,
"reason_breakdown": {
"MISSING_AXIOM": 1
}
}decision_rate — единственный показатель (спец. §3). Даже если начальное значение 0.1 — неважно, условие успеха — перейти в состояние, которое можно измерять.
Расположение журнала можно переопределить через переменную окружения $REI_CHECKER_LEDGER. По умолчанию — ledger.jsonl в текущем каталоге.
Использование в качестве MCP-сервера
Регистрация в Claude Desktop:
{
"mcpServers": {
"rei-checker": {
"command": "python",
"args": ["-m", "rei_checker", "mcp"],
"cwd": "C:/path/to/rei-checker-mcp",
"env": {
"REI_CHECKER_LEDGER": "C:/path/to/ledger.jsonl"
}
}
}
}MCP-инструментов ровно два (спец. §2, намеренный минимум):
verify(expression, context?, timeout_ms?)→{ verdict, reason_code?, detail?, elapsed_ms, checker_version }stats()→{ total, valid, invalid, undecided, decision_rate, reason_breakdown }
Что «не создано» (явно указано в спец. §2)
Ниже — не-цели v0. Если захотите реализовать — остановитесь и уточните:
UI / веб-фронтенд
Регистрация пользователей, аутентификация, биллинг
Геймификация, управление прогрессом, история обучения
Диалог на естественном языке, генерация пояснений
Поддержка нескольких бэкендов (только Lean 4, v0 spike работает на Mock backend)
Зависимость от функций, специфичных для Claude
Состояние v0 (честный объём, spike от 2026-08-22)
✅ Схема (3 значения + 6 кодов причин) полностью реализована
✅ Mock backend (таблица истинности для тестов + триггеры всех кодов причин)
✅ Журнал (append-only JSONL, UTF-8, пропуск повреждённых строк)
✅ Агрегация stats() (decision_rate + reason_breakdown)
✅ MCP stdio server (initialize + tools/list + tools/call)
✅ CLI (подкоманды verify / stats / mcp / version)
⚠ Бэкенд Lean 4 — заглушка (кандидат на v0.2, планируется реализация в lean_backend/)
⚠ Принудительный таймаут — мягкий (мониторинг elapsed, жёсткое завершение процесса — в v0.2)
Приоритет — «чтобы начали использовать» (спец. §1.3, §6.6). После завершения harness для Lean 4 замена бэкенда запустит реальную проверку. API-поверхность не изменится.
Phase 2 (не начинать до завершения v0)
Трёхуровневая структура, определённая в спец. §9-13:
Уровень 1: checker (verify / stats) ← v0, это
Уровень 2: education (locate_first_error / boundary_report / escalate)
Уровень 3: harness (calibration / regression / transfer)
Порядок реализации: уровень 1 → уровень 3② calibration harness → уровень 2. Подробности в спец. §9-13.
Тестирование
python -m unittest tests.test_all -vСогласно спец. §7, приоритет — тесты случаев, которые должны возвращать UNDECIDED (отдельный тест для каждого reason_code + happy path для VALID/INVALID).
Отношение к стеку Rei (во избежание путаницы)
Этот репозиторий намеренно независим. Отличия от смежных инструментов:
rei-verify (PyPI 0.1.0a1) = машина опровержения, 4-значный вердикт, основная ось — опровержение-вперёд. Этот репозиторий — 3-значный verification-first, философия дизайна иная.
grounded-check = проверка цитирования/обоснованности выходных данных LLM, другая область.
rei-preregister = предварительная регистрация с SHA256-печатью, инструмент предварительной регистрации.
discovery-worker = охотник за контрпримерами, другой уровень.
Интеграции на данный момент нет, так как это противоречит спец. §5 «поддержка нескольких бэкендов — не-цель».
Вклад / сообщения об ошибках
Пожалуйста, соблюдайте 4 принципа из спец. §8:
Если сомневаетесь, добавлять ли функцию, — не добавляйте
Если сомневаетесь, возвращать ли «возможно, верно», — возвращайте UNDECIDED
Если сомневаетесь, выносить ли теорию в API, — не выносите
Не спешите, двигайтесь медленно
Available Tools
2 toolsstatsA
Return aggregate stats from the refutation ledger. Includes decision_rate = (VALID + INVALID) / total, the sole metric of project success (spec §3), plus reason_breakdown that drives what the next sprint implements (spec §4).
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations, so description carries burden. It clearly states this is a read-style 'Return' operation with no side effects implied meetabst, and it specifies what data is included (decision_rate and reason_breakdown). It doesn't explicitly state it's non-destructive or need auth, but the context implies a read-only stats query. No contradictions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with the purpose and two key outputs. Efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema, so description explains the two things returnedches. It references spec sections, which is helpful. It's sufficient for the tool's simple scope, though it doesn't detail the exact breakdown structure. Minor gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters exist threre, so this dimension is trivially satisfied. The description explains what the output contains (decision_rate, reason_breakdown) which helps the agent understand what the tool will produce, but doesn't add parameter meaning since there are none.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clear verb+resource: 'Return aggregate stats', specifies two concrete outputs (decision_rate and reason_breakdown) with explicit formulas, and references project specs. It distinguishes from the sole sibling 'verify' by being stats-focused, not per-item verification.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Justifies use by linking decision_rate to 'sole metric of project success' and reason_breakdown to 'drives what the next sprint implements,' giving clear contexts for calling. It doesn't explicitly say when not to use or contrast with the sibling 'verify', but the purpose is specific enough that an agent can decide.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
verifyA
Verify one expression. Returns a three-valued verdict (VALID / INVALID / UNDECIDED) with a reason_code when UNDECIDED. No LLM anywhere on the judgment path (spec §1.1). The expression is normalized and recorded in the append-only refutation ledger (spec §4).
| Name | Required | Description | Default |
|---|---|---|---|
| context | No | Optional context (axioms, imports, prior definitions). Backend-defined semantics. | |
| expression | Yes | The expression to judge. | |
| timeout_ms | No | Hard timeout in milliseconds. Overrun → UNDECIDED/TIMEOUT. Default: 5000. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden. It discloses the three-valued return, conditional reason_code, the no-LLM guarantee, and the side effect of recording in an append-only refutation ledger. This is strong transparency, though it omits details like idempotency or error behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three dense sentences with no filler. The verdict behavior is front-loaded, and the side-effect and no-LLM guarantees are stated efficiently. Every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
There is no output schema, but the description adequately explains return values and side effects. The input schema covers parameters. The only notable gap is the lack of explicit routing guidance relative to the sibling tool, but the core information needed to call and interpret the tool is present.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all three parameters. The description adds the fact that the expression is normalized, but it does not provide additional parameter-level guidance beyond what the schema already states.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific action ('Verify one expression') and clearly defines the output (VALID / INVALID / UNDECIDED with reason_code). It is easily distinguishable from the sibling 'stats' tool, though it does not explicitly name or contrast that sibling.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies this tool is for judging a single expression, but it gives no explicit guidance on when to choose it over 'stats' or any other alternative. There are no stated exclusions or conditions, leaving the usage context to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v0.1.0- First observed
stats - First observed
verify
TDQS
Scored across 2 tools
stats and verify are completely distinct: one provides aggregate metrics, the other checks individual expressions. There is no overlap in purpose, so an agent can easily select the correct tool.
Both tool names are short, lowercase single words. While stats is a noun and verify is a verb, the naming style is consistent and clear, with no mixed conventions or confusing patterns.
With only 2 tools, the server feels slightly thin, but the domain appears narrow (validation and ledger statistics). The count is borderline below the typical 3-15 range but not extreme enough to be a major issue.
The tools cover the core functions: verifying expressions and retrieving statistics. Missing operations like listing ledger entries or resetting data are not obvious gaps given the stated purpose, though a 'list' or 'detail' tool could be useful.
Maintenance
Related MCP Connectors
Governed data discovery, exact queries, decisions, simulations, and runtime utilities over MCP.
Free MCP tools: the only MCP linter, health checks, cost estimation, and trust evaluation.
Physics-based validation of simulation results: receipts with per-check verdicts, via MCP.
A paid remote MCP for hosted MCP server, built to return verdicts, receipts, usage logs, and audit-r
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server that gives small LLMs verified symbolic-math & logic tools.62Apache 2.0
- AlicenseNot gradedqualityAmaintenanceMCP server that gives LLMs access to formal verification via Z3 and SWI-Prolog, plus tree-sitter-based source code analysis. Translates natural language problems into formal logic using a template-based pipeline, verifies results with mathematical certainty, and analyzes call graphs for reachability, dead code, and impact analysis.608 npm216Apache 2.0
- AlicenseNot gradedqualityBmaintenanceA verification infrastructure and MCP server that specializes in refutation (negation) rather than generation, providing tools for counterexample search, Lean verification, and audit chains with a 4-value verdict system.MIT
- AlicenseNot gradedqualityAmaintenanceProvides deterministic decision and constraint evaluation for AI agents. Supports ruleset validation, fact evaluation, and constraint checking via MCP tools.Apache 2.0