Skip to content

Commit 5a55776

Browse files
Create hub-mcp.md (#22912)
1 parent bf600c6 commit 5a55776

File tree

1 file changed

+225
-0
lines changed
  • content/manuals/ai/mcp-catalog-and-toolkit

1 file changed

+225
-0
lines changed
Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
---
2+
title: Docker Hub MCP server
3+
description: Use the MCP Toolkit to set up MCP servers and MCP clients.
4+
keywords: Docker Hub MCP Server, Hub MCP server, Hub MCP
5+
---
6+
7+
The Docker Hub MCP Server is a Model Context Protocol (MCP) server that interfaces with Docker Hub APIs to make rich image metadata 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.
8+
9+
## Key features
10+
11+
- Advanced LLM context: Our MCP Server provides LLMs with detailed, structured context for Docker Hub images, enabling smarter, more relevant recommendations for developers, whether they're choosing a base image or automating CI/CD workflows.
12+
- Natural language image discovery: Developers can find the right container image using natural language, no need to remember tags or repository names. Just describe what you need, and Docker Hub will return images that match your intent.
13+
- Simplified repository management: Hub MCP Server enables agents to manage repositories through natural language fetching image details, viewing stats, searching content, and performing key operations quickly and easily.
14+
15+
## Install Docker Hub MCP server
16+
17+
1. From the **MCP Toolkit** menu, select the **Catalog** tab and search for **Docker Hub** and select the plus icon to add the Docker Hub MCP server.
18+
1. In the server's **Configuration** tab, insert your Docker Hub username and personal access token (PAT).
19+
1. In the **Clients** tab in MCP Toolkit, ensure Gordon is connected.
20+
1. From the **Ask Gordon** menu, you can now send requests related to your
21+
Docker Hub account, in accordance to the tools provided by the Docker Hub MCP server. To test it, ask Gordon:
22+
23+
```text
24+
What repositories are in my namespace?
25+
```
26+
27+
> [!TIP]
28+
> By default, the Gordon [client](/manuals/ai/mcp-catalog-and-toolkit/toolkit.md#install-an-mcp-client) is enabled,
29+
> which means Gordon can automatically interact with your MCP servers.
30+
31+
## Using other clients
32+
If want to integrate the Docker Hub MCP Server into your own development environment, you can find the source code and installation instructions on our [GitHub repository](https://github.com/docker/hub-mcp).
33+
34+
## Use Claude Desktop as a client
35+
36+
1. Add the Docker Hub MCP Server configuration to your `claude_desktop_config.json`:
37+
38+
### For public repositories only:
39+
40+
- `/FULL/PATH/TO/YOUR/docker-hub-mcp-server` - The complete path to where you cloned this repository
41+
```json
42+
{
43+
"mcpServers": {
44+
"docker-hub": {
45+
"command": "node",
46+
"args": ["/FULL/PATH/TO/YOUR/docker-hub-mcp-server/dist/index.js", "--transport=stdio"]
47+
}
48+
}
49+
}
50+
```
51+
### For authenticated access (recommended):
52+
Replace the following values:
53+
- `YOUR_DOCKER_HUB_USERNAME` - Your Docker Hub username
54+
- `YOUR_DOCKER_HUB_PERSONAL_ACCESS_TOKEN` - Your Docker Hub Personal Access Token
55+
- `/FULL/PATH/TO/YOUR/docker-hub-mcp-server` - The complete path to where you cloned this
56+
57+
```json
58+
{
59+
"mcpServers": {
60+
"docker-hub": {
61+
"command": "node",
62+
"args": ["/FULL/PATH/TO/YOUR/docker-hub-mcp-server/dist/index.js", "--transport=stdio", "--username=YOUR_DOCKER_HUB_USERNAME"],
63+
"env": {
64+
"HUB_PAT_TOKEN": "YOUR_DOCKER_HUB_PERSONAL_ACCESS_TOKEN"
65+
}
66+
}
67+
}
68+
}
69+
```
70+
2. Save the configuration file and completely restart Claude Desktop for the changes to take effect.
71+
72+
## Usage with VS Code
73+
1. Add the Docker Hub MCP Server configuration to your User Settings (JSON) file in VS Code. You can do this by opening the `Command Palette` and typing `Preferences: Open User Settings (JSON)`.
74+
75+
### For public repositories only:
76+
77+
- `/FULL/PATH/TO/YOUR/docker-hub-mcp-server` - The complete path to where you cloned this repository
78+
```json
79+
{
80+
"mcpServers": {
81+
"docker-hub": {
82+
"command": "node",
83+
"args": ["/FULL/PATH/TO/YOUR/docker-hub-mcp-server/dist/index.js", "--transport=stdio"]
84+
}
85+
}
86+
}
87+
```
88+
### For authenticated access (recommended):
89+
Replace the following values:
90+
- `YOUR_DOCKER_HUB_USERNAME` - Your Docker Hub username
91+
- `YOUR_DOCKER_HUB_PERSONAL_ACCESS_TOKEN` - Your Docker Hub Personal Access Token
92+
- `/FULL/PATH/TO/YOUR/docker-hub-mcp-server` - The complete path to where you cloned this
93+
94+
```json
95+
{
96+
"mcpServers": {
97+
"docker-hub": {
98+
"command": "node",
99+
"args": ["/FULL/PATH/TO/YOUR/docker-hub-mcp-server/dist/index.js", "--transport=stdio"],
100+
"env": {
101+
"HUB_USERNAME": "YOUR_DOCKER_HUB_USERNAME",
102+
"HUB_PAT_TOKEN": "YOUR_DOCKER_HUB_PERSONAL_ACCESS_TOKEN"
103+
}
104+
}
105+
}
106+
}
107+
```
108+
2. Open the `Command Palette` and type `MCP: List Servers`.
109+
3. Select `docker-hub` and select `Start Server`.
110+
111+
## Usage examples
112+
113+
This section provides task-oriented examples for common operations with Docker Hub
114+
tools.
115+
116+
117+
### Finding images
118+
119+
```console
120+
# Search for official images
121+
$ docker ai "Search for official nginx images on Docker Hub"
122+
123+
# Search for lightweight images to reduce deployment size and improve performance
124+
$ docker ai "Search for minimal Node.js images with small footprint"
125+
126+
# Get the most recent tag of a base image
127+
$ docker ai "Show me the latest tag details for go"
128+
129+
# Find a production-ready database with enterprise features and reliability
130+
$ docker ai "Search for production ready database images"
131+
132+
# Compare Ubuntu versions to choose the right one for my project
133+
$ docker ai "Help me find the right Ubuntu version for my project"
134+
```
135+
136+
137+
### Repository management
138+
139+
```console
140+
# Create a repository
141+
$ docker ai "Create a repository in my namespace"
142+
143+
# List all repositories in my namespace
144+
$ docker ai "List all repositories in my namespace"
145+
146+
# Find the largest repository in my namespace
147+
$ docker ai "Which of my repositories takes up the most space?"
148+
149+
# Find repositories that haven't been updated recently
150+
$ docker ai "Which of my repositories haven't had any pushes in the last 60 days?"
151+
152+
# Find which repositories are currently active and being used
153+
$ docker ai "Show me my most recently updated repositories"
154+
155+
# Get details about a repository
156+
$ docker ai "Show me information about my '<repository-name>' repository"
157+
```
158+
159+
### Pull/push images
160+
161+
```console
162+
# Pull latest PostgreSQL version
163+
$ docker ai "Pull the latest postgres image"
164+
165+
# Push image to your Docker Hub repository
166+
$ docker ai "Push my <image-name> to my <repository-name> repository"
167+
```
168+
169+
### Tag management
170+
171+
```console
172+
# List all tags for a repository
173+
$ $ docker ai "Show me all tags for my '<repository-name>' repository"
174+
175+
# Find the most recently pushed tag
176+
$ docker ai "What's the most recent tag pushed to my '<repository-name>' repository?"
177+
178+
# List tags with architecture filtering
179+
$ docker ai "List tags for in the '<repository-name>' repository that support amd64 architecture"
180+
181+
# Get detailed information about a specific tag
182+
$ docker ai "Show me details about the '<tag-name>' tag in the '<repository-name>' repository"
183+
184+
# Check if a specific tag exists
185+
$ docker ai "Check if version 'v1.2.0' exists for my 'my-web-app' repository"
186+
```
187+
188+
### Docker Hardened Images
189+
190+
```console
191+
# List available hardened images
192+
$ docker ai "What is the most secure image I can use to run a node.js application?"
193+
194+
# Convert Dockerfile to use a hardened image
195+
$ docker ai "Can you help me update my Dockerfile to use a docker hardened image instead of the current one"
196+
```
197+
> [!NOTE]
198+
> To access Docker Hardened Images, a subscription is required. If you're interested in using Docker Hardened Images, visit [Docker Hardened Images](https://www.docker.com/products/hardened-images/).
199+
200+
201+
## Reference
202+
203+
This section provides a comprehensive listing of the tools you can find
204+
in the Docker Hub MCP Server.
205+
206+
### Docker Hub MCP server tools
207+
208+
Tools to interact with your Docker repositories and discover content on Docker Hub.
209+
210+
| Name | Description |
211+
|------|-------------|
212+
| `check-repository` | Check repository |
213+
| `check-repository-tag` | Check repository tag |
214+
| `check-repository-tags` | Check repository tags |
215+
| `create-repository` | Creates a new repository |
216+
| `docker-hardened-images` | Lists available [Docker Hardened Images](https://www.docker.com/products/hardened-images/) in specified namespace |
217+
| `get-namespaces` | Get organizations/namespaces for a user |
218+
| `get-repository-dockerfile` | Gets dockerfile for repository |
219+
| `get-repository-info` | Gets repository info |
220+
| `list-repositories-by-namespace` | Lists repositories under namespace |
221+
| `list-repository-tags` | List repository tags |
222+
| `read-repository-tag` | Read repository tag |
223+
| `search` | Search content on Docker Hub |
224+
| `set-repository-dockerfile` | Sets Dockerfile for repository |
225+
| `update-repository-info` | Updates repository info |

0 commit comments

Comments
 (0)