---
title: "Connect Docker Hub to Claude: Automate Repo Tags and Image Manifests"
slug: connect-docker-hub-to-claude-automate-repo-tags-and-image-manifests
date: 2026-11-13
author: Sidharth Verma
categories: ["AI & Agents"]
excerpt: "A complete engineering guide to connecting Docker Hub to Claude via MCP. Automate image manifests, repository tags, and registry operations without writing custom integration code."
tldr: "Learn how to connect Docker Hub to Claude using a managed MCP server. This guide covers bypassing Docker's Registry API quirks, handling rate limits, and building automated image management workflows."
canonical: https://truto.one/blog/connect-docker-hub-to-claude-automate-repo-tags-and-image-manifests/
---

# Connect Docker Hub to Claude: Automate Repo Tags and Image Manifests


If your DevOps team needs to connect Docker Hub to Claude to automate container image pruning, audit repository access, or investigate vulnerability reports, you need a [Model Context Protocol (MCP) server](https://truto.one/what-is-mcp-and-mcp-servers-and-how-do-they-work/). This server acts as the critical translation layer between Claude's LLM function calls and Docker Hub's fragmented REST APIs. You can choose to build and maintain this infrastructure in-house, or use a managed integration platform like Truto to dynamically generate a [secure, authenticated MCP server URL](https://truto.one/managed-mcp-for-claude-full-saas-api-access-without-security-headaches/). 

If your team uses ChatGPT, check out our guide on [connecting Docker Hub to ChatGPT](https://truto.one/connect-docker-hub-to-chatgpt-manage-organization-teams-and-access/) or explore our broader architectural overview on [connecting Docker Hub to AI Agents](https://truto.one/connect-docker-hub-to-ai-agents-monitor-audit-logs-and-secure-tokens/).

Giving a Large Language Model (LLM) agent read and write access to your core container registry is a high-stakes engineering challenge. You must handle complex OAuth 2.0 token lifecycles, accurately map Docker's massive JSON schemas to MCP tool definitions, and navigate Docker's punishing rate limits. Every time Docker updates an endpoint or changes its registry authentication flow, you own the technical debt of updating your server code, redeploying, and testing the integration.

This guide breaks down exactly how to use Truto to generate a secure, managed MCP server for Docker Hub, connect it natively to Claude, and execute complex DevOps workflows using natural language.

> Want to give your AI agents secure, authenticated access to Docker Hub and 100+ other SaaS APIs? Let's talk about [managed MCP architecture](https://truto.one/mcp-buyers-checklist-and-quick-start-guide-for-b2b-saas-2026/).
>
> [Talk to us](https://truto.one/book-a-demo/)

## The Engineering Reality of the Docker Hub API

A [custom MCP server](https://truto.one/how-to-build-mcp-servers-for-ai-agents-2026-hands-on-architecture-guide/) is essentially a self-hosted integration layer. While the open MCP standard provides a predictable, JSON-RPC 2.0 based way for models to discover and execute tools, the reality of implementing it against specialized B2B APIs is painful. Docker Hub is not a single, unified API. It is a complex ecosystem designed to support a massive global developer community, and its API quirks reflect that scale.

If you decide to build a custom Docker Hub MCP server from scratch, here are the specific integration challenges you will face:

**The Dual-Headed API: Hub vs. Registry**
When developers say "Docker API", they are usually talking about two entirely different systems. The Docker Hub API (`hub.docker.com/v2`) handles organizational management, user access, billing, and repository metadata. The Docker Registry API (`registry-1.docker.io/v2`) handles the actual pulling, pushing, and deleting of image layers and manifests. To delete a tag, an LLM cannot just call a Hub endpoint. It must first authenticate against the Hub API, use those credentials to generate a short-lived, scoped OAuth2 bearer token for the Registry API, and then pass that specific token to the Registry to locate and delete the manifest digest. 

**The Personal Access Token (PAT) 403 Problem**
Docker heavily restricts what Personal Access Tokens (PATs) can do. If you authenticate your custom MCP server using a PAT, endpoints like `list_all_docker_hub_audit_logs` or `list_all_docker_hub_group_members` will hard-reject your requests with a `403 Forbidden` error stating: `token issued from personal access token is not allowed`. You must design your MCP server to conditionally require Organization Access Tokens (OATs) or standard password authentication depending on the exact endpoint the LLM is trying to reach.

**Strict Rate Limiting and Backoff Responsibilities**
Docker enforces strict pull and API rate limits. If your AI agent gets stuck in a loop trying to paginate through thousands of repository tags, Docker will respond with a `429 Too Many Requests`. 

*Factual note on rate limits:* Truto does not retry, throttle, or apply backoff on rate limit errors. When Docker Hub returns an HTTP 429, Truto passes that error directly to the caller. Truto normalizes the upstream rate limit information into standardized headers (`ratelimit-limit`, `ratelimit-remaining`, `ratelimit-reset`) per the IETF specification. The caller (your LLM framework or orchestrator) is strictly responsible for interpreting these headers and executing the required retry or backoff logic.

## Generating the Docker Hub MCP Server

Truto solves these architectural challenges through dynamic, [documentation-driven tool generation](https://truto.one/openapi-to-mcp-how-mcp-servers-auto-generate-tools-from-api-docs/). Rather than hand-coding tool definitions, Truto generates them on the fly based on the integration's underlying schema. You can provision a new Docker Hub MCP server using either the Truto UI or the REST API.

### Method 1: Via the Truto UI

For teams who want immediate access without writing configuration scripts, the Truto Dashboard provides a simple deployment path:

1. Navigate to the **Integrated Accounts** page in your Truto dashboard and select your connected Docker Hub account.
2. Click the **MCP Servers** tab.
3. Click **Create MCP Server**.
4. Select your desired configuration (e.g., name, specific tag filters, allowed methods like `read` or `write`, and expiration limits).
5. Copy the generated MCP server URL. This URL contains a cryptographic token that securely maps to this specific Docker Hub connection.

### Method 2: Via the Truto API

For engineering teams embedding AI into their own platforms, you can programmatically generate MCP servers for your end-users. The API validates that the Docker Hub connection has available tools, generates a secure token, stores it in managed infrastructure, and returns a ready-to-use URL.

Execute a `POST` request to the `/integrated-account/:id/mcp` endpoint:

```typescript
const response = await fetch('https://api.truto.one/integrated-account/<INTEGRATED_ACCOUNT_ID>/mcp', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <YOUR_TRUTO_API_KEY>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    name: "Docker Hub AI Agent - Prod Ops",
    config: {
      methods: ["read", "write", "custom"], // Restrict the LLM's capabilities if necessary
      tags: ["repositories", "registry", "audit"]
    },
    expires_at: null // Or provide an ISO datetime for temporary access
  })
});

const mcpServer = await response.json();
console.log(mcpServer.url); 
// Outputs: https://api.truto.one/mcp/a1b2c3d4e5f6...
```

## Connecting the MCP Server to Claude

Once you have your Truto MCP URL, connecting it to Claude requires zero additional coding. The URL is entirely self-contained.

### Method A: Via the Claude UI

If you are using Claude's web or desktop interface with custom integrations enabled:

1. Open Claude and navigate to **Settings -> Integrations -> Add MCP Server**.
2. Provide a descriptive name for the integration (e.g., "Docker Hub via Truto").
3. Paste the URL generated in the previous step.
4. Click **Add**.

Claude will immediately execute an MCP `initialize` handshake with Truto, discover the available Docker Hub tools, and make them available in your chat interface.

### Method B: Via Manual Config File

If you prefer managing your MCP connections via configuration files (standard for Claude Desktop developers), you can edit your `claude_desktop_config.json` file. Because Truto's MCP servers operate over standard HTTP, you will use the `@modelcontextprotocol/server-sse` package to handle the Server-Sent Events transport.

Add the following object to your `mcpServers` configuration:

```json
{
  "mcpServers": {
    "docker-hub-truto": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-sse",
        "https://api.truto.one/mcp/<YOUR_GENERATED_TOKEN>"
      ]
    }
  }
}
```
Restart Claude Desktop. The application will read the configuration, connect to the Truto URL, and populate your available tools.

## Docker Hub Hero Tools for AI Agents

Truto exposes the entirety of the Docker Hub API as discrete, callable tools. When an LLM calls a tool, the input parameters arrive as a flat JSON object. Truto automatically separates this flat namespace into the correct query parameters, path variables, and JSON body payloads expected by Docker. 

Here are the highest-leverage hero tools your AI agent can use to orchestrate Docker Hub.

### list_all_docker_hub_audit_logs

Retrieves detailed audit log events for an organization. This is critical for security and compliance monitoring, allowing an LLM to investigate who modified a repository or changed team access. Note that this requires a Docker Team or Business subscription, and the connection must be established with an OAT or password (PATs will throw a 403).

> "Claude, check the Docker Hub audit logs for the 'acme-corp' account over the last 24 hours. Are there any logs showing changes to organization group permissions?"

### list_all_docker_hub_repository_tags

Returns the list of tags for a specified repository inside a given namespace. This is the primary tool an LLM uses to discover what versions of an image exist before deciding what to deploy or what to delete.

> "List all the repository tags for the 'backend-api' repository in our 'acme-corp' namespace. Show me only the tags pushed in the last 7 days."

### create_a_docker_hub_registry_token

This is the bridge between the Hub API and the Registry API. It creates a short-lived bearer token (OAuth2 password grant) scoped to a single repository. The LLM must call this tool, requesting specific actions like `pull` or `pull,push,delete`, before it can interact with image manifests.

> "I need to delete an old manifest. Generate a registry token for the 'acme-corp/frontend-app' repository with 'pull,push,delete' permissions, and save the token for the next step."

### get_single_docker_hub_registry_manifest_by_id

Retrieves an image manifest from the Docker registry by tag or digest. For multi-platform images, it returns the index listing each platform (OS/architecture). Crucially, this tool counts against Docker's pull rate limit. The LLM uses this to find the exact `sha256` digest required for deletion.

> "Using the registry token you just generated, get the image manifest for the 'v1.0.4-beta' tag in the 'acme-corp/frontend-app' repository. I need you to extract the exact sha256 digest from the response."

### delete_a_docker_hub_registry_manifest_by_id

Deletes an image manifest, which subsequently deletes every tag pointing to it. The `id` parameter must be the manifest digest (`sha256:...`), not a human-readable tag. It strictly requires a registry token with `pull,push,delete` permissions.

> "Delete the image manifest we just identified (sha256:abcd123...) from the 'acme-corp/frontend-app' repository. Use the scoped registry token you generated earlier."

### list_all_docker_hub_org_members

Returns a list of members for an organization. For organizations with insights enabled, this can also expose metrics like `lastloggedinat` or `lastseenat`. 

> "List all organization members for 'acme-corp'. Cross-reference this list with our offboarding document and tell me if any former employees still have active Docker Hub access."

For the complete tool inventory and detailed JSON schemas for body parameters and query structures, visit the [Docker Hub integration page](https://truto.one/integrations/detail/dockerhub).

## Workflows in Action

MCP servers transform LLMs from passive chat interfaces into active infrastructure engineers. By providing Claude with these Docker Hub tools, you can automate complex, multi-step orchestration that previously required custom bash scripts or CI/CD pipeline modifications.

### Scenario 1: Automated Image Vulnerability Triage and Cleanup

When a security scanner flags an old container image as containing a critical CVE, an engineer typically has to log into the Docker Hub UI, find the tag, look up the digest, and delete it manually. With an MCP server, Claude can automate the entire removal lifecycle.

> "Claude, our security scanner flagged the 'v2.1-legacy' tag in the 'acme-corp/payment-service' repository as vulnerable. Please find the exact sha256 digest for this tag and delete the manifest from the registry entirely."

**Step-by-step execution:**
1. Claude identifies that to read and delete a manifest, it first needs a registry token. It calls `create_a_docker_hub_registry_token` with the repository `payment-service` and actions `pull,push,delete`.
2. Claude extracts the `access_token` from the response.
3. Claude calls `get_single_docker_hub_registry_manifest_by_id`, passing the tag `v2.1-legacy` and the new registry token, to retrieve the manifest data.
4. Claude parses the JSON response to isolate the `sha256:...` digest string.
5. Finally, Claude calls `delete_a_docker_hub_registry_manifest_by_id` using the exact digest and the registry token.

```mermaid
sequenceDiagram
    participant User as User
    participant Claude as Claude Desktop
    participant MCP as Truto MCP Server
    participant Hub as Docker Hub API
    participant Reg as Docker Registry API

    User->>Claude: "Find and delete v2.1-legacy..."
    Claude->>MCP: Call create_a_docker_hub_registry_token
    MCP->>Hub: POST /v2/auth/token<br>scope=pull,push,delete
    Hub-->>MCP: Returns JWT Token
    MCP-->>Claude: token data
    Claude->>MCP: Call get_single_docker_hub_registry_manifest_by_id
    MCP->>Reg: GET /v2/acme-corp/payment-service/manifests/v2.1-legacy
    Reg-->>MCP: Returns manifest with digest
    MCP-->>Claude: digest: sha256:xyz...
    Claude->>MCP: Call delete_a_docker_hub_registry_manifest_by_id
    MCP->>Reg: DELETE /v2/acme-corp/payment-service/manifests/sha256:xyz...
    Reg-->>MCP: 202 Accepted
    MCP-->>Claude: Success
    Claude-->>User: "The vulnerable manifest has been successfully deleted."
```

### Scenario 2: Security Audit on Organization Access

IT administrators frequently need to audit who has access to which systems. Instead of manually correlating data, an AI agent can pull the data directly from Docker Hub and analyze it.

> "Claude, perform an access audit on the 'acme-corp' Docker Hub organization. List all current organization members. Then, check the audit logs for the last 48 hours to see if any new users were added to the 'production-deployers' group."

**Step-by-step execution:**
1. Claude calls `list_all_docker_hub_org_members` passing the org name `acme-corp`.
2. The MCP server translates this to a `GET /v2/orgs/acme-corp/members` request, ensuring the authentication uses the OAT instead of a PAT to avoid a 403 error.
3. Claude stores the resulting user list in context.
4. Claude calls `list_all_docker_hub_audit_logs` passing `acme-corp` to fetch recent security events.
5. Claude parses the event payloads looking for `action: group_member_add` targeting the `production-deployers` group.
6. Claude formats a concise summary for the administrator, detailing the current member roster and highlighting any recent privilege escalations.

## [Security and Access Control](https://truto.one/how-do-mcp-servers-handle-data-retention-and-security-for-ai-agents/)

When granting AI agents autonomous access to infrastructure APIs like Docker Hub, security is non-negotiable. Truto's MCP implementation provides strict, configurable boundaries that ensure the LLM only has access to the data and operations you explicitly allow.

*   **Method Filtering (`config.methods`)**: You can restrict the MCP server to only perform specific operations. Setting `methods: ["read"]` ensures the LLM can call `list_all_docker_hub_repository_tags`, but will completely hide `delete_a_docker_hub_registry_manifest_by_id` from the model's capabilities.
*   **Tag Filtering (`config.tags`)**: Grouping tools by functional area allows for granular scoping. You can configure the MCP server to only expose tools tagged with `"registry"`, preventing the LLM from accessing billing or organization management endpoints.
*   **Extra Authentication (`require_api_token_auth`)**: By default, possession of the cryptographic MCP URL grants access. For high-security environments, you can enable this flag. It adds a second authentication layer, requiring the Claude client to pass a valid Truto API token in the Authorization header to execute tools.
*   **Ephemeral Servers (`expires_at`)**: Ideal for temporary audit tasks or contractor workflows. Setting an `expires_at` ISO datetime ensures the MCP token and its associated Key-Value storage are automatically purged by a Durable Object alarm when the time limit is reached, leaving no stale credentials.

## Moving Beyond Basic Scripts

Connecting Docker Hub to Claude via an MCP server replaces brittle, single-purpose automation scripts with flexible, intent-driven infrastructure management. You no longer have to write custom Python scripts to parse registry tags or manage nested OAuth token flows just to delete an image. By using a managed MCP platform like Truto, your engineering team can focus on defining the workflows and guardrails, while the AI agent handles the complex API orchestration.

> Ready to automate your Docker Hub infrastructure with AI agents? Let's build your managed MCP architecture today.
>
> [Talk to us](https://truto.one/book-a-demo/)
