Provides integration with Docker Hub APIs for searching container images, managing repositories, viewing and managing tags, pulling and pushing images, and discovering Docker Hardened Images.
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
Docker installed
Node.js (version 22+)
[Optional] A Docker Personal Access Token (PAT) with appropriate permissions
Setup
Build
npm install npm run buildRun
npm start -- [--transport=http|stdio] [--port=3000]
Default args:
transport: Choose betweenhttporstdio(default:stdio)port=3000This starts the server with default settings and can only access public Docker Hub content.
Run in inspector [Optional]
The MCP Inspector provides a web interface to test your server:
Authenticate with docker
By default this MCP server can only query public content on Docker Hub. In order to manage your repositories you need to provide authentication.
Run with authentication
Run in inspector [Optional]
Usage in Docker Ask Gordon
You can configure Gordon to be a host that can interact with the Docker Hub MCP server.
Gordon Setup
Ask Gordon is your personal AI assistant embedded in Docker Desktop and the Docker CLI. It's designed to streamline your workflow and help you make the most of the Docker ecosystem.
You can configure Gordon to be a client that can interact with the Docker Hub MCP server.
Create the
gordon-mcp.ymlfile in your working directory.Replace environment variables in the
gordon-mcp.ymlwith your Docker Hub username and a PAT token.
Run
docker build -t hub .Run
docker ai
Usage in other MCP Clients
Usage with Claude Desktop
NOTE: Make sure you have already built the application as mentioned in Step 1.
Add the Docker Hub MCP Server configuration to your
claude_desktop_config.json:
NOTE: if you are using nvm to manage node versions, you should put the node binary path in the
commandproperty. This ensure MCP server runs with the right node version. You can find your binary path by runningwhich nodein your shell
For public repositories only:
/FULL/PATH/TO/YOUR/docker-hub-mcp-server- The complete path to where you cloned this repository
For authenticated access (recommended):
Replace the following values:
YOUR_DOCKER_HUB_USERNAME- Your Docker Hub usernameYOUR_DOCKER_HUB_PERSONAL_ACCESS_TOKEN- Your Docker Hub Personal Access Token/FULL/PATH/TO/YOUR/docker-hub-mcp-server- The complete path to where you cloned this
Save the configuration file and completely restart Claude Desktop for the changes to take effect.
Usage with VS Code
Add the Docker Hub MCP Server configuration to your User Settings (JSON) file in VS Code. You can do this by opening the
Command Paletteand typingPreferences: Open User Settings (JSON).
For public repositories only:
/FULL/PATH/TO/YOUR/docker-hub-mcp-server- The complete path to where you cloned this repository
For authenticated access (recommended):
Replace the following values:
YOUR_DOCKER_HUB_USERNAME- Your Docker Hub usernameYOUR_DOCKER_HUB_PERSONAL_ACCESS_TOKEN- Your Docker Hub Personal Access Token/FULL/PATH/TO/YOUR/docker-hub-mcp-server- The complete path to where you cloned this
Open the
Command Paletteand typeMCP: List Servers.Select
docker-huband selectStart Server.
Task Examples
Finding images
Repository Management
Pull/Push Images
Tag Management
Docker Hardened Images
Tools
Search
search - Search repositories and content using Search V4 API
query: Search query parameter (string, required)architectures: Filter on architectures (string, optional)badges: Filter by image content type badges (string, optional)categories: Filter on categories (string, optional)extension_reviewed: Filter on reviewed extensions (boolean, optional)from: Number of documents to skip for pagination (number, optional)images: Filter on image names (string, optional)operating_systems: Filter on operating systems (string, optional)order: Change the ordering of results (string, optional)size: Maximum number of results to return (number, optional)sort: Sort results by search field (string, optional)type: Filter on repository content type (string, optional)
Namespace Management
get_namespaces - Get list of namespaces the user is a member of
page: Page number for pagination (string, optional)page_size: Number of items per page (string, optional)
Repository Management
list_repositories_by_namespace - List all repositories under the provided namespace
namespace: Repository namespace (string, required)content_types: Comma-delimited list of content types (string, optional)media_types: Comma-delimited list of media types (string, optional)name: Search by repository name (string, optional)ordering: Sort order (string, optional)page: Page number (number, optional)page_size: Number of items per page (number, optional)
get_repository_info - Get information about a repository
namespace: Repository namespace (string, required)repository: Repository name (string, required)
check_repository - Check if a repository exists
namespace: Repository namespace (string, required)repository: Repository name (string, required)
check_repository_tag - Check if a specific tag exists in a repository
namespace: Repository namespace (string, required)repository: Repository name (string, required)tag: Tag name (string, required)
create_repository - Create a new repository in the provided namespace
namespace: Repository namespace (string, required)body: Request body data (object, optional)
update_repository_info - Update repository information
namespace: Repository namespace (string, required)repository: Repository name (string, required)body: Request body data (object, optional)
Tag Management
list_repository_tags - List all tags for a repository
namespace: Repository namespace (string, required)repository: Repository name (string, required)architecture: Filter by architecture (string, optional)os: Filter by operating system (string, optional)page: Page number (number, optional)page_size: Number of items per page (number, optional)
read_repository_tag - Get details of a specific repository tag
namespace: Repository namespace (string, required)repository: Repository name (string, required)tag: Tag name (string, required)
Hardened Images
docker_hardened_images - Query for mirrored Docker Hardened Images (DHI) in the namespace
namespace: The namespace to query for mirrored hardened repositories (string, optional)
Licensing
docker/hub-mcp is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.