The ZenML MCP server provides a standardized way to interact with your ZenML platform through the Model Context Protocol (MCP). This integration allows AI assistants to access information about your ML pipelines, runs, artifacts, and more directly from your ZenML server.
Before setting up the ZenML MCP server, you'll need:
uv
package manager installed on your system (recommended for easy setup)Clone the repository to your local machine:
git clone https://github.com/zenml-io/mcp-zenml.git
You'll need to create an MCP configuration file that tells your AI assistant how to connect to the ZenML server.
Create a JSON configuration file with the following structure:
{
"mcpServers": {
"zenml": {
"command": "/usr/local/bin/uv",
"args": ["run", "path/to/server/zenml_server.py"],
"env": {
"LOGLEVEL": "INFO",
"NO_COLOR": "1",
"PYTHONUNBUFFERED": "1",
"PYTHONIOENCODING": "UTF-8",
"ZENML_STORE_URL": "https://your-zenml-server-goes-here.com",
"ZENML_STORE_API_KEY": "your-api-key-here"
}
}
}
}
Make sure to replace the following:
uv
installationzenml_server.py
file in your cloned repositoryClaude Desktop provides the simplest integration method:
mcp-zenml.dxt
file from the repository root onto the settings panelFor better readability of ZenML tool results, configure Claude's preferences:
When using zenml tools which return JSON strings and you're asked a question, you might want to consider using markdown tables to summarize the results or make them easier to view!
This helps Claude format ZenML data more readably.
To set up the ZenML MCP server with Cursor:
.cursor
folder in the root of your repositorymcp.json
file with your configuration (as shown above)Note: Cursor may sometimes show an error indicator even when the connection is working. You can verify functionality by testing it in the Cursor chat window.
Once connected, you can use the MCP server to access:
You can also trigger new pipeline runs if a run template is available.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "zenml" '{"command":"/usr/local/bin/uv","args":["run","path/to/zenml_server.py"],"env":{"LOGLEVEL":"INFO","NO_COLOR":"1","PYTHONUNBUFFERED":"1","PYTHONIOENCODING":"UTF-8","ZENML_STORE_URL":"https://your-zenml-server-goes-here.com","ZENML_STORE_API_KEY":"your-api-key-here"}}'
See the official Claude Code MCP documentation for more details.
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.
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": {
"zenml": {
"command": "/usr/local/bin/uv",
"args": [
"run",
"path/to/zenml_server.py"
],
"env": {
"LOGLEVEL": "INFO",
"NO_COLOR": "1",
"PYTHONUNBUFFERED": "1",
"PYTHONIOENCODING": "UTF-8",
"ZENML_STORE_URL": "https://your-zenml-server-goes-here.com",
"ZENML_STORE_API_KEY": "your-api-key-here"
}
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"zenml": {
"command": "/usr/local/bin/uv",
"args": [
"run",
"path/to/zenml_server.py"
],
"env": {
"LOGLEVEL": "INFO",
"NO_COLOR": "1",
"PYTHONUNBUFFERED": "1",
"PYTHONIOENCODING": "UTF-8",
"ZENML_STORE_URL": "https://your-zenml-server-goes-here.com",
"ZENML_STORE_API_KEY": "your-api-key-here"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect