Set up the MLflow MCP server
The MLflow MCP (Model Context Protocol) server gives your coding agent live access to your traces and experiments. Once configured, you can ask your agent to search for traces with errors, inspect a specific trace, or log feedback — all from your IDE, without opening the Databricks UI.
To also give your coding agent knowledge of MLflow's APIs so it generates accurate code, set up a coding agent with the MLflow skills.
Prerequisites
-
An MCP-compatible coding agent: Claude Code, Cursor, VS Code, or OpenCode
-
MLflow 3.5.1 or later with the
databricksandmcpextras:Bashpip install 'mlflow[databricks,mcp]>=3.5.1'
Configure your MCP client
Add the MLflow MCP server to your client's configuration file. Replace <your-workspace-url> with your Databricks workspace URL (for example, https://your-workspace.cloud.databricks.com) and <your-token> with a personal access token.
- Claude Code
- Cursor
- VS Code
- OpenCode
Add to .mcp.json in your project root:
{
"mcpServers": {
"mlflow-mcp": {
"command": "uv",
"args": ["run", "--with", "mlflow[databricks,mcp]>=3.5.1", "mlflow", "mcp", "run"],
"env": {
"MLFLOW_TRACKING_URI": "databricks",
"DATABRICKS_HOST": "<your-workspace-url>",
"DATABRICKS_TOKEN": "<your-token>"
}
}
}
}
For details, see Claude Code MCP configuration.
Add to .cursor/mcp.json in your project:
{
"mcpServers": {
"mlflow-mcp": {
"command": "uv",
"args": ["run", "--with", "mlflow[databricks,mcp]>=3.5.1", "mlflow", "mcp", "run"],
"env": {
"MLFLOW_TRACKING_URI": "databricks",
"DATABRICKS_HOST": "<your-workspace-url>",
"DATABRICKS_TOKEN": "<your-token>"
}
}
}
}
Add to .vscode/mcp.json in your project:
{
"servers": {
"mlflow-mcp": {
"command": "uv",
"args": ["run", "--with", "mlflow[databricks,mcp]>=3.5.1", "mlflow", "mcp", "run"],
"env": {
"MLFLOW_TRACKING_URI": "databricks",
"DATABRICKS_HOST": "<your-workspace-url>",
"DATABRICKS_TOKEN": "<your-token>"
}
}
}
}
Add the MLflow MCP server under the mcp key of your opencode.json (project root or ~/.config/opencode/opencode.json):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"mlflow-mcp": {
"type": "local",
"command": ["uv", "run", "--with", "mlflow[databricks,mcp]>=3.5.1", "mlflow", "mcp", "run"],
"environment": {
"MLFLOW_TRACKING_URI": "databricks",
"DATABRICKS_HOST": "<your-workspace-url>",
"DATABRICKS_TOKEN": "<your-token>"
}
}
}
}
For details, see OpenCode MCP servers.
What your coding agent can do
After configuration, ask your agent to:
- "Search for traces with errors from the last hour"
- "Show me the most recent traces from experiment 12345"
- "Get details for trace ID tr-abc123"
- "Add a rating of 5 to trace tr-abc123"
For the full list of available operations, see the MLflow MCP server documentation.
Next steps
- Set up a coding agent — Install MLflow skills for your coding agent
- Tracing overview — Instrument your agent