Skip to main content

MCP server for mlflow

Project description

MLflow MCP Server: Natural Language Interface for MLflow

smithery badge

This project provides a natural language interface to MLflow via the Model Context Protocol (MCP). It allows you to query your MLflow tracking server using plain English, making it easier to manage and explore your machine learning experiments and models.

Overview

MLflow MCP Agent consists of two main components:

  1. MLflow MCP Server (mlflow_server.py): Connects to your MLflow tracking server and exposes MLflow functionality through the Model Context Protocol (MCP).

  2. MLflow MCP Client (mlflow_client.py): Provides a natural language interface to interact with the MLflow MCP Server using a conversational AI assistant.

Features

  • Natural Language Queries: Ask questions about your MLflow tracking server in plain English
  • Model Registry Exploration: Get information about your registered models
  • Experiment Tracking: List and explore your experiments and runs
  • System Information: Get status and metadata about your MLflow environment

Prerequisites

  • Python 3.8+
  • MLflow server running (default: http://localhost:8080)
  • OpenAI API key for the LLM

Installation

Installing via Smithery

To install MLflow Natural Language Interface Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @iRahulPandey/mlflowMCPServer --client claude

Manual Installation

  1. Clone this repository:

    git clone https://github.com/iRahulPandey/mlflowMCPServer.git
    cd mlflowMCPServer
    
  2. Create a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  3. Install the required packages:

    pip install mcp[cli] langchain-mcp-adapters langchain-openai langgraph mlflow
    
  4. Set your OpenAI API key:

    export OPENAI_API_KEY=your_key_here
    
  5. (Optional) Configure the MLflow tracking server URI:

    export MLFLOW_TRACKING_URI=http://localhost:8080
    

Usage

Starting the MCP Server

First, start the MLflow MCP server:

python mlflow_server.py

The server connects to your MLflow tracking server and exposes MLflow functionality via MCP.

Making Queries

Once the server is running, you can make natural language queries using the client:

python mlflow_client.py "What models do I have registered in MLflow?"

Example Queries:

  • "Show me all registered models in MLflow"
  • "List all my experiments"
  • "Get details for the model named 'iris-classifier'"
  • "What's the status of my MLflow server?"

Configuration

You can customize the behavior using environment variables:

  • MLFLOW_TRACKING_URI: URI of your MLflow tracking server (default: http://localhost:8080)
  • OPENAI_API_KEY: Your OpenAI API key
  • MODEL_NAME: The OpenAI model to use (default: gpt-3.5-turbo-0125)
  • MLFLOW_SERVER_SCRIPT: Path to the MLflow MCP server script (default: mlflow_server.py)
  • LOG_LEVEL: Logging level (default: INFO)

MLflow MCP Server (mlflow_server.py)

The server connects to your MLflow tracking server and exposes the following tools via MCP:

  • list_models: Lists all registered models in the MLflow model registry
  • list_experiments: Lists all experiments in the MLflow tracking server
  • get_model_details: Gets detailed information about a specific registered model
  • get_system_info: Gets information about the MLflow tracking server and system

Limitations

  • Currently only supports a subset of MLflow functionality
  • The client requires internet access to use OpenAI models
  • Error handling may be limited for complex MLflow operations

Future Improvements

  • Add support for MLflow model predictions
  • Improve the natural language understanding for more complex queries
  • Add visualization capabilities for metrics and parameters
  • Support for more MLflow operations like run management and artifact handling

Acknowledgments

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

iflow_mcp_irahulpandey_mlflowagent-0.1.0.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

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

File details

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

File metadata

  • Download URL: iflow_mcp_irahulpandey_mlflowagent-0.1.0.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_irahulpandey_mlflowagent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0740699f38ceb09bca160064ca5216aedb41ce6d8e40f88b6b26aa650bf2a60e
MD5 0643074ff74b3208bc4dea15b97b48d8
BLAKE2b-256 25a16b75e92edcc470c6a6a37539293cd8e4e6bfcabc27c925756aa6213132f3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: iflow_mcp_irahulpandey_mlflowagent-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_irahulpandey_mlflowagent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5eba62c0a477a5e151ce0fe47db0e220f58727ee34420dd90b8c3c90071e1785
MD5 1e307d0cc2796908b074f5c9d4404961
BLAKE2b-256 953bba1db31d477cd81e3a430ce0c37aa528c6d1c2544f9d9756fc6913632c42

See more details on using hashes here.

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