Skip to main content
Glama
fc0web
by fc0web

rei-checker-mcp

Comprobador de verificación formal MCP v0.1.0a1 — recibe una línea y devuelve verdadero o falso. Ni más ni menos.

Veredicto de tres valores (VALID / INVALID / UNDECIDED). Sin LLM en la ruta de juicio. Cada UNDECIDED lleva un código de razón y se registra en un libro de refutación de solo anexión.

Licencia: AGPL-3.0-or-later Especificación: CHECKER_SPEC_v0.md Invariantes de diseño: CLAUDE.md

Ponerlo en marcha en 5 minutos

Con Python 3.9+ es suficiente. Sin dependencias externas (solo stdlib).

git clone https://github.com/fc0web/rei-checker-mcp.git
cd rei-checker-mcp
python -m rei_checker verify "1 + 1 = 2"

Salida esperada:

{
  "verdict": "VALID",
  "elapsed_ms": 0,
  "checker_version": "rei-checker-mcp/0.1.0a1+spike-2026-08-22"
}

Las entradas no decidibles devuelven «no se puede decidir» (spec §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"
}

código de salida: 0 = decisivo (VALID/INVALID), 2 = UNDECIDED. En un script de shell se puede ramificar directamente según «se pudo decidir o no».

Related MCP server: Chiasmus

Acumulación del ledger y estadísticas

Toda llamada a verify se anexa como una línea en ledger.jsonl (spec §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 es el único indicador (spec §3). No importa que el valor inicial sea 0.1 — la condición de éxito es llegar a un estado medible.

La ubicación del ledger se puede sobrescribir con la variable de entorno $REI_CHECKER_LEDGER. Por defecto = ledger.jsonl en el directorio actual.

Uso como servidor MCP

Registro en 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"
      }
    }
  }
}

Las herramientas MCP son solo 2 (spec §2, mínimo intencional):

  • verify(expression, context?, timeout_ms?) → { verdict, reason_code?, detail?, elapsed_ms, checker_version }

  • stats() → { total, valid, invalid, undecided, decision_rate, reason_breakdown }

Qué «no está construido» (explícito en spec §2)

Lo siguiente son no objetivos de v0. Si intentas implementarlo, detente y verifica:

  • UI / frontend web

  • Registro de usuarios, autenticación, facturación

  • Gamificación, gestión de progreso, historial de aprendizaje

  • Diálogo en lenguaje natural / generación de explicaciones

  • Soporte de múltiples backends (solo Lean 4; el spike de v0 funciona con el backend Mock)

  • Dependencia de funciones específicas de Claude

Estado de v0 (alcance honesto, spike 2026-08-22)

  • ✅ Esquema (3 valores + 6 códigos de razón) completamente implementado

  • ✅ Backend Mock (tabla de verdad para pruebas + activación de todos los códigos de razón)

  • ✅ Ledger (JSONL de solo anexión, UTF-8, omisión de filas malformadas)

  • ✅ Agregado de stats() (decision_rate + reason_breakdown)

  • ✅ Servidor MCP stdio (initialize + tools/list + tools/call)

  • ✅ CLI (subcomandos verify / stats / mcp / version)

  • ⚠ El backend Lean 4 es un stub (candidato para v0.2, implementación prevista en el directorio lean_backend/)

  • ⚠ La aplicación de timeout es suave (monitoreo de elapsed; el kill duro de procesos es para v0.2)

«Que se use primero» es la prioridad (spec §1.3, §6.6). Una vez completado el harness de Lean 4, basta con sustituir el backend para que funcione la verificación real. La superficie de API no cambia.

Fase 2 (no abordar hasta completar v0)

Estructura de tres capas definida en spec §9-13:

  • Capa 1 checker (verify / stats) ← v0, esto

  • Capa 2 education (locate_first_error / boundary_report / escalate)

  • Capa 3 harness (calibration / regression / transfer)

Orden de implementación: capa 1 → capa 3② harness de calibración → capa 2. Detalles en spec §9-13.

Pruebas

python -m unittest tests.test_all -v

Según spec §7, priorizar las pruebas de los casos que deben devolver UNDECIDED (test individual de cada reason_code + happy path de VALID/INVALID).

Relación con el stack Rei (evitar confusiones)

Este repo es intencionalmente independiente. Distinción de las herramientas adyacentes:

  • rei-verify (PyPI 0.1.0a1) = máquina de refutación con veredicto de 4 valores, eje principal refutation-first. Este repo es verification-first de 3 valores — filosofía de diseño distinta.

  • grounded-check = verificación de grounding de citas en salidas de LLM, otro dominio.

  • rei-preregister = sello SHA256 predictivo, herramienta de preregistro.

  • discovery-worker = cazador de contraejemplos, otra capa.

No hay integración en este momento porque contravendría la spec §5 «soporte de múltiples backends: no objetivo».

Contribución / informes

Cumple los 4 principios de la spec §8:

  1. Si dudas en añadir una función, no la añadas

  2. Si dudas en devolver «probablemente correcto», devuelve UNDECIDED

  3. Si dudas en exponer teoría en la API, no la expongas

  4. Sin prisa, despacio

Issues: https://github.com/fc0web/rei-checker-mcp/issues

Available Tools

2 tools
statsA

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).

NameRequiredDescriptionDefault

No parameters

TDQS

A4.2/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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).

NameRequiredDescriptionDefault
contextNoOptional context (axioms, imports, prior definitions). Backend-defined semantics.
expressionYesThe expression to judge.
timeout_msNoHard timeout in milliseconds. Overrun → UNDECIDED/TIMEOUT. Default: 5000.

TDQS

A3.8/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines3/5

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.

  1. 2 tool updatesv0.1.0
    • First observedstats
    • First observedverify

TDQS

A3.9/5.0

Scored across 2 tools

Disambiguation5/5

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.

Naming Consistency4/5

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.

Tool Count3/5

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.

Completeness4/5

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

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    MCP 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.
    89 npm
    218
    Apache 2.0
  • A
    license
    Not graded
    quality
    B
    maintenance
    A 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
  • A
    license
    Not graded
    quality
    A
    maintenance
    Provides deterministic decision and constraint evaluation for AI agents. Supports ruleset validation, fact evaluation, and constraint checking via MCP tools.
    Apache 2.0