Skip to main content
Glama

Docker MCP 服务器

用于 Docker 操作的模型上下文协议 (MCP) 服务器。该服务器允许 Claude 和其他 AI 助手通过 MCP 协议与 Docker 进行交互。

**注意:**此 MCP 服务器使用标准 Docker CLI 命令,目前不支持 Docker Compose 操作,其他带有 docker-compose 的 MCP 服务器尚无法可靠地与 cline 配合使用。

特征

  • 列出 Docker 容器

  • 列出 Docker 镜像

  • 运行 Docker 容器

  • 停止运行容器

  • 删除容器

  • 从注册表中提取 Docker 镜像

Related MCP server: Docker MCP Server

安装

先决条件

  • Node.js 18 或更高版本

  • Docker 已安装并正在您的系统上运行

从 npm 安装

npm install -g docker-mcp-server

从源安装

  1. 克隆此存储库

  2. 安装依赖项:

cd docker-mcp
npm install
  1. 构建项目:

npm run build

用法

运行服务器

docker-mcp-server

或者如果从源安装:

npm start

使用 Claude 进行配置

您可以使用附带的安装脚本通过 Claude 自动配置 Docker MCP 服务器:

npm run install-config

该脚本将:

  1. 检测您的 Claude 安装(桌面和/或 VSCode)

  2. 更新配置文件以包含 Docker MCP 服务器

  3. 为您的系统设置正确的路径

手动配置

如果您希望手动配置,则需要将 Docker MCP 服务器添加到您的 MCP 设置配置文件中:

适用于 Claude 桌面应用程序 (macOS)

编辑~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "docker-mcp": {
      "command": "node",
      "args": ["/path/to/docker-mcp/dist/index.js"],
      "disabled": false,
      "autoApprove": []
    }
  }
}
VSCode 中的 Claude

编辑~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

{
  "mcpServers": {
    "docker-mcp": {
      "command": "node",
      "args": ["/path/to/docker-mcp/dist/index.js"],
      "disabled": false,
      "autoApprove": []
    }
  }
}

**注意:**在 VS Code 中配置 Docker MCP 服务器后,可能需要重启 VS Code 才能使更改在 Cline 中生效。如果您在 Cline 中遇到 Docker MCP 服务器无法识别或无法正常工作的问题,请尝试重启 VS Code。

可用工具

列表容器

列出所有 Docker 容器。

参数:

  • all (布尔值,可选):显示所有容器(默认显示正在运行的容器)

列表图像

列出所有 Docker 镜像。

运行容器

运行 Docker 容器。

参数:

  • image (字符串,必需):要运行的 Docker 映像

  • name (字符串,可选):容器的名称

  • detach (布尔值,可选):在后台运行容器

  • ports (字符串数组,可选):端口映射(例如 [“8080:80”])

  • volumes (字符串数组,可选):卷映射(例如 [“/host/path:/container/path”])

  • env (字符串数组,可选):环境变量(例如[“KEY=value”])

  • command (字符串,可选):在容器中运行的命令

停止容器

停止正在运行的 Docker 容器。

参数:

  • container (字符串,必需):容器 ID 或名称

删除容器

删除 Docker 容器。

参数:

  • container (字符串,必需):容器 ID 或名称

  • force (布尔值,可选):强制删除正在运行的容器

拉取图像

从注册表中提取 Docker 镜像。

参数:

  • image (字符串,必需):图像名称(例如“nginx:latest”)

Claude 的示例用法

配置完成后,您可以要求Claude执行Docker操作:

  • “运行一个 hello-world Docker 容器”

  • “列出所有 Docker 容器”

  • “拉取最新的 nginx 镜像”

  • “在端口 8080 上运行 nginx 容器”

  • “停止 nginx 容器”

  • “删除所有停止的容器”

MCP 市场

该 Docker MCP 服务器可在 Cline MCP Marketplace 上获取,用户可以轻松发现并一键安装。

MCP 市场提交的徽标位于assets/logo.png文件中。

有关 MCP 市场的更多信息,请访问:

执照

麻省理工学院

Install Server
A
license - permissive license
A
quality
F
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity
Issues opened vs closed

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables Docker container management directly through Claude using the Model Context Protocol. Provides 14 tools for managing containers, images, volumes, and Docker Compose deployments through natural language commands.
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants like Claude to manage Docker containers, images, and Docker Compose deployments through the Model Context Protocol. Provides secure container lifecycle management, image operations, and multi-host Docker server connections.
    194
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to manage Docker containers, images, networks, volumes, and Compose services through the Model Context Protocol. It supports system operations, command execution within containers, and integration with Docker Hub and GitHub Container Registry.
    135
    2
    MIT

View all related MCP servers

Related MCP Connectors

  • OCR, transcription, file extraction, and image generation for AI agents via MCP.

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

  • Hosted Amazon Seller and Vendor MCP server for Claude, ChatGPT, Cursor, Codex, Gemini, Copilot.

View all MCP Connectors

Latest Blog Posts

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/suvarchal/docker-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server