calibra-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@calibra-mcp Audit the calibration of ~/experiments/resnet_test.npz"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
calibra-mcp
An MCP server + AI agent that audits the confidence calibration of ML classifiers.
A model that says "95% sure" should be right 95% of the time. Most modern neural networks
aren't: they are overconfident, which is dangerous in medicine, finance and any system that
acts on predicted probabilities. calibra-mcp lets any LLM agent (Claude Desktop, Claude Code,
Cursor, your own agent) measure, visualise and fix miscalibration from your model's saved
predictions.

Features
Tool | What it does |
| Accuracy, ECE, MCE, Brier, NLL + plain-language diagnosis |
| Confidence-vs-accuracy plot (returned as an image to the LLM) |
| Temperature scaling (Guo et al., 2017), before/after metrics |
| Ranks several models by ECE |
| Synthetic calibrated / over- / under-confident predictions |
Plus an audit prompt and calibra-audit, a standalone agent that connects to the server
over stdio and writes a Markdown audit report.
Related MCP server: MCP Agent Reliability Server
Architecture
┌──────────────┐ MCP (stdio / HTTP) ┌──────────────────────────────┐
│ Claude / any │ ───────────────────▶ │ calibra-mcp server │
│ MCP client │ ◀─────────────────── │ metrics · plots · scaling │
└──────────────┘ tools, images └──────────────┬───────────────┘
▲ │ reads
│ calibra-audit (agent loop) ▼
└──────────── Markdown report preds.npz / preds.csvThe server is model-agnostic: it audits predictions, not weights. Export your model's outputs on a held-out set and you're done, whatever framework you use.
Quickstart
pip install "calibra-mcp[agent]" # or: uv tool install "calibra-mcp[agent]"
export ANTHROPIC_API_KEY=sk-...
python -c "from calibra_mcp import data; data.save(data.make_demo('overconfident'), 'demo.npz')"
calibra-audit demo.npz --out reports/audit.mdUse it from Claude Desktop / Claude Code
{
"mcpServers": {
"calibra": { "command": "uvx", "args": ["calibra-mcp"] }
}
}Claude Code: claude mcp add calibra -- uvx calibra-mcp
Then ask: "Audit the calibration of ~/experiments/resnet_test.npz".
Input format
.npz with labels (N,) and either logits (N, K) (preferred: enables temperature scaling)
or probs (N, K). Or a .csv with columns label,p_0,...,p_{K-1}.
# PyTorch
logits = torch.cat([model(x) for x, _ in test_loader]).cpu().numpy()
np.savez("preds.npz", logits=logits, labels=test_labels)Development
uv venv && uv pip install -e ".[dev,agent]"
pytest # unit + end-to-end MCP tests
ruff check . && ruff format .Roadmap
Classwise ECE, adaptive binning, KS calibration error
More recalibrators: Platt, isotonic, vector/matrix scaling, Dirichlet
Direct loaders for HuggingFace models and datasets
Agent benchmark: detection accuracy over N seeded miscalibrated models
Publish on PyPI and the MCP Registry
References
Guo et al., On Calibration of Modern Neural Networks, ICML 2017
Naeini et al., Obtaining Well Calibrated Probabilities Using Bayesian Binning, AAAI 2015
License
MIT © Daniele Santoro
Available Tools
5 toolscompare_modelsC
Evaluate several predictions files side by side and rank them by ECE.
Inputs: paths (required), n_bins. Returns: object
evaluate_calibrationB
Compute accuracy, ECE, MCE, Brier score and NLL for a predictions file, plus a plain-language diagnosis (over/underconfidence).
Inputs: path (required), n_bins. Returns: object
fit_temperatureA
Fit temperature scaling on a predictions file that contains logits.
Returns the optimal temperature and before/after metrics. Optionally saves the
recalibrated predictions to save_to (.npz).
Note: for a fair estimate, fit on a validation split and evaluate on a test split.
Inputs: path (required), n_bins, save_to. Returns: object
generate_demoB
Create a synthetic predictions file to try the tools. kind: 'calibrated' | 'overconfident' | 'underconfident'.
Inputs: kind, path, seed. Returns: object
reliability_diagramC
Render a reliability diagram (confidence vs accuracy) for one or more predictions files.
Inputs: paths (required), n_bins.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose: metric computation, diagram rendering, temperature fitting, multi-model comparison, and demo data generation. Although evaluate_calibration and compare_models both involve evaluation, compare_models is explicitly scoped to side-by-side ranking, so boundaries remain clear.
All names use consistent snake_case, and four follow a verb_noun pattern (evaluate_calibration, fit_temperature, compare_models, generate_demo). reliability_diagram is a noun phrase rather than a verb-led name, which is a minor deviation but still readable and predictable.
Five tools are well-scoped for a focused calibration toolkit. Each tool covers a distinct part of the workflow, and there is no obvious redundancy or bloat.
The surface covers core calibration evaluation, visualization, recalibration via temperature scaling, model comparison, and demo generation. Minor gaps exist, such as alternative recalibration methods (e.g., isotonic/Platt scaling) or explicit data splitting utilities, but the stated purpose is well served.
Maintenance
Related MCP Connectors
Open calibration benchmark for AI agents. Check if your agent says I don't know at the right time.
LLM evaluation: compare models on cost and quality, score outputs, run benchmarks, analyse agents.
Calibrated judgments for text: yes/no probabilities, picks from your options, or scores.
Calibrated world model for AI agents. 40 tools: world state, markets, trading. Kalshi + Polymarket.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables LLM agents to perform SRE reliability calculations like error budgets and burn rates using deterministic tools, integrating with Prometheus and Loki for real data.MIT
- AlicenseNot gradedqualityDmaintenanceLogs tool call results, calculates reliability scores, and generates reports for AI agents, helping entrepreneurs measure agent reliability without paid APIs.MIT
- FlicenseAqualityDmaintenanceEnables LLMs to audit data drift and model degradation in tabular ML pipelines through deterministic statistical tests such as Kolmogorov-Smirnov and Population Stability Index, plus reusable prompts and standards resources.4-
- AlicenseAqualityAmaintenanceEnables agents to verify claims against cited evidence, screen content for prompt injection and relevance before reading it, and rank candidates by meaning, all with calibrated probability verdicts.124,378 npm595MIT