Detect hallucinations
before they ship
MCP server for Claude Code and Codex. Uses KL divergence to measure if citations actually support claims.
Two MCP Tools
Choose the right tool for your use case.
detect_hallucination
Quick, automatic verification
- Auto-splits text into claims
- Extracts citations automatically
- Fast and convenient
result = detect_hallucination(
answer="TLS 1.3 is enabled [S0]",
spans=[{"sid": "S0", "text": "..."}]
)audit_trace_budget
Lower-level, precise control
- You provide atomic claims
- Explicit cite IDs
- More reliable results
result = audit_trace_budget(
steps=[{idx: 0, claim: "...",
cites: ["S0"], confidence: 0.95}],
spans=[{"sid": "S0", "text": "..."}]
)Works where you work
Seamless integration with Claude Code, Codex, or your Python scripts.
# Register the MCP server with Claude Code
claude mcp add hallucination-detector \
-e OPENAI_API_KEY=$OPENAI_API_KEY -- \
python -m strawberry.mcp_server
# Then in any conversation, just ask:
# "Check my last response for hallucinations"Pre-built Codex Skills
Ready-to-use AI agents with hallucination gating built in.
Evidence-first debugging: reproduce ā evidence ā hypotheses ā Strawberry-verified ROOT_CAUSE ā plan ā execute
$rca-fix-agent
Plan-driven proof repair/synthesis for LaTeX + formal backstop (Lean/Coq)
$proof-repair-agent
Focused, anti-repeat brute-force loop for stuck proof gaps with Attempt Ledger
$proof-attack-agent
Evidence-first hierarchical planning with local forensics + web lookup
$planning-agent
Strawberry-gated plan execution: accepts steps only when success is provably true
$execution-agent
@$hallucination-detector or @$rca-fix-agentMath, not magic
Information-theoretic verification using KL divergence to measure evidence support.
Get started in 60 seconds
Install the package and register the MCP server.
$ pip install pythea