devcontainer-mcp
A minimal MCP server that exposes a single bash tool to execute commands inside a devcontainer, returning real output and exit codes.
README
devcontainer-mcp
A minimal Model Context Protocol server that
exposes exactly one tool — bash — which mimics Claude Code's built-in
Bash tool but executes every command inside a devcontainer instead of on
the host.
The command runs via:
devcontainer exec --workspace-folder <folder> [--remote-env K=V ...] bash -lc "<command>"
and the tool returns the command's real combined stdout/stderr and exit code — not a static "Executed command …" string.
Addressed as
mcp__devcontainer__bash(server namedevcontainer, tool namebash).
Why
This is a Python rewrite of the TypeScript
mcp-devcontainers
server, trimmed to a single Bash-like tool and fixing its main defect: the
original returned a fixed string and tee'd output to a file, so the model never
saw what actually happened. Here, stdout/stderr and the exit status flow back in
the tool result, and a non-zero exit (or a timeout) flags the result as an
error.
It deliberately does not expose up, run-user-commands, or a generic
exec — bringing the container up is out of scope for v1.
Requirements
- Python ≥ 3.10
- The
@devcontainers/cliavailable asdevcontaineronPATH(or override viaDEVCONTAINER_CLI, e.g.npx @devcontainers/cli) - A running devcontainer for the target workspace (start it yourself with
devcontainer up --workspace-folder .)
Install / run
Run straight from the repo with uvx — no install
step:
uvx --from git+https://github.com/vovayartsev-dice/devcontainer-mcp devcontainer-mcp
The server speaks MCP over stdio.
.mcp.json
Add it to your project's .mcp.json (the server key is what produces the
mcp__devcontainer__* tool prefix):
{
"mcpServers": {
"devcontainer": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/vovayartsev-dice/devcontainer-mcp",
"devcontainer-mcp"
],
"env": {
"DEVCONTAINER_WORKSPACE_FOLDER": "${workspaceFolder}"
}
}
}
}
Configuration (environment variables)
| Variable | Default | Purpose |
|---|---|---|
DEVCONTAINER_CLI |
devcontainer |
CLI invocation; shell-split, so npx @devcontainers/cli works. |
DEVCONTAINER_WORKSPACE_FOLDER |
current dir | Default host workspace folder when the workspaceFolder arg is omitted. |
The bash tool
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
command |
string | ✅ | — | Run via bash -lc "<command>" inside the container. Pipes/&&/globs/redirects work. |
cwd |
string | workspace root | Working dir inside the container: cd <cwd> && ( <command> ). |
|
env |
object {KEY: VAL} or list KEY=VAL |
— | Forwarded as repeated --remote-env. |
|
timeout |
integer (ms) | 120000 (max 600000) |
On timeout the process group is killed; result flagged as error. | |
description |
string | — | Logged for observability; otherwise unused. | |
workspaceFolder |
string | cwd / env var | Host path holding the .devcontainer config. |
Result
- Content is the combined stdout + stderr (interleaved), truncated to
~30 000 chars with a
[output truncated]marker if longer. - On a non-zero exit, the exit code is appended and
isErroristrue. - On a timeout, a timeout note is appended and
isErroristrue.
Security / scope
- The command string is interpreted by bash only inside the container. The
host process is launched argv-only (never
shell=True, never a hostsh -c), so host-side shell injection isn't possible. - The container is the blast radius — this server does not mount the Docker
socket, add
--privileged, or expose any tool other thanbash. - v1 intentionally skips background execution / streaming and container bring-up.
Development
uv run devcontainer-mcp # run the server from a checkout
uv build # build wheel + sdist
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.