diff --git a/CLAUDE.md b/CLAUDE.md index 61ee5ea..6864af9 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -26,7 +26,8 @@ Deployment configuration for a **live, single-host Docker homelab** running on a │ ├── monitoring/ # uptime-kuma, homarr │ ├── remote/ # rustdesk hbbr + hbbs │ ├── dev/ # code-server, bookstack, dbx -│ └── cameras/ # neolink (Reolink E1 Baichuan→RTSP), frigate, frigate-notify +│ ├── cameras/ # neolink (Reolink E1 Baichuan→RTSP), frigate, frigate-notify +│ └── mcp/ # mcp-gateway: all homelab MCP servers at mcp.ginnoir.com/servers//mcp (see its README) ├── portainer-compose.yml # management plane (raw compose, not a Portainer stack) ├── vault.hcl # vault config (deployed alongside portainer-compose.yml) ├── Caddyfile # caddy config (deployed via Gitea Actions or -Caddy) diff --git a/stacks/mcp/README.md b/stacks/mcp/README.md new file mode 100644 index 0000000..e92ba39 --- /dev/null +++ b/stacks/mcp/README.md @@ -0,0 +1,55 @@ +# mcp — shared MCP gateway + +One [mcp-proxy](https://github.com/sparfenyuk/mcp-proxy) container runs the homelab MCP +servers once on valhalla. Every agent on every machine connects by URL: + +``` +https://mcp.ginnoir.com/servers//mcp # streamable HTTP +https://mcp.ginnoir.com/servers//sse # legacy SSE +``` + +`` ∈ `arr bookstack ntfy uptime-kuma portainer gitea authentik freshrss vault`. +Every request needs `Authorization: Bearer ` (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`): +```json +"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`): +```toml +[mcp_servers.gitea] +url = "https://mcp.ginnoir.com/servers/gitea/mcp" +http_headers = { Authorization = "Bearer TOKEN" } +``` + +**Antigravity** (`~/.gemini/config/mcp_config.json` → `mcpServers`): +```json +"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/.tar.gz` URL.