XenMCP Docker agent

com.xenmcp由 xenmcp.com 發布v1.0.1更新於 Nov 11, 2026

Read-only MCP server for one Docker host: containers, inspect, logs, stats, events. No exec.

發布方自己的服務:Docker Recipes

概覽

AI 產生的概覽

針對單一 Docker 主機的唯讀 MCP 伺服器:讓助理列出並檢視容器、讀取日誌、查看即時統計與近期事件,不執行指令也不做變更。

可以做什麼
  • 檢視 Docker 主機資訊:版本、作業系統、CPU、記憶體、容器與映像數量
  • 列出容器,含名稱、映像、狀態、運作時間、連接埠與 compose 專案
  • 檢視容器狀態、結束碼、OOM 終止、重啟次數、健康檢查、限制、掛載與網路
  • 依時間範圍讀取容器日誌,可只取 stdout 或 stderr,支援文字或正規表達式搜尋,每次最多 500 行
  • 查看目前 CPU、記憶體、網路與程序統計,以及最近七天的事件
適用情境
適合讓助理排查某個容器為何重啟、當掉或健康檢查失敗,或檢視單一 Docker 主機上的日誌與資源使用情形,同時不給它任何變更能力。
執行需求
以容器映像形式運行在容器旁,需以唯讀方式掛載 Docker socket 並加入可存取 socket 的使用者群組。HTTP 模式需要 XENMCP_AGENT_KEY(至少 32 個字元)並以 Authorization Bearer 標頭送出,還需反向代理提供 HTTPS,並以 XENMCP_ALLOW_IPS 限定呼叫來源。stdio 模式不需金鑰與連接埠。
安裝前請注意
日誌與檢視結果可能包含個人資料與機密,工具回傳的內容會送到你連接的 AI 用戶端。唯讀掛載 socket 本身無法阻止寫入,真正的限制是代理自身的允許清單。不透過 XenMCP 時沒有個人登入與呼叫紀錄,持有金鑰者權限相同。不想分享的容器應加以隱藏。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 XenMCP Docker agent,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

XenMCP Docker agent

A small, read-only MCP server for the containers on one Docker host. Run it next to your containers, put it behind your reverse proxy, and connect it to Claude, Cursor or VS Code through XenMCP: every person signs in on their own (OAuth), access can be revoked at any time, and every call is in the journal.

It can see, never change:

ToolWhat it does
docker_infoDocker version, OS, CPUs, memory, number of containers and images
list_containersName, image, state, uptime, ports, compose project
inspect_containerState, exit code, OOM kill, restarts, health check, limits, log driver, mounts, networks — never environment variables or command arguments
container_logsLast lines, a time window (since / until: 15m, 6h, 2d or an ISO time), stdout or stderr only, text or regex search; at most 500 lines per call
container_statsCPU, memory, network, processes right now
recent_eventsstart, stop, die (with exit code), kill, OOM, restart, health status — up to 7 days

There is no tool that starts, stops, restarts, removes, execs, builds or pulls. The agent sends Docker only a short list of GET requests (lib.mjs, allowedPath) and refuses everything else before it leaves the process.

Install

  1. In the XenMCP panel: Add server → Docker agent. It shows a key and the command below with the key filled in.
  2. On your Docker host:
bash
docker run -d --name xenmcp-docker-agent --restart unless-stopped \  --read-only --cap-drop ALL --security-opt no-new-privileges --memory 128m \  --group-add "$(stat -c %g /var/run/docker.sock)" \  -v /var/run/docker.sock:/var/run/docker.sock:ro \  -e XENMCP_AGENT_KEY=<the key from the panel> \  -p 127.0.0.1:8090:8080 \  ghcr.io/xenmcp/docker-agent:1.0
  1. Make it reachable over HTTPS through your reverse proxy (below), e.g. https://docker-agent.example.com/mcp.
  2. In the panel: enter that address and press Check and save.

Or with Docker Compose:

yaml
services:  xenmcp-docker-agent:    image: ghcr.io/xenmcp/docker-agent:1.0    restart: unless-stopped    read_only: true    cap_drop: [ALL]    security_opt: [no-new-privileges:true]    mem_limit: 128m    group_add: ["${DOCKER_GID}"]   # stat -c %g /var/run/docker.sock    volumes:      - /var/run/docker.sock:/var/run/docker.sock:ro    environment:      XENMCP_AGENT_KEY: ${XENMCP_AGENT_KEY}    ports:      - 127.0.0.1:8090:8080

Reverse proxy

The agent listens on plain HTTP; your proxy adds HTTPS. It must pass X-Forwarded-For (all three below do).

Caddy

docker-agent.example.com {  reverse_proxy 127.0.0.1:8090}

nginx

nginx
server {  listen 443 ssl;  server_name docker-agent.example.com;  # ssl_certificate …; ssl_certificate_key …;  location /mcp {    allow 46.225.57.217;   # XenMCP    deny all;    proxy_pass http://127.0.0.1:8090;    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;    proxy_buffering off;    proxy_read_timeout 120s;  }}

Traefik (labels on the agent container, without ports)

yaml
labels:  - traefik.enable=true  - traefik.http.routers.xenmcp-agent.rule=Host(`docker-agent.example.com`) && PathPrefix(`/mcp`)  - traefik.http.routers.xenmcp-agent.tls.certresolver=letsencrypt  - traefik.http.services.xenmcp-agent.loadbalancer.server.port=8080

Without XenMCP

The agent is a plain MCP server (Streamable HTTP at /mcp), so any client that can send a header works. Set XENMCP_ALLOW_IPS to the addresses that may call it (* for any, only behind your own proxy or firewall) and send the key as Authorization: Bearer <key>. Without XenMCP there is no per-person sign-in and no journal: everyone with the key has the same access.

Over stdio, for a local client

Started with --stdio, the agent talks MCP over stdin/stdout instead of HTTP: no key, no port, no address list – whoever starts it already has the Docker socket. For Claude Desktop, Cursor or VS Code on the Docker host itself:

json
{  "mcpServers": {    "docker": {      "command": "docker",      "args": ["run", "-i", "--rm", "--no-healthcheck", "--read-only", "--cap-drop", "ALL", "--security-opt", "no-new-privileges",               "--group-add", "<stat -c %g /var/run/docker.sock>",               "-v", "/var/run/docker.sock:/var/run/docker.sock:ro",               "ghcr.io/xenmcp/docker-agent:1.0", "node", "server.mjs", "--stdio"]    }  }}

Or from a checkout: node server.mjs --stdio. The same six read-only tools; XENMCP_CONTAINERS and the xenmcp.hide label apply.

It is listed in the official MCP Registry as com.xenmcp/docker-agent (server.json in this repository).

Settings

VariableDefault
XENMCP_AGENT_KEY—Required over HTTP, at least 32 characters; XenMCP sends it as Authorization: Bearer. Not used with --stdio.
XENMCP_ALLOW_IPS46.225.57.217Who may call, comma-separated, CIDR allowed. Behind a proxy on a private address the last X-Forwarded-For entry counts.
XENMCP_CONTAINERSallOnly these containers, comma-separated, * as wildcard (e.g. shop-*,nginx).
XENMCP_MAX_SCAN_MB200How much log one search or stream filter reads at most.
PORT8080

Hide single containers with the label xenmcp.hide=true: they are left out of every answer.

Good to know

  • Logs are what Docker keeps: with the default json-file driver everything since the container was created, unless you set max-size/max-file. A recreated container starts with an empty log. For history beyond that, use Grafana + Loki.
  • Logs can contain personal data and secrets. What a tool returns goes to the AI client you connect (for Claude: Anthropic). Hide containers you do not want to share.
  • The socket is mounted read-only, but Docker's API does not know read-only mounts — the limit is the agent's own allow-list, which is why it is small, open source and tested (npm test, npm run e2e).

Develop

bash
npm cinpm test        # unit tests and stdio (no Docker needed)npm run e2e     # against your local Docker (starts and removes three busybox containers)

Questions and feedback

Ask in the XenMCP community on Discord (forum #help, tag docker-agent) or open an issue here. Security issues: [email protected], not in public.

MIT licence. Made by Xenaxio for XenMCP.

來源:README.md,提交 6497612

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.1最新Nov 11, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Docker 整合