devcontainer-mcp MCP server: features and setup for Claude Code
Runs agent builds, tests, and terminal commands inside isolated dev containers. Keeps your host machine clean by routing work to Docker, DevPod, or GitHub Codespaces.
Open on GitHubWhat devcontainer-mcp does
The server connects coding assistants to the devcontainer specification. Instead of altering your local setup, the assistant operates inside containers defined by .devcontainer/devcontainer.json. Supported backends include local Docker, remote DevPod instances, and GitHub Codespaces. Your operating system stays untouched.
Under the hood, the server delegates work to CLI binaries like gh, devpod, or the @devcontainers/cli package. A built-in auth broker manages credentials for GitHub, AWS, Azure, GCP, and Kubernetes without exposing secret tokens to the language model. If a required CLI tool is missing, the server returns an error explaining how to install it.
Installation sets up guard hooks for Claude Code and GitHub Copilot CLI. The devcontainer-guard hook intercepts shell executions on the host, permitting only safe tools like git and gh. To bypass host blocking for a single command, include USER_CONFIRMED_HOST_OPERATION=1. You can also drop a .devcontainer-mcp-disable file in the project root to deactivate the hooks entirely.
What it helps with
- Run build scripts and tests inside isolated Docker containers
- Spin up cloud development workspaces on GitHub Codespaces
- Block coding agents from executing untrusted commands on the host machine
- Connect to cloud providers without revealing raw authentication tokens
Example prompts for the agent
- Run the project test suite inside the dev container
- Create a Codespace for this repository and compile the code
- Check GitHub authentication status before launching DevPod
How to install devcontainer-mcp
Install
The MCP registry has no launch command for it: see the repository README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about devcontainer-mcp
How do I install devcontainer-mcp?
On Linux or macOS, run curl -fsSL https://raw.githubusercontent.com/aniongithub/devcontainer-mcp/main/install.sh | bash. On Windows with WSL 2, run Invoke-RestMethod https://github.com/aniongithub/devcontainer-mcp/releases/latest/download/install.ps1 | Invoke-Expression in PowerShell.
What does devcontainer-mcp do?
It exposes MCP tools that allow AI assistants to manage and work within dev containers. Commands execute inside Docker, DevPod, or Codespaces rather than directly on your host machine.
How do I bypass the host command guard?
Prepend USER_CONFIRMED_HOST_OPERATION=1 to run a single command directly on your host. To deactivate the guard hooks for an entire project, place a .devcontainer-mcp-disable file in the repository root.