SuperAPIAI Directory

mcp-server-docker

github.com · AI coding

Manage Docker containers, images, volumes and networks.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsmacOS · Linux · API

About this tool

Purpose

mcp-server-docker is a Model Context Protocol (MCP) server designed to let users manage Docker through natural language, including containers, images, volumes, and networks. It allows large language models (LLMs) to understand and perform Docker-related operations, lowering the barrier to using Docker.

Main Capabilities

  • Orchestrate Containers with Natural Language: Through docker_compose prompts, users provide a project name and container description, and the LLM generates a plan and executes it. The interaction includes: user instruction → LLM generates a natural-language plan → user confirms or provides feedback → applies the plan. Example:name: nginx, containers: "deploy an nginx container exposing it on port 9000".
  • Inspect and Debug Running Containers: Provides resource templates to read container logs and statistics via URI:
    • docker://containers/{container_id}/logs (text/plain)
    • docker://containers/{container_id}/stats (application/json)
  • Manage Persistent Data: Manage persistent data through Docker volumes.
  • Manage Networks: Supports creating and managing Docker networks.
  • Container Operation Tools: Provides list_containers、create_container、recreate_container、start_container、fetch_container_logs、remove_container and other tools (the original text only lists names; specific usage is not yet provided).
  • Remote Connection: Supports connecting to a remote Docker daemon via SSH; you need to set the ssh:// host URL in the MCP server definition.

Usage

  1. Make sure uvis installed (see the official link for installation instructions).
  2. Add the server configuration in the MCP configuration file.
    • macOS path:~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows path:%APPDATA%/Claude/claude_desktop_config.json
  3. You can also choose to run the server in a Docker container (you need to clone the repository and build the image, then configure the MCP server file, and mount the Docker socket volume to connect to the local Docker daemon; the specific commands are not provided in the original text).
  4. Configuration reference: The server uses the Python Docker SDK's from_env method; see the official documentation for details.
  5. Connect to remote Docker: Set the ssh:// host URL in the MCP server definition.

Applicable Scenarios

  • Server Administrators: Connect to remote Docker engines and manage public-facing websites, etc.
  • Experimenters: Run containers locally and experiment with open-source applications that support Docker.
  • AI Enthusiasts: Explore the boundaries of LLM capabilities.

Limitations and Security Considerations

  • Do not configure sensitive data: Including API keys, database passwords, etc. Any sensitive data exchanged with an LLM is inherently insecure unless the LLM runs on the local machine.
  • Review created containers: Docker is not a security sandbox, and the MCP server may affect the host through Docker. Carefully inspect containers created by the LLM.
  • Sensitive Docker options are not supported: Such as --privileged or --cap-add/--cap-drop, which are not supported for security reasons.
  • If you need to securely pass secrets to containers, it is recommended to submit an issue in the repository explaining the use case.

Development and Testing

  • Using Devbox to configure the development environment is recommended. The server uses the high-level MCPServer API of MCP Python SDK v2 and can be inspected directly.
  • Sealed tests and lint suites can be run without a Docker daemon (see devbox.json for specific commands).
  • After configuring Devbox, you can have the Claude MCP configuration use it.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools