containerd MCP Server in Rust for CRI
Deploy a Rust-based containerd MCP server that supports the CRI interface for efficient, secure container runtime operations.
npx -y @jokemanfire/mcp-containerdOverview
The containerd MCP Server is a Rust implementation of a Model Context Protocol (MCP) endpoint that speaks the Kubernetes Container Runtime Interface (CRI). It acts as a CRI-compatible runtime shim or adapter that lets containerd forward container lifecycle operations (create/start/stop/etc.) to a backend that understands model-context-aware semantics. Written in Rust for safety and performance, the server is intended for workflows that need tight, secure integration between container lifecycle management and model-serving or inference orchestration.
Using an MCP server between containerd and a model-serving backend enables standardized, low-latency management of containers that host models or model-adjacent services. The server can be deployed alongside containerd and configured as a CRI endpoint (or plugin adapter), enabling existing tools (kubectl, kubelet, crictl, higher-level orchestration) to manage model-bearing containers without changing their CRI-based control plane.
Repository: https://github.com/jokemanfire/mcp-containerd
Features
- Rust-based implementation for memory safety and predictable performance
- Exposes a CRI-compatible gRPC endpoint so containerd/kubelet/crictl can use it transparently
- Model Context Protocol (MCP) semantics to attach model metadata, security context, and routing information to container lifecycle events
- TLS support for secure gRPC communication
- Lightweight runtime suitable for edge and cloud environments
- Clear CLI for socket and credential configuration
Installation / Configuration
Prerequisites:
- Rust toolchain (stable)
- containerd (v1.7+ recommended)
- crictl for quick testing (optional)
- systemd if you want to run as a service
Build from source:
# clone repository
# build release binary
# result: target/release/mcp-containerd
Run locally (development):
# example: listen on a unix socket for CRI traffic and point to model backend socket
Common CLI flags (example):
| Flag | Description | Example |
|---|---|---|
| –cri-socket | Path to UNIX socket to expose CRI endpoint | /run/mcp-containerd.sock |
| –model-backend-socket | Local socket to communicate with model backend | /var/run/model.sock |
| –tls-cert | TLS certificate for gRPC server | /etc/mcp/cert.pem |
| –tls-key | TLS private key | /etc/mcp/key.pem |
| –insecure | Disable TLS (development only) | –insecure |
Systemd unit example:
[Unit]
MCP containerd adapter
network.target
[Service]
simple
/usr/local/bin/mcp-containerd \
--cri-socket /run/mcp-containerd.sock \
--model-backend-socket /var/run/model-backend.sock \
--tls-cert /etc/mcp/cert.pem \
--tls-key /etc/mcp/key.pem
on-failure
[Install]
multi-user.target
Pointing crictl (for testing):
# Use crictl to query the MCP-exposed CRI endpoint
Integrating with containerd:
- You can run the MCP server as a parallel CRI endpoint and point kubelet or crictl at it.
- Alternatively, configure containerd to use an outboard CRI shim or plugin that forwards to the MCP socket (containerd configuration varies by version and environment).
Available Tools / Resources
- GitHub repository with source, issues, and examples: https://github.com/jokemanfire/mcp-containerd
- crictl — lightweight CRI client for testing: https://github.com/kubernetes-sigs/cri-tools
- containerd documentation for CRI and plugin configuration: https://containerd.io/docs/
- Rust toolchain and Cargo for building: https://www.rust-lang.org/tools/install
Use the repository issues and README for up-to-date configuration examples and binary releases.
Use Cases
Model-aware container lifecycle
- Attach model identifiers, versions, or tenant metadata to containers at creation time so the runtime and network stack can enforce routing and policy for inference workloads.
Secure inference in multi-tenant environments
- Use TLS and model-context isolation to ensure that containers running sensitive model code are started with constrained privileges and network policies, applied by the model backend once the MCP server communicates context.
Edge deployments
- Lightweight Rust binary is suitable for edge nodes where you need a CRI-compatible runtime adapter that hands off model-specific work to a local model-serving process or accelerator manager.
Integration with custom runtimes
- Use the MCP server as a bridge between containerd and non-standard runtimes that require additional metadata or lifecycle hooks related to machine learning models, hardware allocation (e.g., GPUs/accelerators), or resource reservations.
Getting Help
- Open an issue on the GitHub repository for bugs and feature requests.
- Check the repo for example configurations and tests that demonstrate typical CRI workflows.
- For containerd integration questions, refer to containerd docs and the crictl tool to validate endpoints and runtime behavior.