QD

quantgeekdev/docker-mcp

开发工具

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

504 stars 64 forks 质量 69 趋势 20MIT

A docker MCP Server (modelcontextprotocol)

概览

强大的模型上下文协议(MCP)服务器用于 Docker 操作,通过 Claude AI 实现无缝的容器和合成栈管理。 - 🚀 容器创建与实例化 - 📦 Docker Compose 栈部署 - 🔍 容器日志检索 - 📊 容器列表和状态监控 https://github.com/user-attachments/assets/b5f6e40a-542b-4a39-ba12-7fdf803ee278 https://github.com/user-attachments/assets/da386eea-2fab-4835-82ae-896de955d934 要在 Claude 桌面应用中尝试,请将以下内容添加到你的 claude 配置文件中: 通过Smithery自动安装Docker MCP for Claude Desktop: - UV(包管理器)- Python 3.12+ - Docker 桌面或 Docker 引擎 - Claude 桌面 将服务器配置添加到你的Claude Desktop配置文件中:

概述(AI 翻译)

强大的模型上下文协议(MCP)服务器用于 Docker 操作,通过 Claude AI 实现无缝的容器和合成栈管理。

✨ 特色

  • 🚀 容器创建与实例化
  • 📦 Docker Compose 栈部署
  • 🔍 集装箱日志回收
  • 📊 容器列表和状态监控

🎬 演示

部署Docker Compose Stack

https://github.com/user-attachments/assets/b5f6e40a-542b-4a39-ba12-7fdf803ee278

分析集装箱日志

https://github.com/user-attachments/assets/da386eea-2fab-4835-82ae-896de955d934

🚀 快速开始

要在 Claude 桌面应用中尝试,请将以下内容添加到你的 claude 配置文件中:

通过Smithery安装

通过Smithery自动安装Docker MCP for Claude Desktop:

先决条件

  • UV(包管理器)
  • Python 3.12+
  • Docker 桌面或 Docker 引擎
  • Claude桌面

安装

Claude Desktop Configuration

将服务器配置添加到你的Claude Desktop配置文件中:

MacOS:~/Library/Application\ Support/Claude/claude_desktop_config.json Windows:%APPDATA%/Claude/claude_desktop_config.json

💻 开发配置

🚀 生产配置

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

README

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

🐳 docker-mcp

A powerful Model Context Protocol (MCP) server for Docker operations, enabling seamless container and compose stack management through Claude AI.

✨ Features

  • 🚀 Container creation and instantiation
  • 📦 Docker Compose stack deployment
  • 🔍 Container logs retrieval
  • 📊 Container listing and status monitoring

🎬 Demos

Deploying a Docker Compose Stack

https://github.com/user-attachments/assets/b5f6e40a-542b-4a39-ba12-7fdf803ee278

Analyzing Container Logs

https://github.com/user-attachments/assets/da386eea-2fab-4835-82ae-896de955d934

🚀 Quickstart

To try this in Claude Desktop app, add this to your claude config files:

{
  "mcpServers": {
    "docker-mcp": {
      "command": "uvx",
      "args": [
        "docker-mcp"
      ]
    }
  }
}

Installing via Smithery

To install Docker MCP for Claude Desktop automatically via Smithery:

npx @smithery/cli install docker-mcp --client claude

Prerequisites

  • UV (package manager)
  • Python 3.12+
  • Docker Desktop or Docker Engine
  • Claude Desktop

Installation

Claude Desktop Configuration

Add the server configuration to your Claude Desktop config file:

MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json

🛠️ Development

Local Setup

  1. Clone the repository:
git clone https://github.com/QuantGeekDev/docker-mcp.git
cd docker-mcp
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
uv sync

🔍 Debugging

Launch the MCP Inspector for debugging:

npx @modelcontextprotocol/inspector uv --directory  run docker-mcp

The Inspector will provide a URL to access the debugging interface.

📝 Available Tools

The server provides the following tools:

create-container

Creates a standalone Docker container

在 GitHub 查看完整 README

安装

uvx docker-mcp
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "docker-mcp": { "command": "uvx", "args": [ "docker-mcp" ] } } }