NM

nideil/mcp-server-docker

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

5 stars 3 forks 质量 58 趋势 13MIT

Docker's MCP Server

概览

The Docker MCP Server is a Model Context Protocol (MCP) server that provides seamless integration with Docker Desktop on Windows, enabling advanced automation and interaction capabilities for developers and tools. 1. Install Docker Desktop for Windows from Docker's official download page. 2. In Docker Desktop, go to and check the box for . This is required for the MCP server to communicate with Docker Desktop. 💡 You can verify that the port is exposed successfully by opening http://localhost:2375/version in your browser. If the setup is correct, you should see a JSON response with Docker version information.

README

以下为原文 README 节选,完整内容请查看原文。

Docker MCP Server

The Docker MCP Server is a Model Context Protocol (MCP) server that provides seamless integration with Docker Desktop on Windows, enabling advanced automation and interaction capabilities for developers and tools.

Prerequisites

  1. Install Docker Desktop for Windows from Docker’s official download page.

  2. In Docker Desktop, go to Settings > General and check the box for
    “Expose daemon on tcp://localhost:2375 without TLS”.
    This is required for the MCP server to communicate with Docker Desktop.

    💡 Tip: You can verify that the port is exposed successfully by opening
    http://localhost:2375/version in your browser. If the setup is correct,
    you should see a JSON response with Docker version information. If you’re having trouble, check this discussion for a possible solution: WSL and Docker for Windows: Cannot connect to the Docker daemon

Installation

Usage with Claude Desktop

{
  "mcpServers": {
    "docker-mcp-stdio": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "freezeolo/docker-mcp-server"
      ]
    }
  }
}

Tools

✅ Completed 🛠️ In Progress ❌ Plan

Container Lifecycle Management ✅

  • list_containers - Get the list of containers ✅
  • get_container_info - Get details of a specific container ✅
    • container_id: Container ID (string, required)
  • start_container - Start a container ✅
    • container_id: Container ID (string, required)
  • restart_container - Restart a container ✅
    • container_id: Container ID (string, required)
  • stop_container - Stop a container ✅
    • container_id: Container ID (string, required)
  • remove_container - Remove a container ✅
    • container_id: Container ID (string, required)
  • create_container - Create a new container ✅
    • imageName: Image name (string, required)
    • containerName: Container name (string, required)
    • command: Command to run (string, optional)
    • env: Environment variables (string[], optional)
    • ports: Port bindings (string[], optional)
    • volumes: Volume bindings (string[], optional)
    • network: Network name (string, optional)
    • restartPolicy: Restart policy (string, optional)

Network Management ✅

  • list_networks - List all networks ✅
  • get_network_info - Get network information ✅
    • networkId: Network ID (string, required)
在 GitHub 查看完整 README

安装

docker run -i --rm freezeolo/docker-mcp-server
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "docker-mcp-stdio": { "command": "docker", "args": [ "run", "-i", "--rm", "freezeolo/docker-mcp-server" ] } } }