Docker MCP Server
MCP Server for docker container creation and code execution
Overview
Docker MCP Server is a powerful Model Context Protocol (MCP) server that executes code in isolated Docker containers and returns the results to language models like Claude.
To use Docker MCP Server, clone the repository, set up a virtual environment, install the required packages, and run the server using the command python run_server.py. Access the MCP Inspector interface in your browser at http://localhost:5173.
- Isolated Code Execution: Run code in Docker containers separated from your main system. - Multi-language Support: Execute code in any language with a Docker image. - Complex Script Support: Run both simple commands and complete multi-line scripts. - Robust Error Handling: Graceful timeout management and fallback mechanisms. - Colorful Output: Clear, color-coded console feedback.
- Running isolated code snippets for testing.
- Executing complex scripts in various programming languages.
- Integrating with language models like Claude for enhanced functionality.
Add to your AI client
Use these steps to connect Docker MCP Server in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"docker-mcp-zaycruz": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-docker-mcp-zaycruz"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"docker-mcp-zaycruz": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-docker-mcp-zaycruz"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"docker-mcp-zaycruz": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-docker-mcp-zaycruz"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"docker-mcp-zaycruz": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-docker-mcp-zaycruz"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"docker-mcp-zaycruz": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-docker-mcp-zaycruz"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"docker-mcp-zaycruz": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-docker-mcp-zaycruz"
]
}
}
}FAQ
Can I run any programming language?
Yes! As long as you have the appropriate Docker image, you can run any programming language.
Is Docker MCP Server secure?
Yes, it executes code in isolated Docker containers, but caution is advised when exposing it publicly.
How do I troubleshoot connection issues?
Ensure Docker is running and check for any port conflicts.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":2175,"uuid":"56a5576c-8a28-4d13-b52e-cd8cdd11c7ab","name":"docker_mcp","title":"Docker MCP Server","description":"MCP Server for docker container creation and code execution","avatar_url":"https://avatars.githubusercontent.com/u/201622439?v=4","created_at":"2025-03-09T03:55:44.323Z","updated_at":"2025-03-12T10:19:30.978Z","status":"created","author_name":"zaycruz","author_avatar_url":"https://avatars.githubusercontent.com/u/201622439?v=4","tags":"[]","category":"developer-tools","is_featured":false,"sort":1,"url":"https://github.com/zaycruz/docker_mcp","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":"{\"star\":\"0\",\"license\":\"MIT license\",\"language\":\"Python\",\"is_official\":false,\"latest_commit_time\":\"2025-03-11 16:18:24\"}","user_uuid":null,"tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]