DH

docker/hub-mcp

开发工具官方

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

171 stars 99 forks 质量 87 趋势 31Apache-2.0

docker/hub-mcp 是从 https://github.com/docker/hub-mcp. 导入的 MCP 服务器候选

概览

docker/hub-mcp 是从 https://github.com/docker/hub-mcp. 导入的 MCP 服务器候选

概述(AI 翻译)

Docker Hub MCP 服务器是一款模型上下文协议(MCP)服务器,它与 Docker Hub API 接口,使其对大型语言模型(LLM)可访问,从而实现智能内容发现和存储库管理。

使用容器构建的开发者,尤其是在AI和大型语言模型驱动的工作流程中,常常面临在庞大的Docker Hub镜像环境中缺乏足够的上下文。因此,大型语言模型难以推荐合适的镜像,开发者则浪费时间手动搜索而非构建。

使用场景

  • AI驱动的镜像推荐——大型语言模型访问实时Docker Hub数据,获得准确的容器镜像建议。
  • 增强内容发现 - AI工具帮助开发者更快找到合适的图片。
  • 简化中心工作流程 - 使用自然语言管理 Docker 仓库和映像。

先修条件

  • Docker 安装
  • Node.js(版本22+)
  • [可选] 具有适当权限的 Docker 个人访问令牌(PAT)

布置

  1. 建造

  2. 跑

  • 默认 args:
  • transport:选择http或stdio(默认:stdio)
  • port=3000
  • host=127.0.0.1(仅限HTTP传输)

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

README

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

Docker Hub MCP Server

The Docker Hub MCP Server is a Model Context Protocol (MCP) server that interfaces with Docker Hub APIs to make them accessible to LLMs, enabling intelligent content discovery and repository management.

Developers building with containers, especially in AI and LLM-powered workflows, often face inadequate context across the vast landscape of Docker Hub images. As a result, LLMs struggle to recommend the right images, and developers lose time manually searching instead of building.

Use Cases

  • AI-powered image recommendations - LLMs access real-time Docker Hub data for accurate container image suggestions.
  • Enhanced content discovery - AI tools help developers find the right images faster.
  • Simplified Hub workflows - Manage Docker repositories and images using natural language.

Prerequisites

Setup

  1. Build

    npm install
    npm run build
    
  2. Run

     npm start -- [--transport=http|stdio] [--port=3000] [--host=127.0.0.1]
    
  • Default args:
    • transport: Choose between http or stdio (default: stdio)
    • port=3000
    • host=127.0.0.1 (HTTP transport only) This starts the server with default settings and can only access public Docker Hub content.

[!IMPORTANT] The http transport binds to 127.0.0.1 (loopback) by default and requires authentication. See Securing the HTTP transport before exposing it to a network.

Run in inspector [Optional]

The MCP Inspector provides a web interface to test your server:

npx @modelcontextprotocol/inspector node dist/index.js [--transport=http|stdio] [--port=3000]

Securing the HTTP transport

The stdio transport is only reachable by the local process that spawns it. The http transport, however, dispatches every tool call using the server operator’s Docker Hub Personal Access Token (HUB_PAT_TOKEN). Anyone who can reach the HTTP endpoint can therefore act as that Docker Hub identity — including creating and modifying repositories. To prevent this, the HTTP transport is locked down by default:

  • Loopback binding. The listener binds to 127.0.0.1 unless you pass --host= (for example --host=0.0.0.0 to expose it from a container).
  • Authentication required (fail-closed). In http mode the server refuses to
在 GitHub 查看完整 README

安装

npx @modelcontextprotocol/inspector node dist/index.js [--transport=http|stdio] [--port=3000]
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "docker-hub": { "command": "node", // or absoulute binary path "args": ["/FULL/PATH/TO/YOUR/docker-hub-mcp-server/dist/index.js", "--transport=stdio"] } } }