Files
homelabstack/stacks/mcp
ginnoirandClaude Opus 5.5 d51bad2277 feat(mcp): scope the gateway's Vault token (no more root)
The vault MCP now holds an orphan periodic token (720h) with policy
mcp-gateway: read sys/mounts, CRUD under secret/ (kv-v2), PKI issue/read
under pki/. No sys writes, auth, policy or seal management. The policy is
kept at stacks/mcp/vault-policy.hcl. A vault-token-renewer sidecar renews
the token daily and notifies ntfy if a renewal fails (e.g. Vault sealed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 18:13:25 -06:00
..

mcp — shared MCP gateway

One mcp-proxy container runs the homelab MCP servers once on valhalla. Every agent on every machine connects by URL:

https://mcp.ginnoir.com/servers/<name>/mcp      # streamable HTTP
https://mcp.ginnoir.com/servers/<name>/sse      # legacy SSE

<name> ∈ arr bookstack ntfy uptime-kuma portainer gitea authentik freshrss vault. Every request needs Authorization: Bearer <MCP_PROXY_AUTH_TOKEN> (value in stack.env). Reachable from LAN + tailnet only (Caddy internal_only).

Obsidian is not here; its MCP is the Local REST API plugin inside the Obsidian app (http://127.0.0.1:27123/mcp/ on whichever machine has Obsidian open).

Setting up a new machine / agent

Replace TOKEN with MCP_PROXY_AUTH_TOKEN from stack.env. Repeat the entry per server name.

Claude Code (~/.claude.json → mcpServers):

"gitea": { "type": "http", "url": "https://mcp.ginnoir.com/servers/gitea/mcp",
           "headers": { "Authorization": "Bearer TOKEN" } }

or claude mcp add --scope user --transport http gitea https://mcp.ginnoir.com/servers/gitea/mcp --header "Authorization: Bearer TOKEN"

Codex (~/.codex/config.toml):

[mcp_servers.gitea]
url = "https://mcp.ginnoir.com/servers/gitea/mcp"
http_headers = { Authorization = "Bearer TOKEN" }

Antigravity (~/.gemini/config/mcp_config.json → mcpServers):

"gitea": { "serverUrl": "https://mcp.ginnoir.com/servers/gitea/mcp",
           "headers": { "Authorization": "Bearer TOKEN" } }

Gemini CLI (~/.gemini/settings.json → mcpServers): same as Antigravity but httpUrl instead of serverUrl.

Ops

  • Add / bump a server: edit gateway/Dockerfile (install + pin) and gateway/servers.json, push. .gitea/workflows/build-mcp-gateway.yml builds registry.ginnoir.com/ginnoir/mcp-gateway, then Portainer (stack id 39) redeploys on its next poll. Any new secrets go in stack.env. Every var reaches every server (--pass-environment).
  • Status: curl -H "Authorization: Bearer TOKEN" https://mcp.ginnoir.com/status
  • Logs: docker logs mcp-gateway (servers start one after another, ~60s total)
  • Rotate the token: change MCP_PROXY_AUTH_TOKEN in stack.env, push, update the clients.
  • freshrss-mcp needs Python ≥3.14, so it gets a uv-managed interpreter. The base image has no git, so git-pinned packages install from a GitHub archive/<sha>.tar.gz URL.