An MCP (Model Context Protocol) server that provides an interface to DevPod, enabling AI assistants to manage development environments programmatically.
- Workspace Management: Create, start, stop, and delete DevPod workspaces
- Provider Management: List and add DevPod providers
- SSH Access: Execute commands in workspaces via SSH
- Status Monitoring: Check the status of workspaces
- Multiple Transports: Supports STDIO, SSE (Server-Sent Events), and HTTP Streams transports
- DevPod CLI installed and configured (included in Docker image)
- Go 1.19 or later (for building from source)
- Docker (for containerized deployment)
git clone https://github.com/Protobomb/mcp-server-devpod_git
cd mcp-server-devpod
go build -o mcp-server-devpodRun the server in a container with DevPod pre-installed:
# Using docker-compose
docker-compose up -d
# Or using docker directly
docker run -d \
--name mcp-server-devpod \
-p 8080:8080 \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-v devpod-data:/home/mcp/.devpod \
-e MCP_TRANSPORT=sse \
-e DEVPOD_PROVIDER=docker \
ghcr.io/protobomb/mcp-server-devpod:latestThe container includes:
- Pre-installed DevPod client
- SSE transport support for remote access
- Configurable environment variables
- Volume mounts for Docker socket and DevPod data persistence
./mcp-server-devpod./mcp-server-devpod -transport=sse -addr=8080./mcp-server-devpod -transport=http-streams -addr=8080The HTTP Streams transport provides:
- Full MCP Protocol Compliance: Complete implementation per MCP specification
- Session Management: Secure session-based communication with UUID session IDs
- Bidirectional Communication: POST /mcp for client→server, SSE for server→client responses
- Health Endpoint: GET /health for service monitoring
- CORS Support: Full CORS headers for web client compatibility
When running in Docker, you can configure the server using these environment variables:
MCP_TRANSPORT: Transport type (stdio,sse, orhttp-streams, default:sse)MCP_ADDR: Address for SSE and HTTP Streams servers (default::8080)DEVPOD_HOME: DevPod home directory (default:/home/mcp/.devpod)DEVPOD_PROVIDER: Default DevPod provider (default:docker)DEVPOD_DOCKER_HOST: Docker host for DevPod (default:unix:///var/run/docker.sock)
The server exposes the following tools through the MCP protocol:
devpod_listWorkspaces: List all DevPod workspacesdevpod_createWorkspace: Create a new workspace- Parameters:
name(required): Workspace namesource(required): Repository URL or local pathprovider(optional): Provider to useide(optional): IDE to use
- Parameters:
devpod_startWorkspace: Start a workspace- Parameters:
name(required): Workspace nameide(optional): IDE to use
- Parameters:
devpod_stopWorkspace: Stop a workspace- Parameters:
name(required): Workspace name
- Parameters:
devpod_deleteWorkspace: Delete a workspace- Parameters:
name(required): Workspace nameforce(optional): Force delete without confirmation
- Parameters:
devpod_status: Get workspace status- Parameters:
name(required): Workspace name
- Parameters:
devpod_listProviders: List all available providersdevpod_addProvider: Add a new provider- Parameters:
name(required): Provider nameoptions(optional): Provider-specific options
- Parameters:
devpod_ssh: Execute commands in a workspace via SSH- Parameters:
name(required): Workspace namecommand(optional): Command to execute
- Parameters:
The HTTP Streams transport follows the MCP specification for HTTP-based communication:
# 1. Initialize session
curl -X POST http://localhost:8080/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {},
"clientInfo": {"name": "test-client", "version": "1.0.0"}
}
}'
# 2. Connect to SSE stream (use session ID from above response)
curl -N "http://localhost:8080/mcp?session=SESSION_ID"
# 3. Send messages (in another terminal)
curl -X POST "http://localhost:8080/mcp?session=SESSION_ID" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/list"
}'
# 4. Check health
curl http://localhost:8080/health{
"jsonrpc": "2.0",
"id": 1,
"method": "devpod_createWorkspace",
"params": {
"name": "my-project",
"source": "https://github.com/user/my-project.git",
"provider": "docker",
"ide": "vscode"
}
}{
"jsonrpc": "2.0",
"id": 2,
"method": "devpod_listWorkspaces",
"params": {}
}{
"jsonrpc": "2.0",
"id": 3,
"method": "devpod_ssh",
"params": {
"name": "my-project",
"command": "npm install"
}
}This MCP server can be integrated with AI assistants that support the Model Context Protocol, such as:
- Claude Desktop
- Other MCP-compatible clients
Add to your Claude Desktop configuration:
{
"mcpServers": {
"devpod": {
"command": "/path/to/mcp-server-devpod",
"args": []
}
}
}go build -o mcp-server-devpod main.gogo test ./...The server is built using the mcp-server-framework and implements handlers for DevPod CLI commands. It executes DevPod commands as subprocesses and returns the results through the MCP protocol.
Additional documentation is available in the docs/ directory:
- Inspector Testing Guide - Complete step-by-step guide for testing with MCP Inspector
- Testing Solutions - Comprehensive testing results and evidence
- Example Usage - Additional usage examples and patterns
- Framework Upgrade Summary - Details about the v1.2.0 framework upgrade
- Release Notes - Version history and release information
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details
- Built with mcp-server-framework
- Interfaces with DevPod by Loft Labs