Skip to main content
Glama

homemcp

A security-first, authenticated MCP (Model Context Protocol) server for inspecting and safely managing a Linux home server from Claude, ChatGPT, Gemini CLI, or custom agents.

Designed from the ground up around least privilege, typed host verbs, plan-confirm mutations, WebAuthn step-up authentication, and centralized secret redaction — never raw shell execution over MCP.


Architecture

flowchart LR
  Client["MCP Client (Claude / ChatGPT / CLI)"] -->|"OAuth 2.1 + PKCE / PAT (HTTPS)"| Gateway["homemcp Gateway (Unprivileged Container)"]
  Gateway -->|"HTTP / API"| Proxy["Docker Socket Proxy (Read-Only + Minimal)"]
  Gateway -->|"HMAC + Timestamp Unix Socket"| Agent["homemcpd Host Agent (Systemd Service)"]
  Agent -->|"Typed Verbs & Allowlisted Sudo"| Host["Linux Host / Restic / Systemd / Compose"]
  Gateway -->|"SQLite + Audit Log"| DB[("homemcp.sqlite")]

Layer

Security Boundary

Gateway Container

Non-root uid 1000:1000, read_only rootfs, cap_drop: ALL, no-new-privileges, homemcp_internal bridge

Host Agent (homemcpd)

Runs outside container over a 0660 Unix socket signed with HMAC-SHA256 + nonce replay protection (30s window); executes only typed Zod-validated verbs with execa({ shell: false })

Access Tiers (T0–T3)

Read-only (T0), safe async jobs (T1), plan-then-confirm mutations (T2), and critical actions requiring a fresh WebAuthn passkey within 5 minutes (T3)

Redaction & Trust

Single centralized Redactor scans all outputs, logs, audit records, and errors; external logs/metadata are tagged as untrusted data


Related MCP server: MCP Control Plane

Capabilities Overview

134 tools across 15 toolsets, 9 MCP resources, and 8 workflow prompts (full generated reference · detailed feature catalog):

Toolset

Tools

Tiers

Summary

core

6

T0, T1

Unified server overview, capabilities, async job status/cancel, audit logs

system

13

T0, T2, T3

CPU/RAM/thermal/battery health, sysstat trends, SMART disks, journald logs, security audit, systemd control, passkey-gated reboot

docker

12

T0, T2

Container inspection/logs/stats, update checks, auto-rollback digest updates, prune plans

stacks

11

T0–T3

Scan & validate Compose YAML against security policy, deploy curated templates, soft-trash removal

network

14

T0, T2, T3

NPM proxy hosts, Cloudflare Tunnel ingress, DNS CNAMEs, exposure drift audit, reversible expose_plan/expose_apply & unexpose_plan/unexpose_apply sagas

backup

6

T0, T1, T3

Restic S3/R2 freshness vs RPO, snapshot listing, manual runs, restic check, T3 staging-only restores

vaultwarden

8

T0–T3

Health & lockdown audit + dedicated Vaultwarden backup status, snapshots, run, integrity test, prune plan/apply, & T3 staging restore

apps

1

T0

Configurable HTTP/HTTPS health probes across self-hosted apps

music

14

T0, T1, T2

Navidrome/Subsonic library search, stats, rescan, fuzzy track matcher, playlist CRUD

naviload

10

T0, T1

Search and download tracks/albums/batches via NaviLoad and sync Navidrome

media

12

T0, T1, T2

Jellyfin libraries, sessions, search, scans, scheduled tasks, activity logs

downloads

5

T0, T1, T2

qBittorrent search/sort/inspect, categories, magnet/URL enqueue, pause/resume/recheck, plan-first removal

alerts

6

T0, T1, T2

Built-in metric/health rule watcher, ack/snooze, threshold tuning, ntfy + offline SQLite queue

files

10

T0, T1, T2

Root-allowlisted file browse/read/write/move, .env/key denylist, soft-delete .trash (no rm -rf)

auth

6

T0, T2, T3

OAuth client listing/revocation and passkey-revealed Personal Access Tokens (PATs)


Encrypted Backups & Vaultwarden Backup Management

Backups use Restic (client-side AES-256 encryption) stored in an S3-compatible bucket (such as Cloudflare R2), keeping all encryption keys and bucket secrets isolated in 0600 root:root files outside the MCP gateway:

  • 7 targeted backup sets (vaultwarden, configs, npm, navidrome, system, jellyfin, userdata) archive consistent SQLite .backup copies and critical configuration while excluding huge regenerable media/cache directories.

  • Dedicated Vaultwarden backup management (vaultwarden_backup_*): inspect RPO freshness (vaultwarden_backup_status), browse snapshots (vaultwarden_backup_snapshots), trigger backups (vaultwarden_backup_run), run automated SQLite PRAGMA integrity_check + cipher count parity tests (vaultwarden_backup_test), plan & apply retention pruning (vaultwarden_backup_prune_plan / vaultwarden_backup_prune_apply), and stage manual recoveries safely without touching live data (vaultwarden_backup_restore_staging).

Read docs/backups.md and docs/runbooks/restore-vaultwarden.md for details.


Quick Start (60 Seconds in Mock Mode)

Run everything locally against realistic stateful fixtures without touching any server:

pnpm install
pnpm build

# Verify unit/integration tests, deterministic evals, and secret scanner
pnpm test
pnpm eval
pnpm check:secrets

# Start gateway in mock stdio mode (for Claude Desktop / MCP Inspector)
node packages/gateway/dist/cli.js serve --transport stdio --mock

Or run over local HTTP with /mcp or focused toolsets (e.g. /mcp/vaultwarden,backup):

node packages/gateway/dist/cli.js serve --transport http --mock

Production Deployment Summary

  1. Host Agent (homemcpd): Build the agent release (deploy/agent/build-release.sh) and install step-by-step scripts under deploy/agent/ (install-p1.sh read-only baseline -> install-p4.sh backup -> install-p5.sh docker/systemd -> install-p6.sh stacks/files).

  2. Gateway Container (deploy/gateway/): Copy examples/homemcp.config.example.yaml and deploy/gateway/.env.example, set HOMEMCP_SECRET_KEY and HOMEMCPD_HMAC_SECRET, and launch via deploy/gateway/deploy.sh.

  3. Bootstrap Owner Identity: Run docker exec -it homemcp node /app/dist/cli.js auth bootstrap --config /config/homemcp.config.yaml to enroll a WebAuthn passkey, TOTP backup, and offline recovery codes.

Full step-by-step instructions are in docs/deployment.md, docs/auth.md, and docs/clients.md.


Repository Structure

Path

Description

packages/core

Shared types, error model (HomemcpError), tier/scope rules, centralized redactor, YAML config loader, Compose policy validator, path confinement

packages/connectors

Typed HTTP/API clients for Docker, NPM, Cloudflare, Subsonic/Navidrome, NaviLoad, Jellyfin, qBittorrent, Vaultwarden, ntfy, Healthchecks.io, and homemcpd

packages/agent

Privileged Linux host daemon (homemcpd): HMAC socket server, binary allowlist runner, and strict Zod-validated host verbs

packages/gateway

MCP server (stdio / HTTP), OAuth 2.1 + WebAuthn + PAT auth server, SQLite job/plan/alert stores, background watcher, and all 15 tool modules

packages/mock

Stateful in-memory fixtures, MockExecutor, and mock HTTP connectors for zero-risk local testing and CI evals

templates

Curated Compose service templates (actual-budget, homepage, it-tools, ntfy, searxng, shlink, uptime-kuma)

deploy

Systemd units, sudoers rules, staged host installer scripts, and hardened gateway Dockerfile/Compose

evals

Deterministic 40-task functional, security, safety, and prompt-injection evaluation suite

docs

Architecture, threat model, auth, backup guide, feature catalog, client setup, runbooks, and auto-generated tool docs


Documentation Index

License

Apache-2.0

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      A
      maintenance
      All-in-one homelab management MCP server. Docker monitoring, volume backup/restore (with compose and env files), Wake-on-LAN, network scanning, and multi-server SSH management.
      44
      380
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP server and CLI for host and container operations, enabling Docker and Compose control, SSH, host inspection, logs, ZFS, and safe file transfer. It exposes flux and scout MCP tools with parity from the original TypeScript server.
      2
      AGPL 3.0
    • A
      license
      A
      quality
      A
      maintenance
      A unified MCP server for your self-hosted media stack (Radarr, Sonarr, Jellyfin, etc.). It correlates across services to answer questions no single service can, with safety features like untrusted-output fencing and safe-by-default deletions.
      2
      44
      149
      MIT