A Model Context Protocol (MCP) server for MLflow - enables LLMs to interact with MLflow experiments, runs, metrics, and models
Project description
MLflow MCP Server
A Model Context Protocol (MCP) server that enables LLMs to interact with MLflow tracking servers. Query experiments, analyze runs, compare metrics, and explore the model registry - all through natural language.
Features
- Experiment Management: List and search experiments, discover available metrics and parameters
- Run Analysis: Retrieve run details, query runs with filters, find best performing models
- Metrics & Parameters: Get metric histories, compare parameters across runs
- Artifacts: Browse and download run artifacts
- Model Registry: Access registered models, versions, and deployment stages
- Comparison Tools: Side-by-side run comparisons, best run selection
- Tag-based Search: Filter runs by custom tags
Installation
Using uvx (Recommended)
# Run directly without installation
uvx mlflow-mcp
# Or install globally
pip install mlflow-mcp
From Source
git clone https://github.com/kirillkruglikov/mlflow-mcp.git
cd mlflow-mcp
uv sync
uv run mlflow-mcp
Configuration
Claude Desktop
Add to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/claude/claude_desktop_config.json
{
"mcpServers": {
"mlflow": {
"command": "uvx",
"args": ["mlflow-mcp"],
"env": {
"MLFLOW_TRACKING_URI": "http://localhost:5000"
}
}
}
}
Environment Variables
MLFLOW_TRACKING_URI(required): Your MLflow tracking server URL- Examples:
http://localhost:5000,https://mlflow.company.com
- Examples:
Available Tools
Experiments
get_experiments()- List all experimentsget_experiment_by_name(name)- Get experiment by nameget_experiment_metrics(experiment_id)- Discover all unique metricsget_experiment_params(experiment_id)- Discover all unique parameters
Runs
get_runs(experiment_id, limit=10)- Get runs for an experimentget_run(run_id)- Get detailed run informationquery_runs(experiment_id, query, limit=10)- Filter runs (e.g.,"metrics.accuracy > 0.9")search_runs_by_tags(experiment_id, tags)- Find runs by tags
Metrics & Parameters
get_run_metrics(run_id)- Get all metrics for a runget_run_metric(run_id, metric_name)- Get full metric history with steps
Artifacts
get_run_artifacts(run_id, path="")- List artifacts (supports browsing directories)get_run_artifact(run_id, artifact_path)- Download artifactget_artifact_content(run_id, artifact_path)- Read artifact content (text/json)
Analysis & Comparison
get_best_run(experiment_id, metric, ascending=False)- Find best run by metriccompare_runs(experiment_id, run_ids)- Side-by-side comparison
Model Registry
get_registered_models()- List all registered modelsget_model_versions(model_name)- Get all versions of a modelget_model_version(model_name, version)- Get version details with metrics
Health
health()- Check server connectivity
Usage Examples
Ask Claude
"Show me all experiments in MLflow"
"What are the top 5 runs by accuracy in experiment 'my-experiment'?"
"Compare runs abc123 and def456"
"Which model has the highest F1 score?"
"Show me the training loss curve for run xyz789"
"List all production models in the registry"
Development
# Install dependencies
uv sync
# Run server
uv run mlflow-mcp
# Run tests
uv run pytest
# Format code
uv run black src/
uv run ruff check src/
Requirements
- Python >=3.10
- MLflow >=3.4.0
- Access to an MLflow tracking server
License
MIT License - see LICENSE file for details.
Contributing
Contributions welcome! Please open an issue or submit a pull request.
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mlflow_mcp-0.1.0.tar.gz.
File metadata
- Download URL: mlflow_mcp-0.1.0.tar.gz
- Upload date:
- Size: 176.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19dd716de99cfe442eeeb401f7854633f64d9f52e34b96834aaa5e8dbdba6049
|
|
| MD5 |
5a525bdf6294306207379194b723702e
|
|
| BLAKE2b-256 |
6bfff62651b5359bf72e16cd6a5dcf3d94e93df5d12e26f700b541232457b662
|
File details
Details for the file mlflow_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mlflow_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d598fbb736a6c447b885af2da61e4879adb9c466a372d42f6eea2e0378106969
|
|
| MD5 |
773d3d188fe17f47db568e039fc30b3f
|
|
| BLAKE2b-256 |
0df5b03fd62330c2d489583c624e62995fabc708a9242aefaaf1c6614ad0527e
|