How to Use the Docker-Hub MCP Server: A Complete Guide

Learn how to install the Docker-Hub MCP Server and connect AI agents to Docker Hub’s API. This guide covers setup, configuration, and testing with a prompt to list repositories, making container management a breeze.

Ashley Goolam

Ashley Goolam

14 July 2025

How to Use the Docker-Hub MCP Server: A Complete Guide

Ready to take your container game to the next level with some AI magic? Let’s dive into the Docker-Hub MCP Server, a nifty tool that connects your Docker Hub account to AI agents for seamless automation. In this conversational guide, we’ll explore what the Docker-Hub MCP Server is, why it’s a game-changer, and how to set it up with Claude Desktop, VS Code, or Cursor. Plus, we’ll test it with a real-world example to list your Docker Hub repositories. Let’s get started!

💡
Want a great API Testing tool that generates beautiful API Documentation?

Want an integrated, All-in-One platform for your Developer Team to work together with maximum productivity?

Apidog delivers all your demands, and replaces Postman at a much more affordable price!
button

What Is the Docker-Hub MCP Server?

If you’re into Docker, you know Docker Hub is the go-to place for storing and sharing container images. It’s like a cloud library for your Docker projects. But managing repositories, tags, and permissions manually can be a chore. Enter the Docker-Hub MCP Server, an open-source tool that lets AI agents interact with Docker Hub’s API using the Model Context Protocol (MCP).

docker hub

Why You’ll Love the Docker-Hub MCP Server

The Docker-Hub MCP Server is a dream come true for developers and DevOps folks. Here’s why it rocks:

Whether you’re managing a single project or a sprawling CI/CD pipeline, the Docker-Hub MCP Server makes Docker Hub feel like an extension of your AI toolkit.

Installing and Using the Docker-Hub MCP Server

Prerequisites

Before we start, make sure you have:

Step 1: Clone the Docker-Hub MCP Server Repository

First, grab the Docker-Hub MCP Server code from GitHub. Open your terminal and run:

git clone https://github.com/docker/hub-mcp.git
cd hub-mcp

This pulls the source code to your machine and moves you into the project directory.

Step 2: Install and Build the Server

Next, set up the server by installing dependencies, building the project, and starting it:

npm install
npm run build
npm start -- --transport=stdio --port=3000

You should see logs confirming the server is running. Keep the terminal open to keep the server active.

Step 3: Configure an MCP Client

Now, let’s connect the Docker-Hub MCP Server to an MCP-compatible client. You’ll need your Docker Hub Username and Personal Access Token (PAT) from app.docker.com/accounts. Here’s the MCP configuration to use:

{
  "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"
      }
    }
  }
}

Replace /FULL/PATH/TO/YOUR/docker-hub-mcp-server/dist/index.js with the absolute path to the dist/index.js file in your cloned repository (e.g., /home/user/hub-mcp/dist/index.js). Swap YOUR_DOCKER_HUB_USERNAME and YOUR_DOCKER_HUB_PERSONAL_ACCESS_TOKEN with your actual Docker Hub credentials.

Option 1: Claude Desktop

  1. Open Claude Desktop and go to Settings (gear icon).
  2. Select the Developer tab and click Edit Config.
  3. Open or create claude_desktop_config.json in the folder that opens.
  4. Paste the MCP configuration above, updating the path, username, and PAT.
  5. Save the file, close Claude Desktop, and restart it.
  6. Check logs at ~/Library/Logs/Claude (macOS) or %APPDATA%\Claude\logs (Windows) if issues arise.
edit configurations on claude

Option 2: VS Code

  1. Open VS Code and click the MCP Servers icon in the sidebar of github copilot.
mcp icon

2. Click Show Configuration to open settings.json.

edit vs code configurations

3. Paste the MCP configuration, updating the path, username, and PAT.

4. Save and test the server via the MCP Servers panel.

Option 3: Cursor

  1. Open Cursor and go to Settings > Tools and Integrations.
  2. Click Add a Custom MCP Server.
edit mcp configurations in cursor

3. Paste the MCP configuration, updating the path, username, and PAT.

4. Save and switch to Agent Mode in the chat panel to test the server.

Step 4: Test the Docker-Hub MCP Server

Let’s put the Docker-Hub MCP Server to work! In your chosen MCP client (Claude Desktop, VS Code, or Cursor), try this prompt:

Using the Docker-Hub MCP Server, list all repositories in my namespace goolam

The AI will use the Docker-Hub MCP Server to query Docker Hub’s API and return a list of repositories under the “goolam” namespace. For example, you might see output like:

Repositories in namespace 'goolam':
- goolam/webapp
- goolam/api-server
- goolam/data-processor

If the namespace doesn’t exist or has no repositories, the AI will let you know. This test confirms the server is working and your credentials are set up correctly.

testing the mcp with cursor
Testing the Docker-Hub MCP Server with Cursor
testing the mcp server in vs code
Testing the Docker-Hub MCP Server in VS Code

Troubleshooting Tips

How the Docker-Hub MCP Server Powers AI Workflows

The Docker-Hub MCP Server is like a superpower for your Docker workflow. By connecting AI agents to Docker Hub’s API, it enables tasks like:

For example, you could ask, “Tag my latest image as ‘production’” or “Check vulnerabilities in my ‘webapp’ repo.” The Docker-Hub MCP Server translates these prompts into API calls, making complex tasks feel effortless.

Since it’s in trial mode, it supports a subset of Docker Hub’s API, but it’s already a fantastic tool for automating repetitive tasks. Plus, being open-source, you can hack it to add custom features!

Wrapping Up

And there you have it! The Docker-Hub MCP Server is your ticket to blending AI smarts with Docker Hub’s power. By setting it up with Claude Desktop, VS Code, or Cursor, you can manage your containers with simple prompts, saving time and brainpower. Whether you’re a solo dev or running a massive DevOps pipeline, this tool brings a touch of AI magic to your Docker workflow.

💡
Want a great API Testing tool that generates beautiful API Documentation?

Want an integrated, All-in-One platform for your Developer Team to work together with maximum productivity?

Apidog delivers all your demands, and replaces Postman at a much more affordable price!
button

Explore more

4 Methods to Use Kimi K2 for Free

4 Methods to Use Kimi K2 for Free

Discover four free methods to use Kimi K2, the open agentic intelligence model. Plus, see how Apidog MCP Server lets you connect, document, and automate your API workflows with Kimi K2.

14 July 2025

Is Kimi K2 API Pricing Really Worth the Hype for Developers in 2025

Is Kimi K2 API Pricing Really Worth the Hype for Developers in 2025

Discover Kimi K2 API pricing at $0.15 per million input tokens and $2.50 output tokens. Compare costs with competitors, learn integration strategies with Apidog, and explore the 1 trillion parameter model's capabilities for developers seeking cost-effective AI solutions in 2025.

14 July 2025

How to Use Kimi K2 in VSCode Copilot

How to Use Kimi K2 in VSCode Copilot

In an era where AI-powered developer tools are no longer a novelty but a necessity, Visual Studio Code's Copilot has firmly established itself as a leader. However, the true power of AI lies in its diversity and the specialized capabilities of different models. What if you could swap out the default engine of your Copilot for something more powerful, more specialized, or even something you run yourself? This article will guide you through the process of integrating the formidable Kimi K2 languag

13 July 2025

Practice API Design-first in Apidog

Discover an easier way to build and use APIs