MLflow MCP server

Provides a natural language interface to MLflow tracking servers for querying and managing machine learning experiments and models through standardized tools for listing models, exploring experiments, and retrieving detailed information.
Back to servers
Setup instructions
Provider
Rahul Pandey
Release date
Mar 21, 2025
Language
Python
Stats
10 stars

The MLflow MCP Server provides a natural language interface to MLflow using the Model Context Protocol (MCP). This tool allows you to query your MLflow tracking server with plain English commands, making it easier to manage and explore your machine learning experiments and models without memorizing specific MLflow commands.

Installation Options

Using Smithery

Install MLflow MCP Server automatically via Smithery:

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

Manual Installation

  1. Clone the repository and navigate to the project directory:
git clone https://github.com/iRahulPandey/mlflowMCPServer.git
cd mlflowMCPServer
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install required packages:
pip install mcp[cli] langchain-mcp-adapters langchain-openai langgraph mlflow
  1. Set your OpenAI API key:
export OPENAI_API_KEY=your_key_here
  1. Optional: Configure the MLflow tracking server URI:
export MLFLOW_TRACKING_URI=http://localhost:8080

Using the MLflow MCP Server

Starting the Server

Start the MLflow MCP server:

python mlflow_server.py

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

Making Natural Language Queries

Once the server is running, use the client to make queries in plain English:

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

Customize behavior using these 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)

Available MCP Tools

The server exposes these MLflow functions:

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

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "mlflow-mcp-server" '{"command":"python","args":["mlflow_server.py"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "mlflow-mcp-server": {
            "command": "python",
            "args": [
                "mlflow_server.py"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "mlflow-mcp-server": {
            "command": "python",
            "args": [
                "mlflow_server.py"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later