# devcontainer-mcp [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/aniongithub/devcontainer-mcp  
**GitHub Stars:** 28  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/devcontainer-mcp

## Description
Manage dev container environments via MCP (Docker, DevPod, Codespaces).

## Tools
Capabilities this server exposes over MCP:

- **auth_status** — Check auth for a provider — returns handles, accounts, scopes
- **auth_login** — Initiate login or refresh scopes — browser + device code flow
- **auth_select** — Switch the active account for a provider
- **auth_logout** — Revoke credentials for an account
- **devpod_up** — Create and start a workspace from a git URL, local path, or image
- **devpod_stop** — Stop a running workspace
- **devpod_delete** — Delete a workspace and its resources
- **devpod_build** — Build a workspace image without starting it
- **devpod_status** — Get workspace state (`Running`, `Stopped`, `Busy`, `NotFound`)
- **devpod_list** — List all workspaces with IDs, sources, providers, and status
- **devpod_ssh** — Execute a command inside a workspace via SSH
- **devpod_logs** — Get workspace logs
- **devpod_provider_list** — List all configured providers
- **devpod_provider_add** — Add a new provider
- **devpod_provider_delete** — Remove a provider
- **devpod_context_list** — List all contexts
- **devpod_context_use** — Switch to a different context
- **devpod_container_inspect** — Docker inspect — labels, ports, mounts, state
- **devpod_container_logs** — Stream container logs via Docker API
- **devpod_file_read** — Read file content with optional line range
- **devpod_file_write** — Create or overwrite a file (auto-creates parent dirs)
- **devpod_file_edit** — Surgical string replacement — old_str → new_str
- **devpod_file_list** — List directory contents (non-hidden, 2 levels deep)
- **devcontainer_up** — Create and start a local dev container
- **devcontainer_exec** — Execute a command inside a running dev container
- **devcontainer_build** — Build a dev container image
- **devcontainer_read_config** — Read merged devcontainer configuration as JSON
- **devcontainer_list_configs** — Discover all devcontainer.json files in a workspace (single + multi-container)
- **devcontainer_stop** — Stop a dev container (via Docker API)
- **devcontainer_remove** — Remove a dev container and its resources
- **devcontainer_status** — Get dev container state by workspace folder
- **devcontainer_file_read** — Read file content with optional line range
- **devcontainer_file_write** — Create or overwrite a file (auto-creates parent dirs)
- **devcontainer_file_edit** — Surgical string replacement — old_str → new_str
- **devcontainer_file_list** — List directory contents (non-hidden, 2 levels deep)
- **codespaces_create** — Create a new codespace for a repository
- **codespaces_list** — List your codespaces with state and machine info
- **codespaces_ssh** — Execute a command inside a codespace via SSH
- **codespaces_stop** — Stop a running codespace
- **codespaces_delete** — Delete a codespace
- **codespaces_view** — View detailed codespace info (state, machine, config)
- **codespaces_ports** — List forwarded ports with visibility and URLs
- **codespaces_file_read** — Read file content with optional line range
- **codespaces_file_write** — Create or overwrite a file (auto-creates parent dirs)
- **codespaces_file_edit** — Surgical string replacement — old_str → new_str
- **codespaces_file_list** — List directory contents (non-hidden, 2 levels deep)

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/aniongithub/devcontainer-mcp), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
curl -fsSL https://raw.githubusercontent.com/aniongithub/devcontainer-mcp/main/install.sh | bash
```

2. Install:

```sh
Invoke-RestMethod https://github.com/aniongithub/devcontainer-mcp/releases/latest/download/install.ps1 | Invoke-Expression
```

## Documentation

## What devcontainer-mcp does

The devcontainer-mcp MCP server gives an MCP-compatible coding agent an interface for working inside reproducible development environments. It supports the devcontainer specification through local Docker, and also describes DevPod and GitHub Codespaces backends for environments that run on cloud VMs or GitHub-hosted infrastructure.

An agent can create or build an environment from a repository, local path, or image, run commands inside it, inspect its state, collect logs, and clean up its resources. File operations are available for reading, writing, editing, and listing files within DevPod workspaces. The server also exposes configuration discovery and merged configuration reads for devcontainer projects, including multi-container configurations.

## How it works

The MCP client communicates with the server over stdio JSON-RPC. The server delegates work to the DevPod and devcontainer command-line tools, the GitHub CLI, and Docker APIs. The required backend is selected by the tool family: `devcontainer_*` targets local Docker, while `devpod_*` manages DevPod workspaces and their configured providers and contexts.

Authentication is handled through brokered accounts rather than raw tokens passed to the agent. Agents can inspect provider accounts and scopes, start a login or scope-refresh flow, select an account, and revoke credentials. Supported authentication providers listed by the project are GitHub, AWS, Azure, GCP, and Kubernetes.

The installer can also configure hooks for Claude Code and GitHub Copilot CLI. In directories containing `.devcontainer/devcontainer.json`, the guard hook blocks ordinary host command execution so work is routed through MCP tools. A `.devcontainer-mcp-disable` marker disables both hooks for a repository, and `USER_CONFIRMED_HOST_OPERATION=1` provides a one-command bypass.

## Setup and configuration

Install on Linux or macOS with the project’s shell installer:

```bash
curl -fsSL https://raw.githubusercontent.com/aniongithub/devcontainer-mcp/main/install.sh | bash
```

On Windows, installation runs through WSL. MCP clients launch `wsl ~/.local/bin/devcontainer-mcp serve`, and WSL 2 is required. The project publishes binaries for Linux x64, Linux ARM64, macOS x64, and macOS ARM64.

The backend command-line dependencies are detected at runtime. Docker is needed for local container work; the devcontainer CLI is needed for `devcontainer_*` operations; DevPod is needed for `devpod_*` operations; and the GitHub CLI is used for GitHub-related backend operations. If a detected dependency is missing, the server reports an error with installation guidance.

## Tools and capabilities

The devcontainer-mcp MCP server exposes these capability groups:

- Authentication: inspect accounts and scopes, log in, select an account, and log out.
- DevPod workspaces: create, stop, delete, build, inspect status, list workspaces, run SSH commands, retrieve logs, and manage providers and contexts.
- DevPod workspace files: read files with optional line ranges, write files, replace exact strings, and list non-hidden directory contents up to two levels deep.
- Local dev containers: start, execute commands, build images, stop, remove, inspect status, and read or discover `devcontainer.json` configurations.
- Docker-backed inspection: inspect container labels, ports, mounts, and state, and retrieve container logs.

## Limitations and notes

The server does not remove the need to install and configure the backend tools it invokes. Cloud-backed workflows may also require provider authentication and appropriate scopes. Authentication handles are used instead of exposing raw credentials to the agent, but the underlying provider accounts and command-line tools still need to be available.

The host-protection hooks are limited to supported agent workflows and fail open when `jq` is unavailable or a hook payload cannot be parsed. They activate only when a repository contains `.devcontainer/devcontainer.json`; projects without that file are not covered by the guard behavior. A stale devcontainer configuration can be bypassed per repository with `.devcontainer-mcp-disable`.

_Full upstream README: https://allmcps.com/mcp/devcontainer-mcp/readme_

