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.
MLflow MCP Agent consists of two main components:
mlflow_server.py
): Connects to your MLflow tracking server and exposes MLflow functionality through the Model Context Protocol (MCP).mlflow_client.py
): Provides a natural language interface to interact with the MLflow MCP Server using a conversational AI assistant.http://localhost:8080
)Clone this repository:
shell
git clone https://github.com/iRahulPandey/mlflowMCPServer.git
cd mlflowMCPServer
Create a virtual environment:
shell
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
Install the required packages:
shell
pip install mcp[cli] langchain-mcp-adapters langchain-openai langgraph mlflow
Set your OpenAI API key:
shell
export OPENAI_API_KEY=your_key_here
(Optional) Configure the MLflow tracking server URI:
shell
export MLFLOW_TRACKING_URI=http://localhost:8080
First, start the MLflow MCP server:
python mlflow_server.py
The server connects to your MLflow tracking server and exposes MLflow functionality via MCP.
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:
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 keyMODEL_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_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.mcp server for mlflow
No releases published
No packages published