mcp-proxy runs the 9 homelab MCP servers (arr, bookstack, ntfy, uptime-kuma, portainer, gitea, authentik, freshrss, vault) once on valhalla and exposes each at /servers/<name>/mcp behind a bearer token, so agents on any machine connect by URL instead of each spawning its own npx/uvx processes with copied secrets. Image baked with pinned server versions, built by Gitea Actions to registry.ginnoir.com/ginnoir/mcp-gateway (Portainer never builds). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
59 lines
2.4 KiB
YAML
59 lines
2.4 KiB
YAML
# mcp stack — one shared MCP gateway for every agent on every machine.
|
|
#
|
|
# Before: each agent session (Claude Code, Codex, Gemini/Antigravity, ...) on
|
|
# each machine spawned its own 9 npx/uvx/Go processes, with API tokens copied
|
|
# into ~/.claude.json, ~/.codex/config.toml, ~/.gemini/... by hand.
|
|
# Now: mcp-proxy runs those servers once here and exposes each over
|
|
# streamable HTTP at https://mcp.ginnoir.com/servers/<name>/mcp
|
|
# (SSE at .../sse for older clients). Clients hold a URL + one bearer token.
|
|
#
|
|
# Servers: arr, bookstack, ntfy, uptime-kuma, portainer, gitea, authentik,
|
|
# freshrss, vault (list: gateway/servers.json; pins: gateway/Dockerfile).
|
|
# Obsidian is NOT here: its Local REST API MCP runs inside the Obsidian app
|
|
# itself (desktop-local, and valhalla's instance binds 127.0.0.1 only).
|
|
#
|
|
# Auth: MCP_PROXY_AUTH_TOKEN (stack.env) — every request, /status included,
|
|
# needs `Authorization: Bearer <token>`; mcp-proxy strips it from the child
|
|
# env. Caddy additionally keeps it internal-only (LAN + tailnet). Not behind
|
|
# Authentik forward_auth: agents can't do a browser login.
|
|
#
|
|
# The token is effectively admin over the lab (Portainer, Vault, Gitea,
|
|
# Authentik writes). Treat it like the Portainer API key.
|
|
#
|
|
# Upstreams are the public https://*.ginnoir.com names (same as the clients
|
|
# used before); container -> Caddy hairpin passes internal_only (172.16/12).
|
|
#
|
|
# Image is built by .gitea/workflows/build-mcp-gateway.yml; no build: key here
|
|
# (Portainer never builds — see portainer-never-builds-only-pulls).
|
|
|
|
services:
|
|
mcp-gateway:
|
|
image: registry.ginnoir.com/ginnoir/mcp-gateway:latest
|
|
pull_policy: always
|
|
container_name: mcp-gateway
|
|
restart: unless-stopped
|
|
networks: [edge]
|
|
env_file:
|
|
- stack.env
|
|
command:
|
|
- --named-server-config=/app/servers.json
|
|
- --pass-environment
|
|
- --host=0.0.0.0
|
|
- --port=8096
|
|
- --allowed-host=mcp.ginnoir.com
|
|
- --allowed-host=mcp-gateway:8096
|
|
- --log-level=INFO
|
|
# No published port: only reachable through Caddy on edge.
|
|
healthcheck:
|
|
# /healthz needs the bearer token too.
|
|
test: ["CMD-SHELL", "python -c \"import os,urllib.request as u;u.urlopen(u.Request('http://127.0.0.1:8096/healthz',headers={'Authorization':'Bearer '+os.environ['MCP_PROXY_AUTH_TOKEN']}),timeout=5)\""]
|
|
interval: 60s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 60s
|
|
|
|
networks:
|
|
edge:
|
|
name: edge
|
|
external: true
|