
Evalsmith Mcp
io.github.diegoperezg7Published by GitHub account diegoperezg7v0.1.0Updated Oct 29, 2026
Evaluate RAG retrieval, agent tool calls and prompt regressions with deterministic metrics.
Overview
Local MCP server that scores RAG retrieval, agent tool calls and prompt regressions with deterministic metrics and reports.
- What you can do
- Score retrieval runs against qrels: recall, precision, nDCG, hit rate and MRR at each cut-off
- Rank two or three configurations with seeded paired-bootstrap confidence intervals and a significance verdict
- Check an agent trace against expected tool calls, in strict or lax order, with argument matchers
- Detect prompt regressions between baseline and candidate outputs on a golden set
- Render results as Markdown, JSON or JUnit reports, and run whole evalsmith.yaml suites from files in the workspace
- Serve bundled synthetic example datasets and guided prompts for comparing configs, auditing traces and reviewing prompt changes
- When to use it
- Useful when you are tuning a retriever, prompt or agent and want an assistant to quantify whether a change helped, whether a lead is statistically real, or whether tool calls and golden-set outputs still hold up, mid-conversation or before a merge.
- Requirements
- Runs locally over stdio via npx or a global npm install (Node.js). Optional LLM judge needs an OpenAI-compatible endpoint, set by EVALSMITH_JUDGE_BASE_URL and EVALSMITH_JUDGE_MODEL, plus EVALSMITH_JUDGE_API_KEY for hosted endpoints. EVALSMITH_ROOT limits which directory run_suite may read; LOG_LEVEL controls logging.
Installation
In SourceWeft
- Open Evalsmith Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
evalsmith-mcp
Evaluate RAG retrieval and AI agents with deterministic metrics, from any MCP client or from CI.
[Node] [TypeScript] [MCP SDK] [CI] [Paid API keys] [npm] [License: MIT] [M8ven Score] [Glama score] [Evalsmith MCP server]
evalsmith answers four questions that come up every time a retriever, prompt or agent changes:
- Is retrieval good enough? recall@k, precision@k, nDCG@k, hit rate and MRR from qrels and a ranked run.
- Which configuration is better, and is the gap real? 2-3 configurations ranked with seeded paired-bootstrap confidence intervals.
- Did the agent call the right tools? Trace vs. expected calls, strict or lax order, argument matchers.
- Did the prompt change break anything? Golden-set checks on baseline vs. candidate outputs.
Everything is deterministic and runs offline. An LLM judge exists for a second opinion, but it is off by default and never decides the verdict. Results come out as a terminal table, Markdown, JSON, JUnit XML or a self-contained HTML report, and the GitHub Action turns them into a merge gate.
Interfaces over the same core
All four call the same functions in src/core. The MCP tools are thin adapters: parse input with Zod, call the core, return structuredContent validated against an output schema.
MCP surface
Tools
Every tool declares an input and an output Zod schema, returns structuredContent plus a JSON text block, and is annotated readOnly and non-destructive. Four tools are also idempotent and closed-world. detect_prompt_regression and run_suite are declared open-world and non-idempotent: annotations are per tool, and with the judge enabled they call an external model whose answers can vary. With the judge off (the default) they behave like the others.
run_suite runs the same suites as evalsmith run, so a client can evaluate data that lives in files instead of pasting it into the conversation. It only reads inside the workspace root (EVALSMITH_ROOT, the directory the server started in by default), following symlinks before it checks, and runs the bundled example suite when no config is given.
Bad input (unknown metric, duplicate config names, qrels with no relevant documents) comes back as an InvalidParams tool error with a message the model can act on. A judge endpoint that is down or returns an HTTP error is an InternalError.
Resources
evalsmith://examples/{name} lists and serves the synthetic datasets in examples/datasets, so a client can try every tool before wiring in its own data:
Prompts
A conversation with an MCP client
Metrics
For a query $q$ with relevant set $R_q$ (documents with grade $> 0$) and ranking $D_q$, with $D_q^{k}$ its first $k$ documents:
$\mathrm{rel}_i$ is the graded judgement of the document at rank $i$ (linear gain, as in trec_eval), and IDCG is the DCG of the judgements sorted in descending order. Reported values are means over judged queries.
Conventions, all covered by tests:
- Queries whose judgements are all 0 are skipped and listed in
skippedQueries. - Judged queries missing from the run score 0 and are listed in
missingFromRun. - Precision divides by $k$, not by the ranking length.
- Repeated document ids in a ranking keep only their first position, as in
trec_eval, so a run cannot score above 1 by repeating a relevant document. - Cut-offs start at 1:
recall@0is rejected.
Worked example (tests/core/retrieval.test.ts): judgements a=2, b=1, c=0, ranking d, a, e, b, c.
DCG@5 $= 2/\log_2 3 + 1/\log_2 5 = 1.69254$, IDCG@5 $= 2/\log_2 2 + 1/\log_2 3 = 2.63093$, so nDCG@5 $= 0.64332$; recall@3 $= 0.5$, precision@5 $= 0.4$, RR $= 0.5$.
Bootstrap. compare_configs resamples queries with replacement, using the same indices for every configuration (paired), samples times, from a seeded PRNG (mulberry32). Intervals are percentiles of the resampled means. The lead is significant when the interval of winner minus runner-up excludes zero. The same seed gives the same intervals on every machine.
Tool-call matchers
strict requires the trace to be exactly the expected calls in order; calls past the expected sequence fail the check and appear as failed test cases in JUnit. lax ignores order and pairs expected calls with trace calls by maximum bipartite matching (augmenting paths), so a loose matcher never steals the only call a stricter one accepts. Extra calls are reported without failing. Every matcher, exact included, fails when the argument is missing.
Prompt checks
exact (trimmed by default), regex, contains (case-insensitive by default), json_schema (the output is parsed and validated with Ajv) and length (min / max characters). A regression is a case that passes on the baseline and fails on the candidate. Missing outputs count as failures.
The optional judge sends both outputs to any OpenAI-compatible /chat/completions endpoint, Ollama included, at temperature 0. To cancel position bias each case is judged twice, with baseline as answer A and then as answer B. A side wins only when both orderings agree; a disagreement counts as a tie. That costs two requests per case. Its votes are reported next to the verdict.
Quickstart
To run the bundled examples and the tests from source:
Connect an MCP client (stdio)
[Install in Cursor] [Install in VS Code]
From a terminal:
Other desktop MCP clients read an mcpServers block like this (examples/mcp-client-config.json):
Restart the client, then try the compare_rag_configs prompt or ask it to read evalsmith://examples/agent-trace and check it.
Streamable HTTP
CLI and CI
Gates accept recall@k, precision@k, ndcg@k, hit_rate@k, mrr, tool_calls (score of check_tool_calls) and prompt_pass_rate. Gates in the YAML file apply too; a command-line gate with the same name overrides it. A prompt regression or a failed tool-call check fails the run even without gates.
Real output
node dist/cli/index.js run examples/evalsmith.yaml on the bundled datasets (examples/evalsmith.yaml):
Raising the bar makes the same run fail the build:
HTML report
--report report.html (or --format html on stdout) writes the whole run to one HTML file that opens offline and follows the system light or dark mode:
- the verdict, and a card per gate with its value, threshold and status;
- retrieval metrics per k as bars with a bootstrap interval over the queries, and gate thresholds marked on them;
- the configuration comparison with each interval, the winner and the gap to the runner-up;
- expected vs. actual tool calls, with the matched pairs linked and mismatches flagged;
- baseline vs. candidate per golden case, with the failing checks one click away.
Dark mode and an opened prompt regression
Dataset text (case ids, tool names, failure messages) is embedded as JSON in a non-executable <script type="application/json"> block and rendered with textContent only. A Content-Security-Policy allows no network access and only the page's own script, by hash. Tests open a report full of markup in Chromium and check that nothing from it runs. npm run docs:screenshots regenerates the pictures above.
GitHub Action
The step fails when a gate is below its threshold, the prompt candidate regresses or the tool calls do not match, and writes the Markdown report with the verdict to the job summary. It runs the same core as the CLI from a bundled node24 script, with no install step and no shell. examples/github-workflow.yml is a complete workflow that also keeps the HTML report as an artifact and publishes the JUnit XML as a check run.
Outputs of a section the suite does not have are empty. Dataset text printed to the log is wrapped in ::stop-commands::, so a case id or tool name cannot issue workflow commands. The judge reads EVALSMITH_JUDGE_* from the step environment, as the CLI does.
Without the action, the CLI does the same from any CI:
Suite file
Every section is optional. Paths are relative to the YAML file.
Pairs with ragcompass
ragcompass profiles a corpus and recommends how to configure the RAG pipeline: parser, chunking, top-k, hybrid search, reranking. evalsmith checks whether that configuration holds up:
Design decisions
- Deterministic first. Metrics, matchers and checks are pure functions with hand-computed tests. A model is never needed to get a verdict, so results do not drift between runs and no paid API key is required.
- Judge off by default. When enabled it goes through any OpenAI-compatible endpoint (local Ollama works), and its votes sit next to the verdict instead of changing it.
- Intervals, not just means. Twelve queries can make a 0.03 lead look decisive. A paired bootstrap with a fixed seed makes the uncertainty visible and reproducible.
- Stateless HTTP done properly. A stateless
StreamableHTTPServerTransportcannot be reused across requests, so every POST gets its own server and transport. Registration is cheap, and a test makes two consecutive calls over real HTTP to prove it. - stdout belongs to the protocol. pino writes to stderr and ESLint forbids
consoleinsrc/, so no stray byte breaks the stdio transport. The CLI keeps stdout for results only. - One schema, three uses. The Zod schemas in
src/core/schemas.tsvalidate MCP input, generate the JSON Schemas clients see, and type the core.
Project layout
Releases come from version tags: release.yml publishes to npm with provenance, to the MCP Registry and to GitHub Releases, and the action is published to the Marketplace from the release. docs/RELEASING.md has the steps, including the action bundle and the v0 tag. Changes are listed in CHANGELOG.md.
License
Source: README.md at commit d130d5b
Tools
0Version history
1- v0.1.0LatestOct 29, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts