Manage Devcontainer Environments
An MCP server that generates and controls development containers directly from devcontainer.json configuration files.
Why it matters
Automate the setup and management of development container environments using devcontainer.json configurations. Streamline your development workflow by programmatically initializing, running commands within, and cleaning up devcontainers.
Outcomes
What it gets done
Initialize and start devcontainer environments.
Execute postCreateCommand and postStartCommand scripts.
Run arbitrary shell commands inside devcontainers.
List and clean up devcontainer environments.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-devcontainer | bash Capabilities
Tools your agent gets
Initializes and starts a devcontainer environment in the specified working folder
Executes custom postCreateCommand and postStartCommand scripts inside the devcontainer
Runs a custom shell command inside the devcontainer for the specified workspace
Executes a docker command to clean up all devcontainer environments
Executes a docker command to get a list of all devcontainer environments
Executes a find command to get all working folders with devcontainer configuration
Overview
Devcontainer MCP Server
An MCP server built on the devcontainers CLI that starts, runs commands in, lists, and cleans up devcontainer.json-based development containers. Use it to provision and control devcontainer environments programmatically; requires Docker in whichever environment runs the server.
What it does
This MCP server generates and configures development containers directly from devcontainer.json configuration files, giving Claude or another MCP client the ability to start, run commands in, and manage devcontainer environments. Its tools are built on the official devcontainers/cli. devcontainer_up initializes and starts a devcontainer for a specified workspace folder and returns startup information. devcontainer_run_user_commands executes a workspace's user-defined postCreateCommand and postStartCommand scripts, useful for running setup or initialization tasks after container startup. devcontainer_exec runs an arbitrary custom shell command inside the devcontainer, taking the command as a string array. devcontainer_cleanup runs a Docker command to remove all devcontainer environments, devcontainer_list lists all current devcontainer Docker processes and their status, and devcontainer_workspace_folders searches a given root path's subdirectories for all workspace folders containing a devcontainer configuration.
It supports three transport options: stdio (npm start), Server-Sent Events on /sse (npm start sse), and Streamable HTTP on /mcp (npm start http), so it can run locally or be exposed as a remote MCP server.
When to use - and when NOT to
Use it when you want Claude to provision and operate devcontainer-based development environments programmatically - spinning up a container for a workspace, running its setup scripts, executing commands inside it, or cleaning up stale containers - instead of managing devcontainers manually through an editor.
Docker is a hard requirement in whichever environment runs the server: install it locally for a local MCP server, or on the remote server for a remote deployment. Node.js 20+ is required to build and run the project itself, though npx -y mcp-devcontainers avoids a local Node install for running the server directly. Note that devcontainer_up typically takes a considerable amount of time to start the container, so clients with short request timeouts may need those timeouts increased to receive a result in a single interaction.
Capabilities
Six tools: devcontainer_up, devcontainer_run_user_commands, devcontainer_exec, devcontainer_cleanup, devcontainer_list, and devcontainer_workspace_folders. Most take a workspaceFolder path and an optional outputFilePath for logs; devcontainer_exec additionally takes the command to run as a string array, and devcontainer_workspace_folders takes an optional rootPath to search under.
How to install
Run it directly without a permanent install using npx:
npx -y mcp-devcontainers
For MCP clients that only support local commands rather than remote URLs, a remote deployment can be bridged with mcp-remote. For trying it without a local Docker setup, the project supports GitHub Codespaces: install dependencies with npm install, then launch with npm start http.
Who it's for
Developers and teams who want an AI assistant to provision, run commands in, and tear down devcontainer-based development environments as part of an agentic workflow, rather than driving devcontainers manually through an IDE. The project is released under the MIT License.
Source README
MCP Devcontainers
MCP server for devcontainer to generate and configure development containers directly from devcontainer.json configuration files.
๐ Pre-condition
This project is built with Node.js. For local development, you can either:
- Install
Node.json your machine, or - Use the provided devcontainer virtual environment.
You may run the project without installing Node.js locally by using npx:
npx -y mcp-devcontainers
Docker is required in the execution environment:
- For local MCP server: Install Docker on your local machine
- For remote MCP server: Install Docker on the remote server
๐ฆ Docker installation guide: https://docs.docker.com/get-started/get-docker/
๐ Getting Started
- Build:
npm run build- Compiles TypeScript to JavaScript - Watch mode:
npm run watch- Automatically rebuilds on file changes - Prepare release:
npm run prepare- Prepares the package for publishing - Run ESLint:
npm run lint- Executes ESLint for code validation - Fix ESLint issues:
npm run lint:fix- Automatically fixes ESLint errors
โจ MCP Transport
Option 1 - Start STDIO server
Launches the MCP server with stdio transport
npm start
Option 2 - Start SSE server
Runs the MCP server with Server-Sent Events transport on https://{your-domain}/sse
npm start sse
Option 3 - Start Streamable HTTP server
Starts the MCP server with Streamable HTTP transport on https://{your-domain}/mcp
npm start http
๐ Tools
Tools are built on the devcontainers/cli
They enable you to generate and configure development containers directly from devcontainer.json configuration files:
devcontainer_up
Initializes and starts a devcontainer environment in the specified workspace folder. Ensures the devcontainer is operational and ready for development tasks.
Input Parameters
Name Required Type Description workspaceFolder โซ string Path to the workspace folder outputFilePath โช string Path for output logs Returns
Text content with the devcontainer startup information
devcontainer_run_user_commands
Executes user-defined postCreateCommand and postStartCommand scripts within the devcontainer for the specified workspace. Use this to run setup or initialization tasks after container startup.
Input Parameters
Name Required Type Description workspaceFolder โซ string Path to the workspace folder outputFilePath โช string Path for output logs Returns
Text content with the command execution result
devcontainer_exec
Runs a custom shell command inside the devcontainer for the specified workspace. Useful for executing arbitrary commands or scripts within the devcontainer environment.
Input Parameters
Name Required Type Description workspaceFolder โซ string Path to the workspace folder outputFilePath โช string Path for output logs command โซ string[ ] Command to execute as string array Returns
Text content with the command execution result
devcontainer_cleanup
Runs docker command to cleanup all devcontainer environments.
Input Parameters
N/A
Returns
Text content with Docker process ID removed
devcontainer_list
Runs docker command to list all devcontainer environments.
Input Parameters
N/A
Returns
Text content with the current devcontainer Docker process status
devcontainer_workspace_folders
Runs find command to get all workspace folders with devcontainer config.
Input Parameters
Name Required Type Description rootPath โช string A path used to search its subdirectories for all workspace folders containing a devcontainer configuration. Returns
Text content with all workspace folders under the specified root path.
๐งโ๐ป Quick Experience / Trial
For developers who want to quickly try this project without a local Docker setup, we recommend using GitHub Codespaces:
Then follow these steps to set up a trial environment:
Wait for the environment to initialize in your browser
Install dependencies:
npm installLaunch the service:
npm start httpThe codespace will automatically provide a forwarded port (e.g., https://ominous-halibut-7vvq7v56vgq6hr5p9-3001.app.github.dev/)
Make the
forwarded portpublicly accessible (located on the right side of the VSCodeTerminaltab)Connect using mcp-inspector via Streamable HTTP
npx -y @modelcontextprotocol/inspectorFor a streamable HTTP connection, remember to append
/mcpto the URLdevcontainer_uptypically takes a considerable amount of time to start the container. If you want to receive the result within a single response interaction, you will need to increase both theRequest Timeoutand theMaximum Total Timeoutin theConfigurationof themcp-inspector
For MCP Clients that don't support remote URLs, use this alternative configuration:
{
"mcpServers": {
"Devcontainer": {
"command": "npx",
"args": ["mcp-remote", "https://ominous-halibut-7vvq7v56vgq6hr5p9-3001.app.github.dev/mcp"]
}
}
}
๐ค Contributing
We welcome contributions of any kind to this project, including feature enhancements, UI improvements, documentation updates, test case completions, and syntax corrections. I believe that a real developer can write better code than AI, so if you have concerns about certain parts of the code implementation, feel free to share your suggestions or submit a pull request.
Please review our Code of Conduct. It is in effect at all times. We expect it to be honored by everyone who contributes to this project.
For more information, please see Contributing Guidelines
๐ Opening an Issue
Before creating an issue, check if you are using the latest version of the project. If you are not up-to-date, see if updating fixes your issue first.
๐ Reporting Security Issues
Review our Security Policy. Do not file a public issue for security vulnerabilities.
โญ Credits
Written by @AIQL.com.
๐ License
This project is licensed under the MIT License. See the LICENSE file for details.
FAQ
Common questions
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.