Multi-runtime container management MCP server supporting nerdctl, podman, and docker.
polyglot-container-mcp provides unified access to multiple container runtimes through a single MCP (Model Context Protocol) interface. Following a FOSS-first approach, it prioritizes nerdctl and podman over Docker.
-
90+ tools across 3 container runtimes
-
Unified interface for container, image, network, volume, and compose operations
-
Auto-detection of available runtimes
-
FOSS base images: Wolfi, Alpine, Fedora (no proprietary dependencies)
-
Type-safe core using ReScript
-
Secure command execution with whitelist validation
At least one container runtime:
# FOSS Preferred: nerdctl (containerd)
# https://github.com/containerd/nerdctl
# FOSS: podman
sudo dnf install podman # Fedora/RHEL
brew install podman # macOS
# Fallback: docker (if you must)git clone https://github.com/hyperpolymath/polyglot-container-mcp.git
cd polyglot-container-mcp
deno task start| Tool | Description |
|---|---|
|
List all available runtimes and connection status |
|
Auto-detect and connect to available runtimes |
|
Set preferred runtime (nerdctl, podman, docker, auto) |
|
Get help for specific runtime or all tools |
|
Get version information |
Each runtime provides tools with its name prefix (nerdctl_*, podman_*, docker_*):
| Tool | Description |
|---|---|
|
Run a new container |
|
List containers |
|
Stop running containers |
|
Start stopped containers |
|
Restart containers |
|
Remove containers |
|
Fetch container logs |
|
Execute command in container |
|
Inspect container details |
|
Copy files to/from container |
| Tool | Description |
|---|---|
|
List images |
|
Pull image from registry |
|
Push image to registry |
|
Build image from Containerfile |
|
Tag an image |
|
Remove images |
|
Save image to tar archive |
|
Load image from tar archive |
| Tool | Description |
|---|---|
|
List networks |
|
Create a network |
|
Remove networks |
|
Inspect network details |
| Tool | Description |
|---|---|
|
List volumes |
|
Create a volume |
|
Remove volumes |
|
Inspect volume details |
| Tool | Description |
|---|---|
|
Start compose services |
|
Stop compose services |
|
List compose services |
|
View compose logs |
# Runtime selection
CONTAINER_RUNTIME=auto # auto, nerdctl, podman, docker
# nerdctl configuration
NERDCTL_PATH=/usr/bin/nerdctl
NERDCTL_NAMESPACE=default
NERDCTL_HOST=unix:///run/containerd/containerd.sock
NERDCTL_SNAPSHOTTER=overlayfs
# podman configuration
PODMAN_PATH=/usr/bin/podman
PODMAN_HOST=unix:///run/user/1000/podman/podman.sock
# docker configuration (fallback)
DOCKER_PATH=/usr/bin/docker
DOCKER_HOST=unix:///var/run/docker.sock| Variant | Base | Tag | Size |
|---|---|---|---|
Primary |
Wolfi |
|
~50MB |
Alpine |
Alpine 3.21 |
|
~45MB |
Fedora |
Fedora Minimal 41 |
|
~80MB |
Cerro-Torre |
Cerro-Torre (Alpha) |
|
TBD |
polyglot-container-mcp/
├── index.js # Main MCP server
├── deno.json # Deno configuration
├── Containerfile # Wolfi (primary)
├── Containerfile.alpine # Alpine variant
├── Containerfile.fedora # Fedora variant
├── Containerfile.cerro-torre # Cerro-Torre (alpha)
├── adapters/
│ ├── nerdctl.js # nerdctl adapter (30 tools)
│ ├── podman.js # podman adapter (30 tools)
│ └── docker.js # docker adapter (30 tools)
├── src/ # ReScript source
│ ├── Executor.res # Safe command execution
│ ├── Adapter.res # Adapter interface
│ └── bindings/
│ └── Deno.res # Deno API bindings
├── lib/es6/ # Compiled ReScript
├── STATE.scm # Project state
├── META.scm # Architecture decisions
└── AI.scm # AI instructionsAll runtimes support nested containers (containers running inside containers):
The simplest way to run nested containers:
# nerdctl - mounts containerd socket
nerdctl_run image="alpine" nested=true
# podman - mounts podman socket (rootless-friendly)
podman_run image="alpine" nested=true userns="keep-id"
# docker - mounts docker socket (DinD)
docker_run image="alpine" nested=trueFor fine-grained control:
| Parameter | Description |
|---|---|
|
Run in privileged mode (required for some nested setups) |
|
Security options, e.g., "label=disable" |
|
Cgroup namespace mode: "host" or "private" |
|
(Podman) User namespace mode, e.g., "keep-id" |
nerdctl: Mounts /run/containerd/containerd.sock and /var/lib/containerd
podman: Mounts user’s podman socket, sets CONTAINER_HOST, disables SELinux labels. Best rootless support with userns=keep-id.
docker: Traditional Docker-in-Docker via /var/run/docker.sock. Requires privileged mode.
-
Command whitelist: Only specific container commands allowed
-
Argument sanitization: Shell metacharacters stripped
-
No shell execution: Uses
Deno.Commanddirectly -
Non-root containers: All images run as non-root by default
See SECURITY.adoc for security policy and reporting vulnerabilities.
# Start server
deno task start
# Development with watch
deno task dev
# Build ReScript
deno task res:build
# Watch ReScript
deno task res:watch
# Format code
deno fmt-
polyglot-db-mcp - Multi-database MCP server
-
Cerro-Torre - Supply-chain verified container distribution
MIT License - see LICENSE file.
See CONTRIBUTING.adoc for contribution guidelines.
Report issues and request features at:
https://github.com/hyperpolymath/polyglot-container-mcp/issues