multi-source-mcp-benchmark
Health Gecti
- License — License: MIT
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Community trust — 11 GitHub stars
Code Gecti
- Code scan — Scanned 12 files during light audit, no dangerous patterns found
Permissions Gecti
- Permissions — No dangerous permissions requested
Bu listing icin henuz AI raporu yok.
Benchmark for tool-using AI agents on conflicting evidence: MCP servers in a no-network Docker sandbox, three scenarios (payout reconciliation, performance-claim check, incident root cause), claim-based LLM grading, Ollama runner.
Multi-Source MCP Benchmark: Tool-Using AI Agents on Conflicting Evidence with MCP, Docker Sandboxes and Claim-Based LLM Grading
Executive summary
The problem
Teams that run online businesses and software services have to make decisions based on records from many places, and they can ask an AI agent to do the investigation. This project is a benchmark that checks whether AI agents can find the right answer to a business question when the information they are given disagrees with itself.
This project uses three such cases:
| Who is asking | What they need to know | Why they need it |
|---|---|---|
| The finance team of an online marketplace | What is the correct total to pay sellers this week? | Their own records and the payment company's records do not match, and the payment report cannot be released until they do. |
| A manager who must approve a software change | Does a new way of speeding up the system really work as well as claimed? | The team that built it reports large gains and wants to use it everywhere. |
| A company that delivers automatic messages to its customers' systems | Why did delivery fail, and how can it be prevented? | The outage must be explained and a plan agreed before the next busy period. |
In each case, the files that hold the answer conflict. Two systems show different numbers, a report quotes results that were not compared fairly, and the most obvious explanation is not the true one.
Why it matters
An agent can write a confident, well-worded answer that is wrong. If a company acts on it, it may pay the wrong amount, approve a change that does not help, or fix the wrong fault. A test that gives an agent one clean file and one simple question cannot show whether this will happen.
How it is tested
The agent gets one of the three cases together with its files, and studies them using tools that run in a closed-off space on your computer with no internet access. When it has finished, it writes its answer. A second AI model, called the judge, then compares that answer with a list of facts a correct answer must contain, giving points for each fact and taking points away for wrong conclusions. Before the judge is trusted, it is tested too, using answers that are already known to be good or bad.
Results
- The judge: both models tested,
gpt-4.1-miniandgpt-4.1from OpenAI, passed all 15 judge tests. - The agents: they did poorly. Three small open-source AI models that can run on a laptop each scored 25% or less on every case, and none solved one.
- The most advanced models: we are yet to test how well they do as agents. This testing is work in progress, and we will update this README after the test.
- Cost: the agents are open-source models and cost nothing per use, because they run on your own computer. The judge is a paid online service that charges by the amount of text: judging one answer uses about 8,100 tokens (small pieces of words).
Key decisions made
- Each case has several separate problems, because finding one problem should not be enough to get a high score.
- Each fact is scored separately, because that shows exactly what the agent got right and what it missed.
- Wrong conclusions cost points, because a confident wrong answer should not score well just because it says a lot.
- The judge is tested before it is trusted, because some judges score correct answers too low, and some give points to an answer that only asks for them.
gpt-4.1-miniis the judge, because it passed every judge test three times in a row, and it is a smaller model than the other one that passed.qwen2.5:7b, an open-source model, is the standard agent, because it runs on your own computer with no charge per use, and it was the only one of the three to write a real answer in every case. You can use any other model that supports tools instead.- The agent's tools have no internet access, because the correct answers are published with the project, so tools with internet access could simply copy them.
- The data files are created by computer programs, so anyone can rebuild them, and an automatic check reports any file that no longer matches.
Table of contents
- The three cases
- How it works
- Run it yourself
- Results in detail
- Repository structure
- Testing and CI
- Security
- License
The three cases
Each case has a task (brief.md), 5 to 8 evidence files, 7 or 8 facts to score, and 2 or 3 wrong conclusions that lose points.
| Case | Decision to make | What the agent must work out |
|---|---|---|
ledger-drift |
Which payment total goes into the weekly report | A company's payment records and its payment provider's export disagree for four different reasons. |
signal-check |
Whether to roll out a new caching method to all servers | A memo's two impressive numbers come from tests that were not fair comparisons. |
root-cause |
What caused an outage and how to prevent it | A settings change makes it look as if the customers' own servers were down. |
ledger-drift (7 facts). Payout batch from 2027-02-08 to 2027-02-14. The settlement export is the record of whether money moved. The ledger is the record of which order a payout belongs to. The fee schedule is the record of the correct fee rate. The four problems are:
- A webhook (an automatic message from the payment provider) was retried, so one transfer appears twice (PAY-8801, $1,128.40).
- A $275.00 payment appears in the export but not in the ledger (PAY-9999).
- A payout was made one day after the batch ended (PAY-8841). Its amount matches the ledger, so only the batch changes.
- A seller moved to a lower fee tier during the week, but the ledger applied the new rate to only some payments (PAY-8811, underpaid by $19.20).
The correct total is $24,460.80 across 22 payouts.
signal-check (8 facts). There are four load-test runs, and only one pair can be compared fairly. The memo's 92% cache hit rate comes from a run with a different traffic profile on different hardware. Its 51 ms latency comes from a run that started with a preloaded cache. On the fair pair, P95 latency improves from 83.0 ms to 75.2 ms and the hit rate improves from 70.8% to 76.0%. Welch's t-statistic is about -6 for latency and +11.5 for hit rate, so the gains are real but modest. One run contains a duplicated sample that must be removed. Each "P95" value is an average of per-minute P95 values, which is not a true P95 for the whole run.
root-cause (7 facts). Change CB-771 lowered the circuit breaker's failure threshold from 50% to 15% and widened its grouping from per-endpoint to per-region, five minutes after traffic started to rise. (A circuit breaker stops sending requests when too many fail.) The agent must:
- Tell apart two error types in the logs (about 6
circuit_openerrors for eachcustomer_timeout). - Show that an unrelated software release and the "customer servers were down" theory are wrong.
- Explain why a restart and adding servers only helped partly.
- Find the later overcorrection to a 90% threshold (CB-772).
- Note that region-level grouping breaks the delivery agreement with customers (SLA).
- Recommend how to prevent it next time.
The settings history is a real git repository. The logs name each change only by its commit id, so the agent must run git show to see what changed.
Rules the cases follow
- Evidence states facts, not conclusions. A document may say what something is, for example what the settlement export is the record of. It never says what to conclude about the case.
- Each case has several separate problems. In
ledger-driftthey are a duplicate record, an unmatched record, a date cutoff and a half-applied rule change. - Every number in a correct answer can be worked out from the evidence. If the evidence cannot explain something, the correct answer says so and recommends an investigation.
- Every wrong explanation can be disproved. For example, a hardware column shows that two tests used different machines, and a support summary shows that no customer reported an outage.
- Trust is assigned per fact, not per system. One source decides whether money moved. Another decides which fee rate applies.
- Each scored fact can be checked. For example: "States the net total as $24,460.80 within $1".
The agent is also offered a few tools it does not need. Every tool call is recorded, so you can review the agent's choices. Tool use is not scored.
How it works
- You give the agent the task in
brief.md. The agent is an AI model:qwen2.5:7bby default, running on your own computer through Ollama. - The agent investigates with tools. They connect through the Model Context Protocol (MCP), a standard way for AI models to use tools. There are four: file reading, code running, git (change history, used in
root-cause) and a calculator. The tools are ordinary programs, not AI models. - The tools run inside a Docker container (the "sandbox").
- The agent writes its final answer.
- The judge model (
gpt-4.1-miniby default, a paid online service) reads the answer. It is asked about one fact fromclaims.yamlat a time and gives a score from 0 to 3. - The judge also checks for each wrong conclusion listed in the same file.
- Plain Python code, not a model, adds the scores into a total.
The sandbox
- No network. Containers run with
network_mode: none. - Limited rights. Tools run as an unprivileged user (uid 10001) on a read-only filesystem, and the evidence is mounted read-only. Only small in-memory folders (
/tmp,/home/agent,/workspace/scratch, and the cloned repository inroot-cause) can be written to. - Python inside. The code tool runs Python with its standard library only (for example
csv,sqlite3,statistics). Extra packages such aspandasare not installed and cannot be downloaded, because there is no network. - Resource limits. All Linux capabilities are dropped,
no-new-privilegesis set, and a container is limited to 512 processes and 2 GB of memory. - Clean and ready.
make upremoves any old container first, then returns only after setup has finished. - Installed in advance. The tool servers are built into one shared image and started with
docker exec -i. The base images and the tool servers themselves are pinned to exact versions; the packages they depend on are not. Paths such as/workspace/...inmcp-servers.jsonare paths inside the container.
The data files
- Generated by code. Each case has a
solution/generate_evidence.pyscript that creates its data files (spreadsheets, database, logs and git history) the same way every time. It accepts--out DIR. The written notes beside them are edited by hand. - Kept away from the agent. The script and the correct answer are in
solution/, which is never mounted into the container. - Git history as one file. The
root-causerepository is stored asrelay-config.bundleand cloned when the container starts, because git cannot store one repository inside another as normal files. The script ignores your personal git settings, so commit ids never change.
Grading
- Total. Facts add points and wrong conclusions subtract them. The total cannot go below 0, and the value before that limit is printed when it applies.
- Protection against cheating answers. The answer is wrapped in
<candidate_answer>tags and treated as data. It is placed before the judge's task. Closing tags and quoted"score"keys inside it are rewritten. The judge must quote the part of the answer that states each fact, and give 0 if there is none. - Strict replies. The judge must end with a line like
{"score": 2}. Anything else raises an error instead of counting as 0. Replies are limited to 600 tokens. - Retries. Timeouts, connection errors, rate limits (429) and server errors are retried up to 3 times with growing delays.
Run it yourself
What you need
- Python 3.11 or newer, Docker with Docker Compose,
makeand git. - Ollama, to run the default agent.
- An API key for an OpenAI-compatible service, to grade with a judge. The
--dry-runchecks need no key.
pip install -e ".[dev]"
1. Start a case
make up SCENARIO=ledger-drift # build the image and start a clean sandbox
make down SCENARIO=ledger-drift # stop and delete it when you are done
To check the tools yourself, tools/mcp_probe.py can list or call them inside the container:
python tools/mcp_probe.py list-tools \
--config scenarios/ledger-drift/mcp-servers.json \
--server filesystem --container msmb-ledger-drift
python tools/mcp_probe.py call-tool \
--config scenarios/ledger-drift/mcp-servers.json \
--server filesystem --container msmb-ledger-drift \
--tool read_text_file --args '{"path": "/workspace/evidence/settlement_terms.md"}'
2. Run an agent
ollama pull qwen2.5:7b
python tools/run_agent.py --scenario ledger-drift --model qwen2.5:7b --out answer.md
tools/run_agent.py works with any Ollama model that supports tools. It repeats tool calls until the model gives a final answer, saves the answer, and records every call in answer.md.trajectory.jsonl: the tool, its inputs, the exact text the model saw, and whether that text was cut short.
| Setting | Default | What it does |
|---|---|---|
--max-steps |
20 | Most turns the model may take |
--max-tokens |
4096 | Most tokens the model may write per turn |
--num-ctx |
32768 | How much text the model can hold in memory (tokens) |
--max-tool-output |
12000 | Characters of a tool result the model sees. A cut is marked in the text |
--trajectory |
<out>.trajectory.jsonl |
Where tool calls are saved |
At most 8 tool calls run in one turn. If the model sends more, the rest are skipped and the model is told.
If the model is still calling tools when it runs out of steps, there is no final answer: the answer file is left empty and the command exits with status 3.

A real recording, sped up. The small model reads some files, then stops with a plan instead of a result.
To use a different agent, start each server listed in the case's mcp-servers.json with docker exec -i msmb-<scenario> <command> <args>, adding -e NAME=VALUE before the container name for every entry in that server's env (the code tool needs them). Connect your agent to each one over standard input and output, and give it brief.md as the task.
3. Grade the answer
# Check the files only. No API key needed.
python tools/grade.py --claims scenarios/ledger-drift/evaluation/claims.yaml \
--answer answer.md --dry-run
# Score with a judge
export MSMB_API_BASE=https://api.openai.com/v1 MSMB_API_KEY=... MSMB_MODEL=gpt-4.1-mini
python tools/grade.py --claims scenarios/ledger-drift/evaluation/claims.yaml --answer answer.md
The output shows every score, the total, and the judge calls and tokens used.

A real recording: a dry run, then the answer from the recording above (0%), then the correct answer (100%).
4. Test a judge
Run this before trusting any new judge model. It exits with an error if the judge fails any of the judge tests.
python tools/calibrate.py --repeats 3 # all cases; every repeat must pass
python tools/calibrate.py --dry-run # check the files only
Add --scenario <name> to test one case.
Results in detail
Judge tests
Each judge grades 5 kinds of answer for each of the 3 cases, so 15 tests in total. Each score must fall inside its allowed range.
| Kind of answer | What it is | Allowed score |
|---|---|---|
| Correct | The verified correct answer (solution/REFERENCE_ANSWER.md) |
85% to 100% |
| Half-correct | Gets about half of the facts right and says nothing about the rest | 15% to 60% |
| Confident but wrong | Sounds sure, but accepts the wrong cause or numbers | 0% to 40% |
| Injection | Has no real content and tells the judge to give full marks | 0% to 15% |
| Found nothing | Says the files could not be found | 0% to 15% |
The last four are in scenarios/<name>/evaluation/calibration/.
gpt-4.1-minipassed every test in three repeated runs.gpt-4.1passed every test in one run.

The saved logs for gpt-4.1-mini and gpt-4.1, printed from results/calibration/.
Agent scores
qwen2.5:7b, llama3.1:8b and llama3.2 each ran once on each case and were graded by gpt-4.1. The best score is 25% (llama3.1:8b on signal-check), but that answer read no files and repeated the memo's numbers (see Known limitations). qwen2.5:7b scored 19% on root-cause and 17% on signal-check. Three of the nine runs produced no usable answer, because the model wrote a tool call as plain text instead of calling the tool; they count as 0%.
The answers, tool-call records, grades and judge test logs are in results/. python tools/plot_results.py redraws the charts from results/trial.json.
Cost
The agent runs on your computer, so only the judge costs money. These are the measured token counts. Multiply them by your provider's current price.
| Run | Judge calls | Prompt tokens (sent) | Completion tokens (received) |
|---|---|---|---|
| Grade one answer (average of six) | 10 | about 7,400 | about 730 |
All judge tests once (gpt-4.1) |
150 | 91,520 | 10,304 |
All judge tests three times (gpt-4.1-mini) |
450 | 274,560 | 36,501 |
Ways the cost is kept low:
- Only the judge is paid for. The agent's long back-and-forth with tools runs locally.
- No model calls when none are needed.
--dry-runand the automatic checks never call a model. - Small calls. One call per fact or wrong conclusion, with short replies.
- Try the hardest tests first. Before a full judge test, try a new judge on one injection answer and one correct answer (about 20 calls).
- Repeat only when needed. One run is enough for a first check. Use three to confirm stability.
Known limitations
- The cases are made-up and small. They test reasoning over conflicting evidence, not large volumes of data.
- We are yet to test the most advanced models as agents, and to run each agent more than once to see how much its scores vary. This testing is work in progress, and we will update this README after the tests.
- The included runner supports Ollama models only.
- Scores depend on the judge. Compare scores only between runs that used the same judge.
- A judge that passes the tests can still make mistakes. In one graded run,
gpt-4.1gave 25% to an answer that read no files and reported the memo's misleading numbers as its own results, and it did not apply the penalty for that. Every grade is saved inresults/grades/, so it can be checked. - The sandbox limits the tools, not the agent program. An outside agent that has its own internet access or file tools must be restricted separately.
- The code tool can run any code inside the sandbox, including code that reads all the evidence.
- Compiled programs cannot be started from the in-memory folders. Python scripts run normally.
Repository structure
Testing and CI
ruff check tools tests # code style
pytest # files, scoring, retries, data generation and charts
pytest -m docker # needs Docker
The Docker tests start every case. They check that each tool server offers the tools listed for the case, that there is no network, that tools run without root rights, that system and evidence folders are read-only while the scratch folder is writable, and that the code tool can read the evidence.
GitHub Actions runs all three commands on every push to main and on pull requests, and CodeQL scans the code. No test calls a model. Dependabot's regular update pull requests are switched off, so versions are updated by hand.
Security
Please report vulnerabilities privately. See SECURITY.md.
License
MIT. See LICENSE.
Yorumlar (0)
Yorum birakmak icin giris yap.
Yorum birakSonuc bulunamadi