|
| 1 | +# mcp-devcontainers |
| 2 | + |
| 3 | +The MCP Devcontainers is a Model Context Protocol (MCP) server that provides a simple integration with the [devcontainers cli](https://github.com/devcontainers/cli). |
| 4 | + |
| 5 | +## Dependencies |
| 6 | + |
| 7 | +This server requires **Docker** to be installed and running on your system, as it is used by the [devcontainers cli](https://github.com/devcontainers/cli) to build and manage development containers. |
| 8 | + |
| 9 | +- [Docker installation guide](https://docs.docker.com/get-docker/) |
| 10 | + |
| 11 | +No other dependencies are required to use the MCP Devcontainers server. |
| 12 | + |
| 13 | +## Usage |
| 14 | + |
| 15 | +MCP servers are configured differently depending on the client that you are using. For reference, this is how you would configure it using Claude Desktop. |
| 16 | + |
| 17 | +```json |
| 18 | +{ |
| 19 | + "mcpServers": { |
| 20 | + "devcontainers": { |
| 21 | + "command": "npx", |
| 22 | + "args": [ |
| 23 | + "-y", |
| 24 | + "@crunchloop/mcp-devcontainers" |
| 25 | + ] |
| 26 | + } |
| 27 | + } |
| 28 | +} |
| 29 | +``` |
| 30 | + |
| 31 | +## MCP Transport |
| 32 | + |
| 33 | +At the moment, only `stdio` transport has been implemented. |
| 34 | + |
| 35 | +## Tools |
| 36 | + |
| 37 | +- **devcontainer_up** - Start or initialize a devcontainer environment in the specified workspace folder. Use this to ensure the devcontainer is running and ready for development tasks. |
| 38 | + - `workspaceFolder`: Path to the workspace folder (string, required) |
| 39 | + - `outputFilePath`: Path to write output logs (string, optional) |
| 40 | + |
| 41 | +- **devcontainer_run_user_commands** - Run the user-defined `postCreateCommand` and `postStartCommand` scripts in the devcontainer for the specified workspace folder. Use this to execute setup or initialization commands after the devcontainer starts. |
| 42 | + - `workspaceFolder`: Path to the workspace folder (string, required) |
| 43 | + - `outputFilePath`: Path to write output logs (string, optional) |
| 44 | + |
| 45 | +- **devcontainer_exec** - Execute an arbitrary shell command inside the devcontainer for the specified workspace folder. Use this to run custom commands or scripts within the devcontainer context. |
| 46 | + - `workspaceFolder`: Path to the workspace folder (string, required) |
| 47 | + - `command`: Command to execute (string[], required) |
| 48 | + - `outputFilePath`: Path to write output logs (string, optional) |
| 49 | + |
| 50 | +## License |
| 51 | + |
| 52 | +Released under the MIT License. See the [LICENSE](./LICENSE) file for further details. |
0 commit comments