
The Docker Hub MCP Server is a Model Context Protocol (MCP) server that interfaces with Docker Hub A
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.
·
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.
Build
npm install
npm run buildRun
npm start -- [--transport=http|stdio] [--port=3000] [--host=127.0.0.1]transport: Choose between http or stdio (default: stdio)port=3000host=127.0.0.1 (HTTP transport only)
This starts the server with default settings and can only access public Docker Hub content.[!IMPORTANT] The
httptransport binds to127.0.0.1(loopback) by default and requires authentication. See Securing the HTTP transport before exposing it to a network.
The MCP Inspector provides a web interface to test your server:
npx @modelcontextprotocol/inspector node dist/index.js [--transport=http|stdio] [--port=3000]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:
127.0.0.1 unless you pass
--host=<addr> (for example --host=0.0.0.0 to expose it from a container).http mode the server refuses to
start unless you either provide a bearer token or explicitly opt out. Set the
token via the MCP_AUTH_TOKEN environment variable; clients must then send it as
Authorization: Bearer <token> on every request.Host header
is not in the allow-list (loopback plus --host, extendable with
--allowed-hosts), or when they carry a browser Origin header that is not
listed in --allowed-origins. Non-browser MCP clients are unaffected.Run the HTTP transport with authentication:
MCP_AUTH_TOKEN=<a_long_random_secret> npm start -- --transport=httpExpose it beyond loopback (e.g. inside a container), still authenticated:
MCP_AUTH_TOKEN=<a_long_random_secret> npm start -- \
--transport=http --host=0.0.0.0 \
--allowed-hosts=my-host.internal --allowed-origins=https://my-app.example.com| Flag / env var | Purpose |
|---|---|
MCP_AUTH_TOKEN | Bearer token required on every /mcp request. |
--host=<addr> | Address to bind (default 127.0.0.1). |
--allowed-hosts=a,b | Extra Host header values to accept (comma-separated). |
--allowed-origins=a,b | Browser Origin values to accept (comma-separated). |
--allow-unauthenticated | Serve /mcp with no authentication. Insecure; opt-in only. |
[!WARNING]
--allow-unauthenticateddisables authentication entirely and exposes your Docker Hub PAT to any client that can reach the port. Only use it on a trusted, isolated network.
By default this MCP server can only query public content on Docker Hub. In order to manage your repositories you need to provide authentication.
HUB_PAT_TOKEN=<a_pat_token> npm start -- [--username=<the_hub_username_for_the_pat>]HUB_PAT_TOKEN=<a_pat_token> npx @modelcontextprotocol/inspector node dist/index.js[--username=<the_hub_username_for_the_pat>]You can configure Gordon to be a host that can interact with the Docker Hub MCP server.
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.
gordon-mcp.yml file file in your working directory.gordon-mcp.yml with your Docker Hub username and a PAT token.services:
hub:
image: hub
environment:
- HUB_PAT_TOKEN=<your_pat_token>
command:
- --username=<your_hub_username>docker build -t hub .docker aiNOTE: Make sure you have already built the application as mentioned in Step 1.
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
/FULL/PATH/TO/YOUR/docker-hub-mcp-server - The complete path to where you cloned this repository{
"mcpServers": {
"docker-hub": {
"command": "node", // or absoulute binary path
"args": ["/FULL/PATH/TO/YOUR/docker-hub-mcp-server/dist/index.js", "--transport=stdio"]
}
}
}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{
"mcpServers": {
"docker-hub": {
"command": "node",
"args": [
"/FULL/PATH/TO/YOUR/docker-hub-mcp-server/dist/index.js",
"--transport=stdio",
"--username=YOUR_DOCKER_HUB_USERNAME"
],
"env": {
"HUB_PAT_TOKEN": "YOUR_DOCKER_HUB_PERSONAL_ACCESS_TOKEN"
}
}
}
}Command Palette and typing Preferences: Open User Settings (JSON)./FULL/PATH/TO/YOUR/docker-hub-mcp-server - The complete path to where you cloned this repository{
"mcpServers": {
"docker-hub": {
"command": "node",
"args": ["/FULL/PATH/TO/YOUR/docker-hub-mcp-server/dist/index.js", "--transport=stdio"]
}
}
}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{
"mcpServers": {
"docker-hub": {
"command": "node",
"args": [
"/FULL/PATH/TO/YOUR/docker-hub-mcp-server/dist/index.js",
"--transport=stdio",
"--username=YOUR_DOCKER_HUB_USERNAME"
],
"env": {
"HUB_PAT_TOKEN": "YOUR_DOCKER_HUB_PERSONAL_ACCESS_TOKEN"
}
}
}
}Command Palette and type MCP: List Servers.docker-hub and select Start Server.# Search for official images
$ docker ai "Search for official nginx images on Docker Hub"
# Search for lightweight images to reduce deployment size and improve performance
$ docker ai "Search for minimal Node.js images with small footprint"
# Get the most recent tag of a base image
$ docker ai "Show me the latest tag details for go"
# Find a production-ready database with enterprise features and reliability
$ docker ai "Search for production ready database images"
# Compare Ubuntu versions to choose the right one for my project
$ docker ai "Help me find the right Ubuntu version for my project"# Create a repository
$ docker ai "Create a repository in my namespace"
# List all repositories in my namespace
$ docker ai "List all repositories in my namespace"
# Find the largest repository in my namespace
$ docker ai "Which of my repositories takes up the most space?"
# Find repositories that haven't been updated recently
$ docker ai "Which of my repositories haven't had any pushes in the last 60 days?"
# Find which repositories are currently active and being used
$ docker ai "Show me my most recently updated repositories"
# Get details about a repository
$ docker ai "Show me information about my '<repository-name>' repository"# Pull latest PostgreSQL version
$ docker ai "Pull the latest postgres image"
# Push image to your Docker Hub repository
$ docker ai "Push my <image-name> to my <repository-name> repository"# List all tags for a repository
$ $ docker ai "Show me all tags for my '<repository-name>' repository"
# Find the most recently pushed tag
$ docker ai "What's the most recent tag pushed to my '<repository-name>' repository?"
# List tags with architecture filtering
$ docker ai "List tags for in the '<repository-name>' repository that support amd64 architecture"
# Get detailed information about a specific tag
$ docker ai "Show me details about the '<tag-name>' tag in the '<repository-name>' repository"
# Check if a specific tag exists
$ docker ai "Check if version 'v1.2.0' exists for my 'my-web-app' repository"# List available hardened images
$ docker ai "What is the most secure image I can use to run a node.js application?"
# Convert Dockerfile to use a hardened image
$ docker ai "Can you help me update my Dockerfile to use a docker hardened image instead of the current one"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)page: Page number for pagination (string, optional)page_size: Number of items per page (string, optional)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)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)namespace: Repository namespace (string, required)repository: Repository name (string, required)tag: Tag name (string, required)namespace: The namespace to query for mirrored hardened repositories (string, optional)docker/hub-mcp is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.
Pick your client and paste the snippet. Each one is the same server, written the way that client expects it.
claude mcp add docker-hub -- node /FULL/PATH/TO/YOUR/docker-hub-mcp-server/dist/index.js --transport=stdio{
"mcpServers": {
"docker-hub": {
"args": [
"/FULL/PATH/TO/YOUR/docker-hub-mcp-server/dist/index.js",
"--transport=stdio"
],
"command": "node"
}
}
}code --add-mcp '{"name":"docker-hub","args":["/FULL/PATH/TO/YOUR/docker-hub-mcp-server/dist/index.js","--transport=stdio"],"command":"node"}'[mcp_servers.docker-hub]
command = "node"
args = ["/FULL/PATH/TO/YOUR/docker-hub-mcp-server/dist/index.js", "--transport=stdio"]Runs locally on your device. Your client starts the server itself, so nothing has to be hosted.
Paste this prompt into your agent. It reads this page and does the setup for you.
Read https://aiagentslisting.com/mcp/docker-hub-mcp-server to learn what the "Docker Hub MCP Server" MCP server does and how to install it. Add it to my coding agent's MCP configuration as documented on that page, then confirm the server connects and list the tools it exposes.Agents can also browse this directory over MCP at https://aiagentslisting.com/api/mcp
npx @modelcontextprotocol/inspector node dist/index.js [--transport=http|stdio] [--port=3000]This server runs locally, so we can't read its tool list over the web yet.
Maintain this server? Claiming proves you own the listing and earns the last 4 points.
Claim this listingPaste this line near the top of your repository's README. The badge always renders the current score.
[](https://aiagentslisting.com/mcp/docker-hub-mcp-server)WebScore is a free website scanner & checker — scan any site for SEO, performance, security and acce
No tagged releases on record.
Connect to the AI Agents Listing MCP server at https://aiagentslisting.com/api/mcp using the HTTP transport and complete the sign-in when it asks. Then call the submit_review tool for the listing "docker-hub-mcp-server" with a rating from 1 to 5 and a short note on what worked and what did not.No reviews yet
Be the first to share your experience with this tool.
GitHub's official MCP server for repos, issues and pull requests
Developer Tools
WebScore is a free website scanner & checker — scan any site for SEO, performance, security and acce
AI & ML Services
One email a week. New agents, MCP servers and skills, and what is actually getting traction.