Skip to main content

ml-inspector-mcp

PyPI Python 3.11+ License: MIT

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ml_inspector_mcp-0.1.0.tar.gz (402.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ml_inspector_mcp-0.1.0-py3-none-any.whl (31.5 kB view details)

Uploaded Python 3

File details

Details for the file ml_inspector_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: ml_inspector_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 402.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.3

File hashes

Hashes for ml_inspector_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 69a5991af2fa53484c87663ff7695aff29896e5c7f842a6637202720c389cfdc
MD5 dfc249cc577c661e661a8efaba108e5e
BLAKE2b-256 b286027bdfc847a7221cb7a89987056d178b20599b07ba464d835d0ee4e6b7ec

See more details on using hashes here.

File details

Details for the file ml_inspector_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ml_inspector_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 71846148fd6b3765d1e004da6605f883dd75d28a6d92ff666c42b7600284a116
MD5 508ff84793bf0746e723b3d0e58d4c64
BLAKE2b-256 e38f94017d1dfe086623db09ec4f87823808649f0621502d5a872aba0b43e396

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page