ZenML
The ZenML MCP server acts as a smart bridge that allows AI assistants to understand and interact with machine learning workflows. Think of it as a translator that lets an AI look into a project’s machine learning "factory" to see what is being built, which tools are being used, and …
About this Protocol
How to Use
1. Installation
Prerequisites:
* Access to a deployed ZenML server (ZenML Pro trial available).
* uv installed locally (recommended via installer script or brew).
* Clone the repository locally:
bash
git clone https://github.com/zenml-io/mcp-zenml.git
Option A: Claude Desktop Bundle (Easiest)
* Open Claude Desktop Settings.
* Drag the mcp-zenml.mcpb file from the root of the cloned repository onto the menu.
* Follow the prompts to add your ZenML server URL and API key.
Option B: Docker
* Pull the image:
bash
docker pull zenmldocker/mcp-zenml:latest
* Run directly:
bash
docker run -i --rm \
-e ZENML_STORE_URL="https://your-zenml-server.example.com" \
-e ZENML_STORE_API_KEY="your-api-key" \
zenmldocker/mcp-zenml:latest
2. Configuration
Local Execution (via uv)
To configure the server for Claude Desktop or other MCP hosts using your local clone, use the following structure in your mcpServers config file. You must replace the dummy paths and credentials.
{
"mcpServers": {
"zenml": {
"command": "/usr/local/bin/uv",
"args": ["run", "/path/to/cloned/repo/server/zenml_server.py"],
"env": {
"LOGLEVEL": "WARNING",
"NO_COLOR": "1",
"ZENML_LOGGING_COLORS_DISABLED": "true",
"ZENML_LOGGING_VERBOSITY": "WARN",
"ZENML_ENABLE_RICH_TRACEBACK": "false",
"PYTHONUNBUFFERED": "1",
"PYTHONIOENCODING": "UTF-8",
"ZENML_STORE_URL": "https://your-zenml-server-goes-here.com",
"ZENML_STORE_API_KEY": "your-api-key-here"
}
}
}
}
Docker-based Configuration
If you prefer running via Docker, use this configuration:
{
"mcpServers": {
"zenml": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "ZENML_STORE_URL=https://your-zenml-server.example.com",
"-e", "ZENML_STORE_API_KEY=your-api-key",
"-e", "ZENML_ACTIVE_PROJECT_ID=...",
"-e", "LOGLEVEL=WARNING",
"-e", "NO_COLOR=1",
"-e", "ZENML_LOGGING_COLORS_DISABLED=true",
"-e", "ZENML_LOGGING_VERBOSITY=WARN",
"-e", "ZENML_ENABLE_RICH_TRACEBACK=false",
"-e", "PYTHONUNBUFFERED=1",
"-e", "PYTHONIOENCODING=UTF-8",
"zenmldocker/mcp-zenml:latest"
]
}
}
}
Cursor Configuration
- Create a
.cursorfolder in the root of your repository. - Create an
mcp.jsonfile inside that folder using the configuration provided above. - Enable the ZenML server in Cursor settings.
3. Available Tools
The ZenML MCP server provides tools to access core read functionality and trigger actions:
- Read Access: Retrieve live information about:
- Users and Stacks
- Pipelines and Pipeline runs/steps
- Services and Service Connectors
- Stack components and Flavors
- Pipeline run templates and Schedules
- Artifacts (metadata only)
- Step code and Step logs (for cloud-based stacks)
- Write Access: Trigger new pipeline runs (requires an existing run template).
4. Example Prompts
Improving Tool Output:
To make ZenML data easier to read, you can provide Claude with the following custom preference in Settings → Profile:
"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!"
Use Cases
Use Case 1: Real-time Pipeline Debugging and Log Analysis
Problem: When an ML pipeline fails in production or a remote environment, developers often have to navigate through multiple layers of a web UI or use complex CLI commands to find the specific error logs and the corresponding code that caused the failure.
Solution: This MCP allows an LLM (like Claude) to directly fetch the status of the latest pipeline runs, identify failed steps, and retrieve both the step code and the execution logs. The LLM can then analyze the logs against the code to suggest an immediate fix.
Example: A user asks Claude: "The 'training-pipeline' failed. Can you find the logs for the failed step and tell me why it crashed?" Claude uses the get_pipeline_runs and get_step_logs tools to identify a MemoryError in the 'train_model' step and suggests optimizing the batch size.
Use Case 2: Automated MLOps Infrastructure Auditing
Problem: MLOps engineers often lose track of which "Stacks" (combinations of orchestrators, artifact stores, and secrets managers) are currently configured or which "Service Connectors" are active, leading to configuration drift or security oversights.
Solution: The MCP provides read access to all stack components, flavors, and service connectors. An AI assistant can quickly inventory the entire environment to ensure compliance or help a new team member understand the infrastructure.
Example: A lead engineer asks: "List all active Stacks that use AWS as a provider and check if our 's3-connector' is properly linked to them." The LLM queries the ZenML server and returns a markdown table summarizing the infrastructure.
Use Case 3: On-Demand Pipeline Execution via Natural Language
Problem: Data scientists often need to re-run specific experiments or trigger evaluation pipelines with updated templates, but they may not want to context-switch to a terminal or a dedicated dashboard to execute a standardized workflow.
Solution: If a pipeline run template exists, this MCP enables the LLM to trigger new runs directly. This turns the AI into a "ChatOps" interface for the ML lifecycle.
Example: A researcher says: "I've updated the data in the bucket. Trigger a new run of the 'model-evaluation' pipeline using the 'production-template'." The LLM identifies the template ID and initiates the run, providing the user with a direct link to monitor the progress.
Use Case 4: Artifact Lineage and Data Discovery
Problem: In complex ML systems, it's hard to remember which specific version of a dataset or model was produced by which pipeline run, making it difficult to track down the source of a model's bias or performance dip.
Solution: The MCP provides access to artifact metadata. While it doesn't download the heavy data itself, it allows the LLM to trace the lineage by connecting pipelines, runs, and the resulting artifacts.
Example: A user asks: "Show me the metadata for the model artifact produced by the most recent successful 'churn-prediction' run." Claude retrieves the artifact metadata, showing the timestamp, schema, and which specific pipeline run version created it.
Use Case 5: Daily Performance Summarization
Problem: Managers or project leads need a high-level overview of the health of their ML pipelines (e.g., "How many failed today? Is the schedule running?") without needing to be ZenML power users.
Solution: By leveraging the tool's ability to list runs, schedules, and statuses, an LLM can act as a reporting agent that synthesizes technical pipeline data into a human-readable summary.
Example: A team lead asks: "Give me a summary of all pipeline activity from the last 24 hours." The LLM fetches the recent runs, identifies that 8 succeeded and 1 failed due to a timeout, and notes that the daily data-ingestion schedule is running on time.