Skip to main content
Glama

groundcheck

Playwright verifies your UI. Sentry verifies your runtime. groundcheck verifies your AI's answers.

An MCP server that lets any AI agent evaluate RAG outputs -- faithfulness scoring, hallucination detection, and retrieval quality metrics -- with zero API keys, using MCP sampling so the judge model is whatever the connected client is already running.

The problem

You've vibe-coded a RAG app. It answers, but sometimes it makes stuff up, and you can't tell when. There's no test for "did the model lie about what the documents say." groundcheck is that test.

Related MCP server: multivon-mcp

Demo

groundcheck demo

Eval dashboard

groundcheck dashboard

groundcheck-dashboard --out docs/dashboard.html generates a single self-contained HTML file from your report store -- summary cards, a faithfulness-by-report chart, a sortable per-case table, and worst-5-cases, all with Chart.js loaded from a CDN and the data embedded inline. Opens straight from disk, no server required.

docs/dashboard.html in this repo is generated from a real report: knowledge-assistant's 18-query eval (see its Evaluation section, cross-linked above) -- not synthetic smoke-test numbers. Enable GitHub Pages on this repo to get a live, clickable link instead of a clone-and-open file (see Roadmap).

Quickstart

Claude Code:

claude mcp add groundcheck -- uvx groundcheck

Claude Desktop -- add to claude_desktop_config.json (full example):

{ "mcpServers": { "groundcheck": { "command": "uvx", "args": ["groundcheck"] } } }

Cursor -- same shape, in .cursor/mcp.json (see examples/claude_code.md for the full config).

No API key needed if your client supports MCP sampling. Try it: ask your agent to run groundcheck_detect_hallucinations on an answer and its sources.

Tools

Tool

What it does

Judge?

groundcheck_evaluate_faithfulness

Claim-by-claim faithfulness score (0-1) against sources

LLM (sampling)

groundcheck_detect_hallucinations

Only the unsupported/contradicted claims, for a fix-it loop

LLM (sampling)

groundcheck_evaluate_retrieval

precision@k, recall@k, MRR, NDCG -- gold labels (instant) or LLM-graded

Optional

groundcheck_compare

Judge which of two candidate answers is better, with position-bias mitigation

LLM (sampling)

groundcheck_run_suite

Batch-evaluate a set of cases (inline or JSONL), persist a report

LLM (sampling)

groundcheck_get_report

Fetch a persisted report by id

None

How it works

flowchart LR
    subgraph Client["Your MCP client (Claude Desktop / Code / Cursor)"]
        Model[("Your LLM")]
    end

    Client -- "tool call" --> Server["groundcheck MCP server"]

    subgraph Server["groundcheck"]
        Det["Deterministic tools\nmetrics.py -- pure Python\nprecision@k, recall@k, MRR, NDCG"]
        Judged["LLM-judged tools\nclaim decomposition + verification"]
    end

    Judged -- "sampling/createMessage" --> Model
    Model -- "judged verdicts" --> Judged

    Server -- "result" --> Client

The split matters: retrieval metrics with gold labels are pure math and run instantly with zero model calls. Faithfulness, hallucination detection, and compare need semantic judgment, so they call back into your own connected model via MCP sampling -- no separate API key, no separate bill. If your client doesn't support sampling yet, set ANTHROPIC_API_KEY as a fallback; if neither is available, you get a clear error naming both options.

Cost: deterministic metrics are free (no model calls). LLM-judged tools cost 1-2 model calls via your client's existing inference -- no API key required on top of what you're already paying your client for.

What groundcheck is NOT

  • Not an observability platform. It doesn't collect traces, dashboards, or alerts over time -- it scores the RAG output you hand it, once, when you ask. For production observability, look at LangSmith or Arize Phoenix.

  • Not for agent-trajectory evals. It judges answers against sources, not whether an agent took the right sequence of actions.

  • Not enterprise-scale. Reports are local JSON files. If you need multi-tenant dashboards, RBAC, or dataset versioning at scale, LangSmith or Phoenix are the right tool.

Case studies

  • evals/RESULTS.md tracks tool-selection and hallucination-detection accuracy before and after tuning tool docstrings -- the actual before/after numbers, not just the final descriptions.

  • Real RAG app: knowledge-assistant (a multi-tenant document Q&A app) uses groundcheck to score its own real pipeline output -- 18 real queries against a real document, 85% mean faithfulness, 94% mean NDCG@5. The interesting finding wasn't a perfect score: the app never hallucinated a fact, but groundcheck's strict literal-support judge flagged several accurate paraphrases as "unsupported" -- a useful data point about judge strictness, not just app quality. Full breakdown in its README Evaluation section.

Security

Read-only, compute-only server: no shell access, no network egress except an opt-in ANTHROPIC_API_KEY fallback, no filesystem writes outside the local report store. dataset_path is validated against an allowlisted directory to prevent path traversal. Full threat model in SECURITY.md.

Roadmap

  • MCP Tasks primitive for async run_suite on large datasets.

  • MCP Apps report UI (render a report inline instead of raw JSON).

  • Publish to PyPI and the MCP Registry (packaging is ready; not yet published).

  • Live FastAPI dashboard (v2) -- groundcheck-dashboard's static HTML file is the v1 by design (zero deployment burden); a running app with live updates is a reasonable next step once there's a reason to keep one up.

  • Enable GitHub Pages for docs/dashboard.html so there's a live, clickable "see eval results" link with no clone required.

Development

uv sync --all-extras
uv run pytest
uv run ruff check .

MIT licensed. See LICENSE.

Available Tools

6 tools
groundcheck_compareA
Read-only

Judge which of two candidate answers to query is better.

Use this to A/B two RAG configurations (prompts, retrievers, models) on
the same query. Position bias is mitigated automatically: the judge sees
(A,B) and (B,A) in separate calls, and any criterion whose verdict flips
with presentation order is reported as a tie rather than a pick.

Args:
    query: the shared query both answers respond to.
    answer_a: first candidate answer.
    answer_b: second candidate answer.
    sources: optional list of {id, text} chunks, used to judge faithfulness.
    criteria: judged criteria (default ["faithfulness", "completeness", "relevance"]).

Returns a winner ("a"/"b"/"tie/uncertain"), a verdict per criterion, and a
brief rationale. Costs 2 model calls via your client's sampling -- no API
key needed if your client supports sampling.

Inputs: query (required), answer_a (required), answer_b (required), sources, +1 more. Returns: winner, criteria, rationale

groundcheck_detect_hallucinationsA
Read-only

Find only the unsupported or contradicted claims in answer.

Use this in a fix-it loop where you only care about what's wrong, not a
full faithfulness report -- for the full picture with a score and every
claim's verdict, use groundcheck_evaluate_faithfulness instead.

Args:
    answer: the RAG-generated answer text to check.
    sources: list of {id, text} chunks the answer was generated from.

Returns an empty list if the answer is clean. Otherwise, each entry has
the exact answer span, the closest source passage that fails to support
it, and a one-line reason. Costs 2 model calls via your client's
sampling -- no API key needed if your client supports sampling.

Inputs: answer (required), sources (required). Returns: hallucinations

groundcheck_evaluate_faithfulnessA
Read-only

Score how well answer is supported by sources, claim by claim.

Use this when you need a faithfulness score (0-1) and want to see every
claim's verdict, not just the problems -- for that, use
groundcheck_detect_hallucinations instead, which is tighter and cheaper.

Args:
    answer: the RAG-generated answer text to check.
    sources: list of {id, text} chunks the answer was generated from,
        e.g. [{"id": "doc1#chunk3", "text": "..."}].
    response_format: "concise" (default) returns the score, claim counts,
        and only unsupported/contradicted claims. "detailed" returns
        every claim's verdict.

Returns a score (supported/total claims), counts by verdict, and a claims
list (filtered per response_format). Costs 2 model calls via your client's
sampling (decompose, then verify) -- no API key needed if your client
supports sampling.

Inputs: answer (required), sources (required), response_format. Returns: score, claims, supported, unsupported, +2 more

groundcheck_evaluate_retrievalA
Read-only

Score retrieval quality for retrieved chunks against query.

Two modes, chosen automatically:
- Mode A (pass `relevant_ids`): precision@k, recall@k, MRR, NDCG computed
  by pure math from your gold relevance labels. Instant, no model calls.
- Mode B (omit `relevant_ids`): no gold labels available, so each chunk
  is graded 0-3 for relevance via one sampling call, then the same
  metrics are computed from those grades. Use this when you don't have
  a labeled relevant-docs set for this query.

Args:
    query: the search query the chunks were retrieved for.
    retrieved: ranked list of {id, text} chunks, in retrieval order (rank matters).
    relevant_ids: ids of chunks known to be relevant. Supply this whenever
        you have gold labels -- Mode A is free and exact.
    k_values: cutoffs to compute metrics at (default [3, 5, 10]).

Output states which mode ran. Mode A: instant. Mode B: 1 model call, no
API key needed if your client supports sampling.

Inputs: query (required), retrieved (required), k_values, relevant_ids. Returns: mrr, mode, ndcg, metrics, +1 more

groundcheck_get_reportA
Read-only

Fetch a previously persisted evaluation report by id.

Args:
    report_id: the id returned by groundcheck_run_suite.
    response_format: "concise" returns just the summary (scores,
        aggregates, worst cases). "detailed" returns every case's full
        faithfulness and retrieval results.

Raises an error listing available report ids if `report_id` is unknown.
No model calls -- reads from the local report store.

Inputs: report_id (required), response_format. Returns: cases, summary, report_id, created_at, +1 more

groundcheck_run_suiteA
Read-only

Run faithfulness (+ retrieval, where gold labels exist) over a batch of cases.

Use this to evaluate a whole RAG pipeline run rather than one answer at a
time. Supply exactly one of `cases` or `dataset_path`.

Args:
    cases: inline list of {id, query, answer, sources, relevant_ids?}.
    dataset_path: path to a JSONL file of the same case objects, one per
        line. Must resolve inside the allowlisted data directory (env
        GROUNDCHECK_DATA_DIR, default cwd) -- paths outside it are rejected.
    k_values: retrieval cutoffs (default [3, 5, 10]).

Persists a full report and returns a summary (mean faithfulness, mean
NDCG, worst 5 cases, report_id). Fetch the full report with
groundcheck_get_report(report_id). Cost scales with case count: ~2 model
calls per case via your client's sampling.

Inputs: cases, k_values, dataset_path. Returns: mean_ndcg, report_id, case_count, worst_cases, +1 more

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.5/5.0

    Scored across 6 tools

    Disambiguation4/5

    The tools are mostly distinct, covering comparison, hallucination detection, faithfulness evaluation, retrieval evaluation, batch runs, and report retrieval. However, there is overlap between groundcheck_detect_hallucinations and groundcheck_evaluate_faithfulness as both deal with unsupported claims, though descriptions differentiate by use case.

    Naming Consistency5/5

    All tools follow a consistent pattern: 'groundcheck_' prefix followed by an imperative verb and noun (e.g., compare, detect_hallucinations, evaluate_faithfulness, get_report). Snake_case and verb-noun structure are uniform across the set.

    Tool Count5/5

    Six tools is well-scoped for a server focused on RAG evaluation. Each tool has a clear role without redundancy, and the count is appropriate for the domain.

    Completeness4/5

    The tools cover the main evaluation needs: comparing answers, detecting hallucinations, scoring faithfulness, evaluating retrieval, batch execution, and report retrieval. Minor gaps exist, such as no dedicated tool for answer relevance beyond the compare function, but the surface is largely complete.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      MCP-native agent evaluation and observability server. Log traces, evaluate output quality with 12 built-in rules (PII detection, prompt injection, cost thresholds), and track agent costs. Real-time dashboard, OTel-compatible spans. Self-hosted, MIT licensed.
      12
      142 npm
      10
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that exposes RAG retrieval evaluation as agent tools, allowing agents to retrieve passages and measure retrieval quality across multiple strategies.
      3
      MIT