•
2 min read
Homeserver MCP

A small Python service exposing my home server’s live status over the Model Context Protocol (MCP), so I can just ask an LLM “how’s my server doing?” from any MCP-aware client — I use it from Mistral AI’s Le Chat.

What it exposes

8 read-only tools, no write access at all:

  • Containers — status of every Podman container
  • Disk usage — free space across the storage/media volumes
  • System load — CPU/RAM/load average
  • Service logs — recent logs from a fixed allow-list of containers
  • AdGuard Home stats — DNS queries, blocked percentage, top domains/clients

How it’s built

  • FastMCP (official mcp Python SDK), Streamable HTTP transport
  • Bearer token auth via a custom ASGI middleware, timing-safe comparison
  • Prometheus metrics (tool call counts, duration, auth failures) on a separate internal port, never exposed publicly
  • Deployed rootless with Podman, behind Caddy with automatic HTTPS and a dedicated fail2ban jail

Part of my homelab. A Mistral Workflow also calls into it every morning to generate a daily server health report, summarized in plain language — see my shopping list project for more on what Mistral Workflows are and why I picked them.