# 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//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 `; 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