Docker, DevPod 또는 GitHub Codespaces를 사용하여 격리된 dev container 내에서 AI agent가 명령을 생성, 관리 및 실행할 수 있도록 합니다.
다른 이름 aniongithub/devcontainer-mcp
- 스타
- 28
- Tools
- 46
- 다운로드, 30일
- —
- 최신 버전
- 0.40
- 마지막 커밋
- 2026년 9월 8일
- 라이선스
- MIT
devcontainer MCP란?
devcontainer은(는) MCP server입니다. Docker, DevPod 또는 GitHub Codespaces를 사용하여 격리된 dev container 내에서 AI agent가 명령을 생성, 관리 및 실행할 수 있도록 합니다. 46개 도구를 제공합니다. 예: auth_status, auth_login, auth_select.
프로젝트 README에서 생성된 요약
devcontainer MCP server 정보
devcontainer-mcp는 Claude, Cursor 또는 GitHub Copilot을 사용하는 개발자에게 AI agent를 위한 격리된 개발 환경을 제공합니다. agent가 호스트 머신에서 직접 명령을 실행하도록 허용하는 대신, 이 server는 빌드, 테스트 및 파일 작업을 보안 컨테이너로 라우팅합니다. 이를 통해 agent가 devcontainer.json 파일로 정의된 재현 가능한 환경 내에서 작업하도록 보장함으로써 호스트 오염과 의존성 충돌을 방지합니다.
사용자는 이러한 환경을 호스팅하기 위해 세 가지 별도의 백엔드 중 하나를 선택할 수 있습니다: devcontainer CLI를 통한 로컬 Docker, DevPod를 사용하는 멀티 클라우드 설정 또는 GitHub Codespaces입니다. 이 server는 워크스페이스 생성, SSH를 통한 명령 실행, 정밀한 파일 편집을 포함하여 전체 라이프사이클을 관리하기 위한 45개의 특화된 tools를 제공합니다. 또한 모델에 원시 토큰을 노출하지 않고도 agent가 GitHub, AWS, Azure 및 GCP의 자격 증명을 관리할 수 있도록 하는 내장 auth broker를 포함하고 있습니다.
설정하려면 server binary와 GitHub CLI 또는 DevPod와 같은 필요한 백엔드 CLI를 설치해야 합니다. Windows에서는 환경을 MCP 호환 클라이언트에 연결하기 위해 WSL을 통해 server가 실행됩니다.
활용 사례
- 1agent 실행 격리명령을 컨테이너로 라우팅하여 AI agent가 패키지를 설치하거나 로컬 시스템 PATH를 수정하는 것을 방지합니다.
- 2클라우드 워크스페이스 관리AI에게 GitHub Codespaces 또는 클라우드 VM에서 개발 환경을 생성하고 실행하도록 지시합니다.
- 3안전한 자격 증명 처리agent가 원시 토큰 대신 불투명한 핸들을 사용하여 AWS 또는 GCP와 같은 클라우드 제공업체와 인증할 수 있도록 합니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
devcontainer MCP 도구 46
README에서 감지됨auth_statusauth_loginauth_selectauth_logoutdevpod_updevpod_stopdevpod_deletedevpod_builddevpod_statusdevpod_listdevpod_sshdevpod_logs
| auth_status | — | |
| auth_login | — | |
| auth_select | — | |
| auth_logout | — | |
| devpod_up | — | |
| devpod_stop | — | |
| devpod_delete | — | |
| devpod_build | — | |
| devpod_status | — | |
| devpod_list | — | |
| devpod_ssh | — | |
| devpod_logs | — |
도구 46개 모두 보기도구 수 줄이기
devpod_provider_listdevpod_provider_adddevpod_provider_deletedevpod_context_listdevpod_context_usedevpod_container_inspectdevpod_container_logsdevpod_file_readdevpod_file_writedevpod_file_editdevpod_file_listdevcontainer_updevcontainer_execdevcontainer_builddevcontainer_read_configdevcontainer_list_configsdevcontainer_stopdevcontainer_removedevcontainer_statusdevcontainer_file_readdevcontainer_file_writedevcontainer_file_editdevcontainer_file_listcodespaces_createcodespaces_listcodespaces_sshcodespaces_stopcodespaces_deletecodespaces_viewcodespaces_portscodespaces_file_readcodespaces_file_writecodespaces_file_editcodespaces_file_list
| devpod_provider_list | — | |
| devpod_provider_add | — | |
| devpod_provider_delete | — | |
| devpod_context_list | — | |
| devpod_context_use | — | |
| devpod_container_inspect | — | |
| devpod_container_logs | — | |
| devpod_file_read | — | |
| devpod_file_write | — | |
| devpod_file_edit | — | |
| devpod_file_list | — | |
| devcontainer_up | — | |
| devcontainer_exec | — | |
| devcontainer_build | — | |
| devcontainer_read_config | — | |
| devcontainer_list_configs | — | |
| devcontainer_stop | — | |
| devcontainer_remove | — | |
| devcontainer_status | — | |
| devcontainer_file_read | — | |
| devcontainer_file_write | — | |
| devcontainer_file_edit | — | |
| devcontainer_file_list | — | |
| codespaces_create | — | |
| codespaces_list | — | |
| codespaces_ssh | — | |
| codespaces_stop | — | |
| codespaces_delete | — | |
| codespaces_view | — | |
| codespaces_ports | — | |
| codespaces_file_read | — | |
| codespaces_file_write | — | |
| codespaces_file_edit | — | |
| codespaces_file_list | — |
자동 검사
2026년 11월 13일에 실행됨전체 보고서 →자동 검사를 통과했습니다. 이는 보안 감사가 아닙니다. 코드를 직접 읽고 서버에 필요한 최소한의 권한만 부여하십시오. 검사 방식
- 소스 저장소 연결 및 접근 가능통과
- 오픈 소스 라이선스 (OSI)통과
- 최근 1년 내 커밋 또는 릴리스통과
- 패키지 이름이 인기 패키지와 유사하지 않음검사되지 않음
- 원격 엔드포인트가 HTTPS 사용검사되지 않음
- 파괴적인 도구에 라벨 표시됨통과
- 모델에 대한 숨겨진 지침 없음통과
- 패키지와 의존성에 심각한 보안 권고 없음검사되지 않음
README
GitHub에서 보기devcontainer-mcp
Give your AI agent its own dev environment — not yours.
devcontainer-mcp is an MCP server that lets AI coding agents create, manage, and work inside dev containers across three backends: local Docker, DevPod, and GitHub Codespaces. The agent builds, tests, and ships code in an isolated container — your laptop stays clean.
Works with GitHub Copilot, Claude, Cursor, opencode, and any MCP-compatible client.
The Problem
When AI agents write code, they need to run it somewhere. Today that means your host machine:
- 🔴 Host contamination — agents install packages, modify PATH, leave behind build artifacts
- 🔴 "Works on my machine" — agents assume your local toolchain matches production
- 🔴 No isolation — one project's dependencies break another
- 🔴 Security risk — agents run arbitrary commands with your user privileges
- 🔴 Hardware constraints — you're limited to your local machine's resources
The Solution
The devcontainer spec already defines reproducible, container-based dev environments. Every major project ships a .devcontainer/devcontainer.json. But AI agents can't use them — until now.
devcontainer-mcp exposes 45 MCP tools that let any AI agent:
- Spin up a dev container from any repo — locally, on a cloud VM, or in Codespaces
- Run commands inside the container — builds, tests, linting, anything
- Manage the lifecycle — stop, restart, delete when done
- Authenticate against cloud providers — GitHub, AWS, Azure, GCP — without ever seeing a raw token
Agent: "Let me build this project..."
→ auth_status("github") → picks account
→ codespaces_create(auth: "github-you", repo: "your/repo")
→ codespaces_ssh(auth: "github-you", codespace: "...", command: "cargo build")
→ ✅ Built in the cloud. Your laptop did nothing.
Quick Install
Linux / macOS
curl -fsSL https://raw.githubusercontent.com/aniongithub/devcontainer-mcp/main/install.sh | bash
Windows (via WSL)
Invoke-RestMethod https://github.com/aniongithub/devcontainer-mcp/releases/latest/download/install.ps1 | Invoke-Expression
How it works: The binary runs inside WSL; MCP clients on Windows launch it via
wsl ~/.local/bin/devcontainer-mcp serve. The stdio transport works transparently across the WSL boundary. WSL 2 is required — install it withwsl --installif you haven't already.
Backend CLIs (devpod, devcontainer, gh) are detected at runtime — if one is missing, the MCP server returns a helpful error with install instructions.
Binaries available for linux-x64, linux-arm64, darwin-x64, and darwin-arm64.
Host Protection & Opt-Out
The installer configures two agent hooks (Claude Code & GitHub Copilot CLI) that activate only in a directory containing .devcontainer/devcontainer.json:
devcontainer-guard(PreToolUse) — blocks shell/command execution on the host so the agent routes builds, tests, and runs through the MCP tools instead. Host-safe commands (git,gh) are allowlisted, and both hooks fail open — ifjqis missing or a payload can't be parsed, commands are allowed rather than blocked.devcontainer-skill-loader(SessionStart) — injects theSKILL.mdusage guide as context.
Turning it off for a repo
Sometimes a project ships a stale or unmaintained .devcontainer that you don't actually want to route work through. To disable both hooks for that repo, drop a marker file at the repo root:
touch .devcontainer-mcp-disable
When .devcontainer-mcp-disable is present, the guard allows host commands through and the skill-loader skips context injection — the agent works locally as if no devcontainer were declared. Commit it (or add it to .gitignore for a local-only opt-out).
One-off bypass: to run a single host command without disabling the guard, include USER_CONFIRMED_HOST_OPERATION=1 anywhere in the command.
Architecture
graph TD
A[AI Agent / MCP Client] -->|stdio JSON-RPC| B[devcontainer-mcp]
subgraph "devcontainer-mcp"
B --> C[33 MCP Tools]
C --> D[Auth Broker]
C --> E[devcontainer-mcp-core]
end
D -->|opaque handles| C
E -->|subprocess| F[DevPod CLI]
E -->|subprocess| G[devcontainer CLI]
E -->|subprocess| H[gh CLI]
E -->|bollard API| I[Docker Engine]
F --> J[Docker / K8s / Cloud VMs]
G --> K[Local Docker]
H --> L[GitHub Codespaces]
Three Backends, One Interface
| Backend | Best for | Requires | Auth needed? |
|---|---|---|---|
devcontainer CLI (devcontainer_*) |
Local Docker — fast, simple | @devcontainers/cli + Docker | No |
DevPod (devpod_*) |
Multi-cloud: Docker, K8s, AWS, Azure, GCP | DevPod CLI | Optional (cloud providers) |
Codespaces (codespaces_*) |
GitHub-hosted cloud environments | gh CLI | Yes (auth handle) |
Auth Broker
The agent never sees raw tokens. Instead:
auth_status(provider)— list available accounts and scopesauth_login(provider, scopes?)— initiate login, opens browser, handles device codesauth_select(id)— switch the active accountauth_logout(id)— revoke credentials
Codespaces tools require an auth handle (e.g. "github-aniongithub"). The MCP server resolves it to the real token on each call via the CLI's native keyring.
Supported providers: GitHub, AWS, Azure, GCP, Kubernetes
MCP Tools (46 total)
Auth (4 tools)
| Tool | Description |
|---|---|
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 (19 tools)
| Tool | Description |
|---|---|
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 CLI (12 tools)
| Tool | Description |
|---|---|
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) |
GitHub Codespaces (11 tools) — require auth handle
| Tool | Description |
|---|---|
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) |
MCP Server Configuration
Linux / macOS
{
"mcpServers": {
"devcontainer-mcp": {
"command": "devcontainer-mcp",
"args": ["serve"]
}
}
}
Windows (WSL bridge)
{
"mcpServers": {
"devcontainer-mcp": {
"command": "wsl",
"args": ["~/.local/bin/devcontainer-mcp", "serve"]
}
}
}
Prerequisites
Install backend CLIs as needed — the MCP server detects them at runtime and returns helpful errors if missing:
- devcontainer CLI:
npm install -g @devcontainers/cli+ Docker - DevPod: DevPod CLI + Docker (or another provider)
- Codespaces: GitHub CLI — auth is handled by the
auth_logintool
Self-Healing
When devcontainer_up, devpod_up, or codespaces_create fails, the full build output (including errors) is returned to the agent. The agent can read the error, fix the Dockerfile or devcontainer.json, and retry — making the dev environment a dynamic, agent-managed asset rather than a static prerequisite.
Multi-container workspaces
The devcontainer spec supports connecting to multiple containers in one workspace by placing per-service configs at .devcontainer/<name>/devcontainer.json, each pointing at a shared docker-compose.yml. devcontainer-mcp supports this pattern end-to-end:
- Discovery —
devcontainer_list_configsreturns every config it finds (root.devcontainer.json,.devcontainer/devcontainer.json, and each.devcontainer/*/devcontainer.json) with its kind (image/dockerfile/compose), service name, and absolute path. - Targeting — Every devcontainer tool (
up,exec,build,stop,remove,status,read_config,file_*) accepts an optionalconfigparameter pointing at a specificdevcontainer.json. Single-container workflows continue to work unchanged —configdefaults to whatever the devcontainer CLI auto-detects. - Ambiguity handling — When a workspace has multiple configs and no
configis provided, lookup-style tools (status,exec,stop,remove,file_*) return a structuredAmbiguousresult listing every matching container so the agent can pick the right one.statusreports this as{"state":"Ambiguous","candidates":[...],"hint":"..."}. - Robust container matching — Sibling compose containers are identified via
com.docker.compose.service+com.docker.compose.project.config_files(not the unreliabledevcontainer.local_folderlabel, which is only stamped on the first container).
Development
This project eats its own dogfood — development happens inside its own devcontainer.
# Using the devcontainer CLI
devcontainer up --workspace-folder .
devcontainer exec --workspace-folder . cargo build --workspace
devcontainer exec --workspace-folder . cargo test --workspace
devcontainer exec --workspace-folder . cargo build --release -p devcontainer-mcp
# Or using DevPod
devpod up . --id devcontainer-mcp --provider docker --open-ide=false
devpod ssh devcontainer-mcp --command "cd /workspaces/devcontainer-mcp && cargo build --workspace"
CI/CD
- Pull Requests —
cargo check,cargo test,cargo clippy,cargo fmtrun automatically - Releases — Creating a GitHub release builds binaries for all 4 platforms
License
devcontainer MCP 질문
devcontainer MCP는 어떤 도구를 제공하나요?
46개 도구를 제공합니다. 예: auth_status, auth_login, auth_select, auth_logout, devpod_up.
AI agent가 호스트 머신에서 명령을 실행하는 것을 어떻게 방지할 수 있나요?
.devcontainer/devcontainer.json 파일이 포함된 디렉토리에서는 호스트의 shell 실행을 차단하고 MCP tools를 통해 명령을 전달하는 'devcontainer-guard' hook이 서버에 포함되어 있습니다.