SM

strausmann/mcp-dockhand

开发工具

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

64 stars 6 forks 质量 83 趋势 34MIT

Dockhand Docker 管理 MCP 服务器——将 130+ API 端点作为 MCP 工具暴露

概览

一个MCP(模型上下文协议)服务器,将Dockhand API作为MCP工具暴露。通过AI助手管理整个Docker基础设施。 88.7%的Dockhand在范围内端点(282/318)配备了MCP工具——详见docs/coverage.md,了解按区域自动更新的完整细分。 Dockhand 是一个 Docker 管理服务器,通过 Hawser 代理连接到多个 Docker 主机。该 MCP 服务器提供对所有 Dockhand 功能的完全程序访问。 - 涵盖 Dockhand API — 详见 docs/coverage.md 以获取准确且自动更新的覆盖 - (MCP 规范 2025-03-26) 支持 Docker 容器托管 - 支持 401 自动重新登录 - 用于部署操作(启动、停止、关闭、重启)- 强制执行于所有容器/堆栈/映像/网络/卷端点 - 支持多阶段构建、非根用户和健康检查 /mcp 绑定 0.0.0。

概述(AI 翻译)

一个MCP(模型上下文协议)服务器,将Dockhand API作为MCP工具暴露。通过AI助手管理整个Docker基础设施。

** API 覆盖:** 88.7% 的 Dockhand 在范围内端点(282/318)拥有 MCP 工具——详见 docs/coverage.md 以获取按区域自动更新的完整细分。

Dockhand 是一个 Docker 管理服务器,通过 Hawser 代理连接到多个 Docker 主机。该 MCP 服务器提供对所有 Dockhand 功能的完全程序访问。

特色

  • 280+ MCP 工具 涵盖 Dockhand API — 详见 docs/coverage.md 以获取准确的自动更新覆盖
  • 可流式HTTP传输(MCP规范2025-03-26)用于Docker容器托管
  • 基于会话的认证,401上自动重新登录
  • SSE 支持部署操作(启动、停止、关闭、重启)
  • 环境过滤 在所有容器/堆栈/映像/网络/卷端点上强制执行
  • Docker Ready,支持多阶段构建、非root用户和健康检查

快速启动

Docker (推荐)

可选地,将DOCKHAND_USERNAME/DOCKHAND_PASSWORD对替换为 -e DOCKHAND_API_TOKEN=dh_your-api-token 用个人 API 进行认证 代币代替——参见认证。

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

README

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

MCP Dockhand

An MCP (Model Context Protocol) server that exposes the Dockhand API as MCP tools. Manage your entire Docker infrastructure through AI assistants.

API coverage: 88.7% of in-scope Dockhand endpoints (282/318) have an MCP tool — see docs/coverage.md for the full, auto-updated breakdown by area.

Dockhand is a Docker management server that connects to multiple Docker hosts via Hawser agents. This MCP server provides full programmatic access to all Dockhand features.

Features

  • 280+ MCP Tools covering the Dockhand API — see docs/coverage.md for exact, auto-updated coverage
  • Streamable HTTP Transport (MCP Spec 2025-03-26) for Docker container hosting
  • Session-based Auth with auto-relogin on 401
  • SSE Support for deploy operations (start, stop, down, restart)
  • Environment Filter enforced on all container/stack/image/network/volume endpoints
  • Docker Ready with multi-stage build, non-root user, and health checks

Quick Start

docker run -d \
  --name mcp-dockhand \
  -p 8080:8080 \
  -e DOCKHAND_URL=https://your-dockhand-server.com \
  -e DOCKHAND_USERNAME=your-username \
  -e DOCKHAND_PASSWORD=your-password \
  ghcr.io/strausmann/mcp-dockhand:latest

Optionally, replace the DOCKHAND_USERNAME/DOCKHAND_PASSWORD pair with -e DOCKHAND_API_TOKEN=dh_your-api-token to authenticate with a personal API token instead — see Authentication.

Docker Compose

services:
  mcp-dockhand:
    image: ghcr.io/strausmann/mcp-dockhand:latest
    container_name: mcp-dockhand
    restart: unless-stopped
    ports:
      - "8080:8080"
    environment:
      - DOCKHAND_URL=https://your-dockhand-server.com
      - DOCKHAND_USERNAME=your-username
      - DOCKHAND_PASSWORD=your-password
      # Optional: use a personal API token instead of the pair above.
      #- DOCKHAND_API_TOKEN=dh_your-api-token

From Source

git clone https://github.com/strausmann/mcp-dockhand.git
cd mcp-dockhand
npm install
npm run build
DOCKHAND_URL=https://your-server.com DOCKHAND_USERNAME=admin DOCKHAND_PASSWORD=secret npm start

(Or, in place of the credential pair, DOCKHAND_API_TOKEN=dh_your-api-token — see Authentication.)

Configuration

Variable Required Default Description
DOCKHAND_URL Yes - Dockhand server URL
在 GitHub 查看完整 README

安装

docker run -d \
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "dockhand": { "url": "http://localhost:8080/mcp" } } }