ml-inspector-mcp
Framework-agnostic ML model analysis MCP server. Drop in any trained model and test data — Claude evaluates it, explains predictions, detects drift, and generates PDF reports via natural language.
Installation
pip install ml-inspector-mcp # minimal
pip install "ml-inspector-mcp[full]" # everything
pip install "ml-inspector-mcp[sklearn-onnx,explain,reports]" # common combo
Claude Desktop setup
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (Mac):
{
"mcpServers": {
"ml-inspector": {
"command": "ml-inspector",
"env": {
"ANTHROPIC_API_KEY": "your-key-here",
"MLFLOW_TRACKING_URI": "http://localhost:5000"
}
}
}
}
Quick start
python examples/train_demo_model.py
Then in Claude Desktop:
"Load the demo model from examples/demo_model.onnx" "Load test data from examples/demo_test.csv" "Evaluate the model and tell me how it's performing" "Explain what drove the prediction for sample 5" "Generate a PDF evaluation report"
Model compatibility
| Format | Framework | Install |
|---|---|---|
.onnx |
Any | Always works — recommended |
.pkl / .joblib |
scikit-learn | pip install "ml-inspector-mcp[sklearn-onnx]" |
.h5 / .keras |
TensorFlow/Keras | pip install "ml-inspector-mcp[tensorflow]" |
.pt / .pth |
PyTorch (full model only) | pip install "ml-inspector-mcp[pytorch]" |
Version mismatch fix
If you get version errors loading a .pkl or .pt file, export to ONNX first:
# scikit-learn — use the convert_to_onnx tool after loading, or:
python -c "
import joblib
from skl2onnx import convert_sklearn
from skl2onnx.common.data_types import FloatTensorType
model = joblib.load('model.pkl')
onnx_model = convert_sklearn(model, initial_types=[('input', FloatTensorType([None, N_FEATURES]))])
open('model.onnx', 'wb').write(onnx_model.SerializeToString())
"
# PyTorch
torch.onnx.export(model, dummy_input, "model.onnx", opset_version=17)
# TensorFlow / Keras
python -m tf2onnx.convert --keras model.h5 --output model.onnx
All tools
| Tool | Description |
|---|---|
load_model |
Load any model file (.pkl, .h5, .pt, .onnx) — auto-detects framework |
get_model_info |
Info about the currently loaded model |
convert_to_onnx |
Convert loaded model to ONNX format |
list_supported_formats |
Show all supported formats and install instructions |
load_test_data |
Load a CSV as test dataset |
evaluate_model |
Full evaluation — accuracy, F1, AUC, confusion matrix, per-class metrics |
find_worst_predictions |
Find samples the model struggled most with |
evaluate_by_slice |
Evaluate on a data subset (e.g. by group or label) |
threshold_analysis |
Sweep decision threshold — precision/recall/F1/FPR trade-offs |
explain_prediction |
SHAP explanation for a single sample |
global_feature_importance |
Mean absolute SHAP values across all samples |
plot_shap_summary |
SHAP beeswarm summary plot saved as PNG |
data_quality_report |
Null counts, class imbalance, outliers, data type warnings |
detect_drift |
Statistical drift detection between two datasets (Evidently) |
plot_confusion_matrix |
Confusion matrix heatmap (raw + normalized) saved as PNG |
plot_roc_curve |
ROC curve with per-class AUC scores saved as PNG |
generate_report |
Full PDF / HTML / Markdown report with metrics, charts, and optional AI narrative |
License
MIT
Metadata
Release files for ml-inspector-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ml_inspector_mcp-0.1.0.tar.gz | 402.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ml_inspector_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 434.3 kB
Release files / ml_inspector_mcp-0.1.0.tar.gz
| Download URL | ml_inspector_mcp-0.1.0.tar.gz |
|---|---|
| Size | 402.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
69a5991af2fa53484c87663ff7695aff29896e5c7f842a6637202720c389cfdc
|
|
BLAKE2b-256 checksum How to use checksums |
b286027bdfc847a7221cb7a89987056d178b20599b07ba464d835d0ee4e6b7ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.3
|
Release files / ml_inspector_mcp-0.1.0-py3-none-any.whl
| Download URL | ml_inspector_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 31.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
71846148fd6b3765d1e004da6605f883dd75d28a6d92ff666c42b7600284a116
|
|
BLAKE2b-256 checksum How to use checksums |
e38f94017d1dfe086623db09ec4f87823808649f0621502d5a872aba0b43e396
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.3
|
Security for ml-inspector-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.