container-mcp

container-mcp

Run AI agents in VM-isolated sandboxes on your Mac.

Category
Visit Server

README

container-mcp

Run AI agents in VM-isolated sandboxes on your Mac.

An MCP server for Apple containers — every container gets its own lightweight VM, which makes it the right isolation boundary for code an AI agent wrote five seconds ago.

Part of a larger toolkit: a native macOS "mission control" GUI for agent sandboxes is in development.

Why

  • VM-per-container isolation — stronger than Docker's shared-kernel model
  • Safe by default — agents can only mount the project directory and temp; everything else requires an explicit allowlist
  • Self-healing errors — every failure tells the agent how to fix it
  • Agent-labeled — every container is tagged with which agent created it

Install

Requires an Apple silicon Mac, macOS 26 or newer, and the container CLI.

claude mcp add container -- npx -y container-mcp

Or in any MCP client config:

{
  "mcpServers": {
    "container": { "command": "npx", "args": ["-y", "container-mcp"] }
  }
}

Tools

Tool Description
run_container Run an image in its own VM (labeled, resource-limited; wait: true runs to completion and returns output)
exec_in_container Run a command in a running container
list_containers / container_logs Inspect state and output
stop_container / remove_container Lifecycle
copy_files Copy between host and container
list_images / pull_image / build_image Image management
system_status Check/start the container system service

Safety model

Env var Default Effect
CONTAINER_MCP_ALLOWED_MOUNTS launch dir + private scratch dir Colon-separated allowlist of host paths agents may mount, copy to/from, or build from. Setting it replaces the default.
CONTAINER_MCP_READONLY off 1/true: only listing, logs, and status work
CONTAINER_MCP_DEFAULT_CPUS 2 CPU limit applied when the agent does not specify one
CONTAINER_MCP_DEFAULT_MEMORY 2g Memory limit applied when the agent does not specify one
CONTAINER_MCP_AGENT_NAME agent Value of the dev.container-mcp.agent label on created containers
CONTAINER_MCP_TIMEOUT_MS 120000 Base CLI timeout in ms. Image pulls/builds and wait-mode runs get 600000 automatically.
CONTAINER_MCP_MAX_CONTAINERS 10 Maximum concurrent containers run_container will create
CONTAINER_MCP_ALLOW_UNMANAGED off 1/true: allow operating on containers not created by this server

Mount sources, build contexts, and dockerfiles must exist and are fully canonicalized (symlinks resolved) before allowlist checks — a path cannot be swapped for a symlink after validation. A launch directory of / or your home directory is never used as an implicit allowlist root. Lifecycle tools (stop, remove, exec, logs, copy) only operate on containers this server created (tagged dev.container-mcp.managed=true) unless CONTAINER_MCP_ALLOW_UNMANAGED is set. Every agent-supplied value that reaches the CLI is guarded against flag injection, and commands are executed with execFile (no shell), so there is no shell injection surface.

Known assumptions

Built against apple/container docs without a live CLI on the dev machine:

  • container exec is invoked with a -- terminator before the agent's command (standard swift-argument-parser convention, not explicitly documented).
  • container cp is used (documented alias of the canonical container copy).
  • container inspect label layout is undocumented; managed-label checks parse it tolerantly and fail closed (override: CONTAINER_MCP_ALLOW_UNMANAGED).

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured