Skip to main content

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
  • Advanced Sorting: Sort runs by any metric/parameter with flexible field selection
  • 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

Available Tools

Experiments

  • get_experiments() - List all experiments
  • get_experiment_by_name(name) - Get experiment by name
  • get_experiment_metrics(experiment_id) - Discover all unique metrics
  • get_experiment_params(experiment_id) - Discover all unique parameters

Runs

  • get_runs(experiment_id, limit=5, include_details=False) - Get runs for an experiment
  • get_run(run_id) - Get detailed run information
  • get_runs_sorted(experiment_id, sort_by, ascending=False, limit=10, include_metrics=False, include_params=False, include_tags=False) - Get runs sorted by metric/parameter with field selection
  • query_runs(experiment_id, query, limit=5, include_details=False) - Filter runs (e.g., "metrics.accuracy > 0.9")
  • search_runs_by_tags(experiment_id, tags, limit=5, include_details=False) - Find runs by tags

Metrics & Parameters

  • get_run_metrics(run_id) - Get all metrics for a run
  • get_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 artifact
  • get_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 metric (supports special characters)
  • compare_runs(experiment_id, run_ids, include_all_data=False) - Side-by-side comparison

Model Registry

  • get_registered_models() - List all registered models
  • get_model_versions(model_name) - Get all versions of a model
  • get_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"

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


Download files

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

Source Distribution

mlflow_mcp-0.1.5.tar.gz (178.4 kB view details)

Uploaded Source

Built Distribution

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

mlflow_mcp-0.1.5-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file mlflow_mcp-0.1.5.tar.gz.

File metadata

  • Download URL: mlflow_mcp-0.1.5.tar.gz
  • Upload date:
  • Size: 178.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mlflow_mcp-0.1.5.tar.gz
Algorithm Hash digest
SHA256 4f83ac90fa3f130fe73251d490395b5979861d37821795ed6cb6034b8a26db70
MD5 3c04cb758486a8628f62c943920a28b7
BLAKE2b-256 5fd6db20b0ad03f8ef2e14b7c57d40fa15e5a27e6480a2ad84bb08e7b5d9edb3

See more details on using hashes here.

Provenance

The following attestation bundles were made for mlflow_mcp-0.1.5.tar.gz:

Publisher: python-publish.yml on kkruglik/mlflow-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mlflow_mcp-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: mlflow_mcp-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mlflow_mcp-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c13594c5e19660f67e2594ad8c0c52eb6c14aa91a958b681c3c6e9537de39623
MD5 8726efb3a941ec130e0836409eced249
BLAKE2b-256 ebba589e0002e971458d902c36cf48149bcef7109598cea6b006ee3efef30aa8

See more details on using hashes here.

Provenance

The following attestation bundles were made for mlflow_mcp-0.1.5-py3-none-any.whl:

Publisher: python-publish.yml on kkruglik/mlflow-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page