ZE
OfficialAI & ML

ZenML MCP Server for MLOps and LLMOps

Manage MLOps and LLMOps pipelines with your ZenML MCP server to monitor, deploy, and optimize models and workflows.

Quick Install
npx -y @zenml-io/mcp-zenml

Overview

The ZenML MCP (Model Context Protocol) server is a lightweight service that centralizes management for MLOps and LLMOps workflows. It provides a single place to register models, track runs and artifacts, coordinate deployments, and expose runtime metadata used by pipelines and model-serving components. By standardizing how pipelines and model operations exchange context (metadata, inputs, outputs, and monitoring information), the MCP server helps teams maintain reproducible pipelines and operationalize models across environments.

For developers, the MCP server is useful as a coordination and observability layer that integrates with existing artifact stores, model registries, and orchestration systems. It is designed to be run locally for development, in CI, or deployed in production (Docker/Kubernetes), and exposes REST APIs and client SDK hooks so ZenML pipelines and other orchestration pieces can publish and consume context information consistently.

Features

  • Centralized registry for models, versions, and artifacts
  • REST API for registering runs, models, and pipeline metadata
  • Lightweight server suitable for local development and production deployment
  • Pluggable storage backends (object stores, SQL databases) and configuration
  • Web UI and/or API-driven inspection of runs, models, and metrics
  • Integration points for deployment workflows and monitoring tools
  • Authentication and API key support for multi-user environments
  • Designed to support both traditional MLOps pipelines and LLMOps workflows

Installation / Configuration

Quick start (local development):

# clone the repository
git clone https://github.com/zenml-io/mcp-zenml.git
cd mcp-zenml

# build Docker image (optional)
docker build -t mcp-zenml:latest .

# run locally with Docker
docker run -p 8080:8080 \
  -e MCP_DATABASE_URL=postgresql://postgres:password@localhost:5432/mcp \
  -e MCP_ARTIFACT_STORE=s3://my-bucket/mcp \
  mcp-zenml:latest

Example docker-compose.yml (development):

version: "3.8"
services:
  mcp-server:
    image: mcp-zenml:latest
    ports:
      - "8080:8080"
    environment:
      - MCP_DATABASE_URL=postgresql://postgres:password@postgres:5432/mcp
      - MCP_ARTIFACT_STORE=s3://my-bucket/mcp
      - MCP_API_KEY=dev-secret-key
    depends_on:
      - postgres

  postgres:
    image: postgres:14
    environment:
      - POSTGRES_PASSWORD=password
      - POSTGRES_DB=mcp
    volumes:
      - pgdata:/var/lib/postgresql/data

volumes:
  pgdata:

Minimal configuration (config.yaml):

server:
  host: "0.0.0.0"
  port: 8080

database:
  url: "postgresql://postgres:password@postgres:5432/mcp"

artifact_store:
  type: "s3"
  uri: "s3://my-bucket/mcp"

auth:
  api_key: "your-api-key"

Common environment variables:

VariablePurposeExample
MCP_DATABASE_URLSQL connection for metadatapostgresql://user:pass@host:5432/db
MCP_ARTIFACT_STOREArtifact store URIs3://bucket/path or file:///tmp/artifacts
MCP_API_KEYAPI key for simple authmy-secret-key
MCP_HOST / MCP_PORTServer binding0.0.0.0 / 8080

Available Resources

  • GitHub repository: https://github.com/zenml-io/mcp-zenml
  • Example configs and integration examples included in the repo (examples/ or docs/)
  • REST API (OpenAPI/Swagger) — typically exposed at /docs or /openapi.json on the running server
  • SDK client for language bindings (Python) to integrate with pipelines and CI
  • Docker image and Dockerfile for containerized deployment
  • Kubernetes manifests / Helm charts (if provided in repo) for production deployments

Check the repository’s README and docs/ directory for up-to-date links and API specs.

Use Cases

  • Model registration and versioning

    • Record a model build, attach artifacts (weights, tokenizer, config), and promote a version to staging/production. Consumers query the MCP server to fetch the production model URI.
  • Pipeline coordination and provenance

    • ZenML pipelines publish run-level context (datasets used, hyperparameters, metrics). The MCP server stores this lineage so you can reproduce or debug runs later.
  • LLMOps metadata management

    • Track prompts, system messages, and response artifacts as first-class objects. Use MCP to compare prompt versions and track evaluation scores for different prompt sets.
  • Deployment orchestration

    • Orchestrators or CI systems query the MCP server to determine which model version to deploy (based on tags or metrics), and then trigger rollout to serving infrastructure.
  • Monitoring and drift detection

    • Stream runtime metrics and input distributions to the MCP server, where they can be consumed by monitoring tools or dashboards to detect model drift and trigger retraining.

Concrete examples

  • Registering a model (curl):
curl -X POST http://localhost:8080/api/models \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "image-classifier",
    "version": "v1.2.0",
    "artifact_uri": "s3://my-bucket/models/image-classifier/v1.2.0",
    "metrics": {"accuracy": 0.92}
  }'
  • Marking a run complete from a pipeline (Python pseudocode):
from mcp_client import MCPClient
client = MCPClient(base_url="http://localhost:8080", api_key="your-api-key")

run = client.runs.create(name="train-2026-04-10", params={"lr": 1e-3})
client.runs.log_metrics(run.id, {"val_loss": 0.12})
client.runs.complete(run.id, artifacts=[{"name":"model","uri":"s3://..."}])

Getting help and next steps

  • Browse the repository for examples, issues, and contribution guidelines.
  • Start by running the server locally with the example docker-compose and explore the API via the OpenAPI UI.
  • Integrate the MCP client into a single ZenML pipeline to publish and query context
Tags:ai-ml