local-docker-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@local-docker-mcprun tests for my app in a Docker container"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
local-docker-mcp
A Python MCP (Model Context Protocol) server that provides Docker container management and test execution capabilities via FastMCP. Runs as an HTTP server on port 8000 at path /local-docker/mcp/.
Features
Docker Image Management: Build, pull, list, and remove Docker images
Container Operations: Run, stop, remove containers; fetch logs; execute commands
Test Execution: Run tests inside containers with automatic file/folder upload
Cross-Platform: Works on Windows, macOS, and Linux with platform-appropriate upload strategies
MCP Protocol: Exposes all functionality as MCP tools for LLM consumption
Tech Stack
Python ≥3.14
FastMCP ≥3.4.2 - MCP server framework
docker ≥7.1.0 - Docker SDK for Python
uv - Dependency management
Project Structure
local-docker-mcp/
├── main.py # Main MCP server entry point (single file)
├── pyproject.toml # Project config & dependencies
├── uv.lock # Locked dependencies
├── .python-version # Python version pin
├── .gitignore
└── README.mdQuick Start
Prerequisites
Python ≥3.14
Docker installed and running
uvpackage manager
Installation
# Clone and navigate to project
cd local-docker-mcp
# Install dependencies
uv sync
# Run the MCP server
uv run main.pyThe server starts at http://0.0.0.0:8000/local-docker/mcp/
Development
# Install in editable mode
uv pip install -e .
# Add a new dependency
uv add package-name
uv syncAvailable MCP Tools
All tools are decorated with @mcp.tool() and exposed via the MCP protocol.
Image Management
Tool | Description |
| Build Docker image from Dockerfile |
| Pull Docker image from registry |
| Remove Docker image |
| List containers and images |
Container Operations
Tool | Description |
| Start container from image (requires |
| Fetch container logs |
| Stop/remove container, optionally remove image |
| Execute arbitrary command in container (requires |
Test Execution
Tool | Description |
| Run tests inside container with optional file/folder upload |
run_tests Parameters
container_name(required, must have prefixbyagent_)container_tests_folder(required, absolute path in container)test_file(optional, specific test file)test_node_ids(optional, specific test node IDs)upload_from_folder/upload_from_files(mutually exclusive, for uploading test files)test_runner(default:pytest)test_runner_args(optional, additional test runner arguments)env_vars(optional, environment variables)timeout_seconds(optional, test timeout)
Upload Strategy
upload_from_folder: Copies entire folder contents tocontainer_tests_folderupload_from_files: Copies specific files tocontainer_tests_folderMutually exclusive — cannot use both
Architecture
Main Entry Point (main.py)
FastMCP Server: Named "local-docker-mcp", runs on HTTP transport at
0.0.0.0:8000with path/local-docker/mcp/Platform Detection: Detects OS at import time for cross-platform Docker commands
Key Components
_run(cmd, cwd, timeout)— Shell command runner with structured output and timeout handling_fmt(res, label)— Formats command results into readable strings with success/failure icons_upload_files_to_container(files, container_name, dest)— Cross-platform file upload viadocker cp_upload_folder_to_container(folder, container_name, dest)— Cross-platform folder upload:Windows: Uses
docker cpexclusivelymacOS/Linux: Prefers
tarpipe for permissions/symlinks, falls back todocker cp
Container Naming Convention
All container operations require the byagent_ prefix for container names (validated in tools).
Cross-Platform Support
Platform | Folder Upload Method |
Windows |
|
macOS/Linux |
|
License
[Add your license here]
Contributing
Fork the repository
Create a feature branch
Make your changes
Run tests (when available)
Submit a pull request
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Jatin-Gurwani/local-docker-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server