# XenMCP Docker agent

> XenMCP Docker agent is an open-source MCP server for developer tools. Read-only view of one Docker host: containers, logs, stats and events, never exec. It runs as a hosted remote server, so there is nothing to install locally.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** self-hosted, Linux, API, CLI
- **Website:** https://xenmcp.com/catalog/docker/
- **Repository:** https://github.com/xenmcp/docker-agent
- **MCP Registry name:** com.xenmcp/docker-agent
- **Categories:** developer tools, cloud and infrastructure
- **Listing updated:** 2026-11-14

## About

This small agent sits next to the containers on one Docker host and answers questions about them through MCP. It can see state but never change it: the code sends Docker only a short allow-list of GET requests and refuses everything else, so there is no way to start, stop, restart, remove, exec, build or pull.

Secrets get special care. Inspect output never includes environment variables or command arguments, containers can be hidden with a label or an allow-list, and the agent answers only with the right bearer key from allowed IP addresses. Logs come from what Docker keeps itself, up to 500 lines per call, so no Grafana or Loki is needed, though a recreated container starts with an empty log.

It runs as a hardened container behind your own HTTPS reverse proxy, and examples for Caddy, nginx and Traefik are given. It is MIT licensed and is designed to be connected through XenMCP, which handles per-person OAuth and a call journal, but it also works with any client that can send an Authorization header, or over stdio locally.

## Features

- **Container overview:** list_containers shows image, state, uptime, ports and compose project.
- **Deep inspection:** State, exit code, OOM kills, restarts, health checks, limits and mounts.
- **Log search:** Time windows, stderr only, text or regex, up to 500 lines per call.
- **Live stats:** CPU, memory, network and processes right now.
- **Event history:** Starts, stops, deaths with exit code, OOM and health changes for up to 7 days.
- **Hardened by design:** Read-only code path, key and IP restrictions, hidden environment variables.

## Good for

- Find out why a container restarted overnight
- Search worker logs for timeouts in the last hour
- See which container uses the most memory
- Check when a health check last failed
- Give an assistant host visibility without SSH

## Install

### Claude Code (Terminal)

```sh
claude mcp add docker-agent --env XENMCP_AGENT_KEY='<XENMCP_AGENT_KEY>' -- docker run -i --rm -e XENMCP_AGENT_KEY ghcr.io/xenmcp/docker-agent:1.0.1
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "docker-agent": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "XENMCP_AGENT_KEY",
        "ghcr.io/xenmcp/docker-agent:1.0.1"
      ],
      "env": {
        "XENMCP_AGENT_KEY": "<XENMCP_AGENT_KEY>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "docker-agent": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "XENMCP_AGENT_KEY",
        "ghcr.io/xenmcp/docker-agent:1.0.1"
      ],
      "env": {
        "XENMCP_AGENT_KEY": "<XENMCP_AGENT_KEY>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "docker-agent": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "XENMCP_AGENT_KEY",
        "ghcr.io/xenmcp/docker-agent:1.0.1"
      ],
      "env": {
        "XENMCP_AGENT_KEY": "<XENMCP_AGENT_KEY>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "docker-agent": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "XENMCP_AGENT_KEY",
        "ghcr.io/xenmcp/docker-agent:1.0.1"
      ],
      "env": {
        "XENMCP_AGENT_KEY": "<XENMCP_AGENT_KEY>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "docker-agent": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "XENMCP_AGENT_KEY",
        "ghcr.io/xenmcp/docker-agent:1.0.1"
      ],
      "env": {
        "XENMCP_AGENT_KEY": "<XENMCP_AGENT_KEY>"
      }
    }
  }
}
```

## Tools

- `docker_info`: Docker version, OS, CPUs, memory and counts.
- `list_containers`: Name, image, state, uptime, ports and compose project.
- `inspect_container`: State, exit code, OOM, restarts, health, limits, mounts, networks.
- `container_logs`: Last lines, time window, stream filter, text or regex search.
- `container_stats`: CPU, memory, network and processes right now.
- `recent_events`: Start, stop, die, kill, OOM, restart and health events.

## FAQ

### Can it stop or restart containers?

No. It has no such tool and refuses anything outside its read list.

### How far back do logs go?

As far as Docker keeps them; with the default json-file driver that is since the container was created.

### Does it work with Docker Compose and Portainer?

Yes. It reads all containers on the host however they were started.

### Do I need a domain?

Yes, an HTTPS address through your reverse proxy, unless you run it over stdio locally.

### Is XenMCP Docker agent free?

Yes. XenMCP Docker agent is open source, so you can use and self-host it for free.

### How do I add XenMCP Docker agent to Claude Code?

Run this command in your terminal: claude mcp add docker-agent --env XENMCP_AGENT_KEY='<XENMCP_AGENT_KEY>' -- docker run -i --rm -e XENMCP_AGENT_KEY ghcr.io/xenmcp/docker-agent:1.0.1

### What are the best alternatives to XenMCP Docker agent?

The closest alternatives to XenMCP Docker agent are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/xenmcp-docker-agent
