Skip to content
Conduit

mcp server

fidelity-agentic-stack

Experimental harness for measuring information fidelity across MCP, A2A, and A2UI layers — companion repo for the Fidelity of the Agentic Stack paper

tercanfurkan/fidelity-agentic-stackcommunitylistedunreviewed

Set up

Runs on your computer. Pick your agent and operating system.

This project does not publish an install method we can turn into a config. Follow the README instead.

README

synced Oct 23, 2026

Fidelity Agentic Stack

Experimental evaluation harness for the paper "Fidelity of the Agentic Stack: Measuring Information Preservation Across MCP, A2A, and A2UI Layers" (read the paper).

Implements an end-to-end MCP → A2A → A2UI pipeline and measures how faithfully information is preserved at each layer using BERTScore. Results fill Tables 1a/1b in the paper.

Query → MCP retrieve → R₀ (raw chunks) → LLM synthesise → R₁ (NL answer) → LLM format → R₂ (JSON payload)
LayerWhatDelta
R₀Raw FAISS chunks from MCP retrieval—
R₁NL answer synthesised by gpt-4o-miniΔ₁ = F1(R₁) − F1(R₀)
R₂JSON payload {summary, key_points, ...}Δ₂ = F1(R₂) − F1(R₁)

Quick Start

python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env                  # set OPENAI_API_KEY

python scripts/fetch_docs.py          # download httpx docs → data/httpx_docs/
python mcp_server/index.py            # build FAISS index → data/faiss_index/
PYTHONPATH=. python eval/run_eval.py  # run full evaluation (starts/stops MCP server)

Outputs:

FileContents
eval/results/raw_logs.jsonFull R₀/R₁/R₂ text per query
eval/results/scores.csvPer-query P/R/F1 per layer + deltas
paper_results/table1.mdPaper-ready Tables 1a and 1b

Custom Test Sets

Replace data/test_set.json with any array of {id, query, reference} objects and re-run. The pipeline is count-agnostic.

[{"id": "Q01", "query": "Your question", "reference": "Ground-truth answer"}]

To swap the corpus: place markdown files in data/httpx_docs/, rebuild the index (python mcp_server/index.py), and write matching references.

Controlled Variables

Changing any of these invalidates comparability with published results.

VariableValue
LLMgpt-4o-mini, temperature=0
Retrieved chunks (k)3
BERTScoreroberta-large, bert-score==0.3.13, CPU
R₂ scoringsummary + key_points only (code_example excluded)

Streamlit UI

PYTHONPATH=. streamlit run ui/app.py  # manual inspection, not part of eval
↑↓ navigate openesc close