Docker Isolation
Sandbox every stdio MCP server in a throwaway Docker container so a compromised or malicious server can't touch your host filesystem, environment variables, or SSH keys.
Why isolate stdio servers?
An MCP server you run via stdio is just a subprocess — by default it inherits your full user privileges. That means any tool the AI agent calls runs with read/write access to your $HOME, your ~/.aws, your ~/.ssh/id_rsa, and any environment variable in your shell.
Most published MCP servers are fine. But the threat model is asymmetric: one compromised npm package or PyPI release that ends up registered as an MCP server can read your secrets and exfiltrate them through any allowed network call. Docker isolation moves that blast radius from "your laptop" to "a temporary container with no access to your home directory."
How it works
When Docker isolation is enabled, mcpproxy intercepts every stdio server it would normally launch as a child process and instead runs it inside a pre-pulled container image matching the runtime:
npx/npm/node/yarn→node:22uvx/pip/python→ghcr.io/astral-sh/uv:python3.13-bookworm-slimgo→golang:1.21-alpinecargo/rustc→rust:1.75-slimsh/bash→alpine:3.18
The container shares no volumes with the host by default. mcpproxy speaks to the server over the container's stdio. Cache volumes (for npm/pip/cargo registries) speed up restarts but live in named Docker volumes — they don't expose your host caches.
Defaults
- Auto-enabled on first run when Docker is reachable. mcpproxy probes
docker infoat install time. If the daemon is up, isolation defaults toenabled: true. - Off by default when Docker is missing, with no fallback warning at runtime — stdio servers run unsandboxed. Install Docker Desktop and toggle it on from the wizard or Settings.
- Per-server overrides — you can opt individual servers in or out via
isolation.enabledinmcp_config.jsonor the server detail page.
Trade-offs
- Cold start cost. First launch of a server pulls the image (~50–500 MB). Subsequent restarts are near-instant thanks to the cache volume.
- No host filesystem access by design. If your server intentionally needs access to a host directory (e.g. a filesystem MCP scoped to
~/projects), add it to the per-server isolation overrides — don't disable isolation globally. - Network is bridge-mode by default. Outbound TCP works; no inbound exposure.
Config keys
{
"docker_isolation": {
"enabled": true,
"enable_cache_volume": true,
"memory_limit": "512m",
"cpu_limit": "1.0",
"network_mode": "bridge",
"timeout": "30s"
}
} Related
- Server quarantine — second line of defence: even isolated servers get held until you approve them.
- Full configuration reference