One Gateway to Rule Them All: MetaMCP + Goose on a Homelab Swarm
I have a lot of services at home. Gitea for code, Nextcloud for files, Pi-hole for DNS, Netdata for monitoring, Nginx Proxy Manager for ingress, ManageLM for server management, PatchMon for patching, Tailscale for the tailnet. Almost all of them now ship an MCP server, and almost every one of them is configured differently — a stdio command here, a bearer token there, a streamable HTTP endpoint somewhere else, each with its own credentials.
That’s fine for one agent on one laptop. It is not fine when you want any agent — my desktop Goose, a container, a script, a colleague’s client — to reach all of them without copy-pasting eight credential blocks into eight config files.
So the goal was:
- Run MetaMCP (an MCP aggregator/gateway) on my Docker Swarm, with its data on the shared NFS share so it can reschedule anywhere.
- Register the homelab’s MCP servers once, inside MetaMCP, using the credentials that were already working locally.
- Expose one HTTPS endpoint, authenticated with an API key, that any MCP client can talk to.
- Point Goose at that single endpoint and prove it works — including a write-capable Tailscale server, because read-only tools only get you so far.
This post covers what I had to change to make MetaMCP fit a swarm, the MCP servers I added, how Goose is wired up, and what it actually looks like in use.
1. The shape of the thing
┌──────────────┐ one streamable-HTTP endpoint ┌──────────────┐
│ Goose │──────── https://mcp.myhome.lan ───▶│ MetaMCP │
│ (any host) │ header: x-api-key │ (namespace │
└──────────────┘ │ "Homelab") │
└──────┬───────┘
│ fan-out
┌──────────────┬──────────────┬──────────────┬──────┴───────┬──────────────┐
▼ ▼ ▼ ▼ ▼ ▼
Gitea Nextcloud Netdata Pi-hole PatchMon Nginx Proxy Mgr
(stdio) (stdio) (HTTP) (stdio) (stdio) (stdio)
│
├── ManageLM (streamable HTTP) ├── Tailscale read (stdio)
└── Tailscale write (stdio, risk=write)
The important architectural bit: MetaMCP has namespaces (groups of MCP servers) and endpoints (a public URL + auth for a namespace). Clients never learn about the nine individual servers — they see one MCP server that happens to expose ~450 tools with server__tool prefixes.
That prefixing matters later: Goose shows up with tools like metamcp__pihole__pihole_local_dns_list, and because two Tailscale servers are registered, the read-only one and the write-enabled one are distinguishable (metamcp__tailscale__… vs metamcp__tailscale-write__…).
2. Installing MetaMCP on the swarm
2.1 What upstream gives you vs. what a swarm wants
Upstream ships a docker-compose.yml with the app (Next.js frontend on 12008 + backend on 12009 inside one container) and Postgres. Three things don’t survive contact with my cluster:
- Bind mounts for state. Compose assumes local volumes. My swarm tasks reschedule between nodes, so Postgres data, plus the
npx/uvxcaches (MetaMCP fetches stdio servers at runtime!), must live on NFS. - A fixed image reference. Everything I run comes from my own registry (
zot.myhome.lan) so nodes never reach out to Docker Hub or GHCR. The upstream image gets mirrored once, then a thin local layer is built on top of it. host.docker.internalassumptions. MetaMCP rewriteslocalhostin server definitions to that by default. On a swarm, my backends are tailnet IPs, so that behaviour has to be switched off.
2.2 The stack file
Postgres is internal-only (no published port); the app is published on the next free port on my host (8091). Credentials here are placeholders — in reality they come from wherever you keep secrets.
services:
app:
image: zot.myhome.lan/metamcp:build-111
environment:
NODE_ENV: "production"
POSTGRES_HOST: "postgres"
POSTGRES_PORT: "5432"
POSTGRES_USER: "metamcp_user"
POSTGRES_PASSWORD: "${METAMCP_DB_PASSWORD}"
POSTGRES_DB: "metamcp_db"
DATABASE_URL: "postgresql://metamcp_user:${METAMCP_DB_PASSWORD}@postgres:5432/metamcp_db"
# better-auth builds cookies/redirects from these — must be the public origin
APP_URL: "https://mcp.myhome.lan"
NEXT_PUBLIC_APP_URL: "https://mcp.myhome.lan"
BETTER_AUTH_SECRET: "${BETTER_AUTH_SECRET}"
# we address backends by tailnet IP, not host.docker.internal
TRANSFORM_LOCALHOST_TO_DOCKER_INTERNAL: "false"
# first-boot bootstrap of the admin account
BOOTSTRAP_USER_EMAIL: "[email protected]"
BOOTSTRAP_USER_PASSWORD: "${METAMCP_ADMIN_PASSWORD}"
BOOTSTRAP_USER_NAME: "admin"
BOOTSTRAP_DISABLE_REGISTRATION_UI: "true"
TZ: "Europe/London"
volumes:
# npx/uvx caches live on NFS so runtime-fetched stdio servers survive a reschedule
- type: bind
source: /opt/docker/data/metamcp/npm
target: /root/.npm
- type: bind
source: /opt/docker/data/metamcp/uv
target: /root/.cache/uv
ports:
- "8091:12008"
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:12008/health || exit 1"]
interval: 30s
timeout: 10s
retries: 5
start_period: 90s
deploy:
replicas: 1
restart_policy: { condition: any, delay: 10s }
update_config: { order: stop-first }
postgres:
image: zot.myhome.lan/postgres16:16-alpine
environment:
POSTGRES_USER: "metamcp_user"
POSTGRES_PASSWORD: "${METAMCP_DB_PASSWORD}"
POSTGRES_DB: "metamcp_db"
PGDATA: "/var/lib/postgresql/data/pgdata"
volumes:
- type: bind
source: /opt/docker/data/metamcp/postgres
target: /var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U metamcp_user -d metamcp_db"]
interval: 10s
timeout: 5s
retries: 10
deploy:
replicas: 1
restart_policy: { condition: on-failure }
update_config: { order: stop-first }
Notes from the trenches:
PGDATAmust be a subdirectory of the mount (…/data/pgdata). Postgres refuses to initialise in a non-empty directory, and NFS roots are never empty.- Postgres major version matters. Upstream expects Postgres 16; I mirrored
postgres:16-alpineaspostgres16in my registry rather than relying onlatest. APP_URLis load-bearing. better-auth derives cookie domains and callback URLs from it. If you leave it aslocalhost, you can sign in but the session cookie won’t stick on the real hostname.- The bootstrap env vars only fire when the users table is empty. They are not “ensure this user exists” — they’re “create this user on a virgin database”. Mine didn’t fire on the first boot (an error was logged and the account was silently absent), so I created the account through the sign-up API instead:
curl -X POST https://mcp.myhome.lan/api/auth/sign-up/email \
-H 'content-type: application/json' \
-H 'origin: https://mcp.myhome.lan' \
-d '{"email":"[email protected]","password":"…","name":"admin"}'
2.3 The custom image (and the two packaging problems)
Upstream’s image is genuinely good: Node 20, pnpm, and uv are already inside, which means MetaMCP can shell out to npx/uvx at runtime and most stdio servers need zero packaging work. Two of mine do not fit that model:
- pihole-mcp is a Go binary that only exists as a GitHub release asset (not on npm or PyPI).
- patchmon-mcp is a small FastMCP wrapper around the PatchMon API that I wrote locally; it isn’t published to PyPI at all, so
uvx --from patchmon-mcpfails with “not found in the package registry”.
So apps/metamcp/Dockerfile is a thin layer that adds exactly those two:
FROM zot.myhome.lan/metamcp:2.4.22
ARG PIHOLE_MCP_VERSION=0.9.0
USER root
# pihole-mcp — Go binary from GitHub releases
RUN set -eu; \
curl -fsSL -o /tmp/pihole-mcp.tar.gz \
"https://github.com/hexamatic/pihole-mcp/releases/download/v${PIHOLE_MCP_VERSION}/pihole-mcp-slim_${PIHOLE_MCP_VERSION}_linux_amd64.tar.gz"; \
mkdir -p /tmp/pihole-mcp-extract; \
tar -xzf /tmp/pihole-mcp.tar.gz -C /tmp/pihole-mcp-extract; \
BIN=$(find /tmp/pihole-mcp-extract -maxdepth 2 -type f -name 'pihole-mcp*' ! -name '*.tar.gz' | head -1); \
test -n "$BIN"; \
install -m 0755 "$BIN" /usr/local/bin/pihole-mcp; \
rm -rf /tmp/pihole-mcp.tar.gz /tmp/pihole-mcp-extract; \
/usr/local/bin/pihole-mcp --version
# patchmon-mcp — vendored python package + console-script equivalent
COPY vendor/patchmon_mcp /opt/patchmon/patchmon_mcp
RUN set -eu; \
uv pip install --system --break-system-packages \
"fastmcp==3.4.7" "httpx" "pydantic" "structlog"; \
printf '%s\n' '#!/bin/sh' \
'exec python3 -c "import sys; sys.path.insert(0, \"/opt/patchmon\"); from patchmon_mcp.server import main; main()" "$@"' \
> /usr/local/bin/patchmon-mcp; \
chmod 0755 /usr/local/bin/patchmon-mcp; \
PYTHONPATH=/opt/patchmon python3 -c "import patchmon_mcp.server"
EXPOSE 12008
Three things in there are scar tissue:
- No
apt-get— at all. The obvious way to getcurl/unzipinto the image breaks the build on Debian trixie:Sub-process /usr/bin/sqv returned an error code (1) Signing key on 6F71F525282841EEDAF851B42F59B5F99B1BE0B4 is not bound ... SHA1 is not considered secure since 2026-02-01T00:00:00ZThe base image’s NodeSource repo key is SHA1-signed and trixie’ssqvpolicy now rejects it, so anyapt-get updatefails.curlandtaralready ship with the base image — use those and skip apt entirely. uv pip install --systemneeds--break-system-packages. Otherwise:error: The interpreter at /usr is externally managed.- Vendoring beats publishing. Shipping the five files under
vendor/patchmon_mcpplus a three-line wrapper is far less work than standing up a private index — and it keeps the image reproducible.
A smoke test keeps the build honest, since the app itself needs Postgres and can’t be booted in CI:
#!/usr/bin/env bash
set -euo pipefail
IMG="$1"
docker run --rm --entrypoint sh "$IMG" -eu -c '
test -x /usr/local/bin/pihole-mcp || { echo "missing pihole-mcp"; exit 1; }
pihole-mcp --version
command -v node >/dev/null && command -v npx >/dev/null && command -v uvx >/dev/null
test -x /usr/local/bin/patchmon-mcp
PYTHONPATH=/opt/patchmon python3 -c "import patchmon_mcp.server"
test -f /app/docker-entrypoint.sh
echo "node: $(node --version)"; echo "uvx: $(uvx --version)"
'
The image is built and released by the same pipeline as every other app in my homelab: push to a build branch, the workflow builds, runs test.sh, pushes zot.myhome.lan/metamcp:build-<run>, and a merge to main deploys the stack.
2.4 Ingress and DNS
One Nginx Proxy Manager host with websockets on (MCP uses them), the wildcard cert, and a Pi-hole local DNS record pointing mcp.myhome.lan at the NPM node:
mcp.myhome.lan → 10.0.0.10:8091 (https, wildcard *.myhome.lan cert, websockets)
Everything on the tailnet can also reach http://<node>:8091 directly, which is handy for debugging before DNS/TLS are in place.

3. Adding the MCP servers
3.1 Do it through the API, not the UI
The UI is fine for one or two servers. For nine, the tRPC API is much better — MetaMCP exposes frontend.mcpServers.*, frontend.namespaces.* and frontend.endpoints.* over /trpc, authenticated by the same better-auth session cookie you get from signing in.
import json, urllib.request, http.cookiejar
BASE = "https://mcp.myhome.lan"
jar = http.cookiejar.MozillaCookieJar("/tmp/mcp-cookies.txt")
opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(jar))
def api(path, payload=None):
req = urllib.request.Request(
BASE + path,
data=None if payload is None else json.dumps(payload).encode(),
headers={"content-type": "application/json", "origin": BASE},
method="GET" if payload is None else "POST",
)
return json.load(opener.open(req, timeout=60))
Two schema traps worth writing down:
bulkImporttakes an unwrapped object. The payload is{"mcpServers": {"name": {...}}}, not{"json": {...}}. Getting this wrong returns the confusingHTTP 400 invalid_type expected object received undefined path ['mcpServers'].create/updaterejectnull.url,description,commandmust be""(or omitted),args[],env/headers{}. Anullwhere a string is expected fails validation.
3.2 The nine servers
The credentials came from the MCP config of the local agent I’d already been using, so the “does this actually work” question was settled before MetaMCP was involved. Types matter:
| Server | MetaMCP type | How it runs | Auth |
|---|---|---|---|
| Gitea | STDIO | npx -y gitea-mcp | personal access token |
| Nextcloud | STDIO | uvx --from nextcloud-mcp-server nextcloud-mcp-server run --transport stdio | app password |
| Pi-hole | STDIO | in-image pihole-mcp binary | local API password |
| PatchMon | STDIO | in-image patchmon-mcp + vendored package | integration API key/secret |
| Nginx Proxy Manager | STDIO | uvx --from nginx-proxy-manager-mcp==2.14.0 --with mcp==1.30.0 nginx-proxy-manager-mcp | NPM email/password |
| Tailscale (read) | STDIO | npx -y @hexsleeves/tailscale-mcp-server | OAuth client + TAILSCALE_ALLOWED_TOOL_RISK=read |
| Tailscale (write) | STDIO | same command | same OAuth client + TAILSCALE_ALLOWED_TOOL_RISK=write |
| ManageLM | STREAMABLE_HTTP | https://managelm.myhome.lan/mcp | x-mcp-id / x-mcp-secret headers |
| Netdata | STREAMABLE_HTTP | http://10.0.0.10:19999/mcp | Authorization: Bearer … |
servers = {
"gitea": {
"type": "STDIO",
"description": "Gitea at https://git.myhome.lan",
"command": "npx",
"args": ["-y", "[email protected]", "-t", "stdio"],
"env": {"GITEA_HOST": "https://git.myhome.lan", "GITEA_ACCESS_TOKEN": TOKEN},
},
"nextcloud": {
"type": "STDIO",
"description": "Nextcloud at https://files.myhome.lan",
"command": "uvx",
"args": ["--from", "nextcloud-mcp-server", "nextcloud-mcp-server",
"run", "--transport", "stdio", "--log-level", "warning"],
"env": {"NEXTCLOUD_HOST": "https://files.myhome.lan",
"NEXTCLOUD_USERNAME": "admin",
"NEXTCLOUD_PASSWORD": APP_PASSWORD},
},
"pihole": {
"type": "STDIO",
"description": "Pi-hole DNS at http://10.0.0.10:8080",
"command": "/usr/local/bin/pihole-mcp",
"args": [],
"env": {"PIHOLE_URL": "http://10.0.0.10:8080", "PIHOLE_PASSWORD": PIHOLE_PW},
},
"patchmon": {
"type": "STDIO",
"description": "PatchMon patching at https://patchmon.myhome.lan",
"command": "/usr/local/bin/patchmon-mcp",
"args": [],
"env": {"PATCHMON_ENDPOINT": "https://patchmon.myhome.lan",
"PATCHMON_TOKEN_KEY": PM_KEY,
"PATCHMON_TOKEN_SECRET": PM_SECRET},
},
"nginx-proxy-manager": {
"type": "STDIO",
"description": "Nginx Proxy Manager at https://proxy.myhome.lan",
"command": "uvx",
# pin both: newest mcp breaks this server's Server.list_tools() call
"args": ["--from", "nginx-proxy-manager-mcp==2.14.0", "--with", "mcp==1.30.0",
"nginx-proxy-manager-mcp"],
"env": {"NPM_URL": "https://proxy.myhome.lan",
"NPM_EMAIL": "[email protected]", "NPM_PASSWORD": NPM_PW},
},
"managelm": {
"type": "STREAMABLE_HTTP",
"description": "ManageLM fleet management",
"url": "https://managelm.myhome.lan/mcp",
"headers": {"x-mcp-id": MLM_ID, "x-mcp-secret": MLM_SECRET},
},
"netdata": {
"type": "STREAMABLE_HTTP",
"description": "Netdata monitoring",
"url": "http://10.0.0.10:19999/mcp",
"headers": {"Authorization": f"Bearer {NETDATA_TOKEN}"},
},
}
print(api("/trpc/frontend.mcpServers.bulkImport", {"mcpServers": servers}))
# {"success": true, "imported": 7}
3.3 Two Tailscale servers, deliberately
This was the trickiest part to get right conceptually. @hexsleeves/tailscale-mcp-server risk-gates every tool (read → write → admin) against TAILSCALE_ALLOWED_TOOL_RISK, at call time:
const LEVEL = { read: 0, write: 1, admin: 2 };
function gate(cfg, required) {
if (LEVEL[cfg.TAILSCALE_ALLOWED_TOOL_RISK] < LEVEL[required])
throw new Error(`Tool requires ${required} risk level`); // 403 risk_level_denied
}
Because the check happens when a tool is invoked, both servers advertise the same 19 tools — the difference only shows up when you call one. So registering one server at read and one at write gives you a safe default plus an explicit escape hatch, both visible to the agent:
metamcp__tailscale__manage_acl → "Tool requires write risk level"
metamcp__tailscale-write__manage_acl → {"data": {}} ✅ (operation: validate)
Worth knowing if you plan to demo manage_acl on read-only: get is read-gated and passes on both, validate/update are write-gated and only pass on the -write server. That’s the cheapest possible proof that the gate works.
3.4 Namespace + endpoint
ns = api("/trpc/frontend.namespaces.list")["result"]["data"]["data"][0]
api("/trpc/frontend.namespaces.update", {
"uuid": ns["uuid"], "name": "Homelab", "description": "Homelab MCP servers",
"mcpServerUuids": [s["uuid"] for s in all_servers],
})
api("/trpc/frontend.endpoints.create", {
"name": "homelab",
"description": "Homelab MCP servers exposed to Goose",
"namespaceUuid": ns["uuid"],
"enableApiKeyAuth": True, # x-api-key
"enableOauth": False,
"enableClientMaxRate": False,
"enableMaxRate": False,
"useQueryParamAuth": False, # keep the key out of URLs/logs
"enableMetamcpAdminTools": False,
"createMcpServer": True,
})
Public URL is then https://mcp.myhome.lan/metamcp/homelab/mcp (/metamcp/:path* is a Next.js rewrite to the backend on 12009). Then create an API key (frontend.apiKeys.create, name regex ^[a-zA-Z0-9_\s-]+$) and use it as x-api-key. Note the list response shape is result.data.apiKeys — it differs from the namespace/endpoint routers, which nest one level deeper.
Sanity check before involving any client:
curl -sS -D- -X POST https://mcp.myhome.lan/metamcp/homelab/mcp \
-H "x-api-key: $METAMCP_KEY" \
-H 'content-type: application/json' \
-H 'accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{
"protocolVersion":"2025-06-18","capabilities":{},
"clientInfo":{"name":"probe","version":"1"}}}'
A 200 with mcp-session-id and serverInfo.name = "metamcp-unified-<namespace-uuid>" means the whole path — TLS, NPM, rewrite, auth, backend — is good.

4. Wiring Goose to MetaMCP
Goose 1.57 supports streamable_http extensions with custom headers, which is exactly the shape MetaMCP’s API-key endpoint wants. One block in ~/.config/goose/config.yaml:
extensions:
metamcp:
enabled: true
type: streamable_http
name: metamcp
display_name: MetaMCP Homelab
description: Homelab MCP servers via MetaMCP (gitea, nextcloud, netdata,
pihole, patchmon, nginx-proxy-manager, managelm, tailscale read + write)
uri: https://mcp.myhome.lan/metamcp/homelab/mcp
headers:
x-api-key: sk_mt_your_key_here
timeout: 300
Back the file up first, and if you edit it programmatically, don’t reach for PyYAML on a machine that doesn’t have it — a surgical text insert is fine:
cp ~/.config/goose/config.yaml ~/.config/goose/config.yaml.bak.$(date +%s)
The --with-streamable-http-extension flag exists for one-off runs, but it has no header syntax, so anything requiring an API key is better served by the config file.
Verify with a throwaway session:
goose run --no-session -t "List the tools you have available from metamcp."
Goose enumerates everything the namespace exposes — roughly 450 tools across nine servers, all prefixed metamcp__<server>__<tool>:
metamcp__gitea__repo__list_my
metamcp__nextcloud__nc_webdav_list_directory
metamcp__netdata__list_raised_alerts
metamcp__pihole__pihole_local_dns_list
metamcp__patchmon__list_hosts
metamcp__nginx-proxy-manager__list_proxy_hosts
metamcp__managelm__search_agents
metamcp__tailscale__list_devices
metamcp__tailscale-write__manage_acl
No per-service credentials on the client. One API key, one URL, and every server is reachable — which was the whole point.

5. What it looks like in use
5.1 Ask a question that spans a service
“Use the metamcp pihole tools to list the local DNS records.”
**14 local DNS record(s):**
- 10.0.0.20 macmini.ts.lan
- 10.0.0.10 casaos.ts.lan
- 10.0.0.31 s25ultra.ts.lan
- 10.0.0.14 files.ts.lan
- 10.0.0.63 rancher.home.lan
- 10.0.0.10 blog.myhome.lan
- 10.0.0.10 news.myhome.lan
- 10.0.0.10 mcp.myhome.lan
Goose picked metamcp__pihole__pihole_local_dns_list out of ~450 tools, and the output is Pi-hole’s, verbatim. This is the “did the plumbing work” test — one hop through TLS, one API key, one fan-out.
5.2 Patch reporting across the fleet
“Through metamcp, use the patchmon tools to list hosts that have pending updates.”
| Host | Updates | Security | Reboot |
|---|---|---|---|
| casaos | 1 | 0 | No |
| files | 1 | 0 | No |
| netdata | 1 | 0 | No |
| pve | 3 | 2 | Yes |
| pve2 | 2 | 2 | Yes |
Five of fourteen hosts pending, and the two Proxmox boxes in security_required state. Goose reached this through patchmon__list_hosts and then patchmon__get_host_packages for each host with pending work — i.e. it chained read calls inside one server namespace without me naming tools.
5.3 Infrastructure questions that need two servers
“Use the nginx-proxy-manager tools to list proxy hosts and tell me which domain points to port 8091 and 8090.”
Goose returned a table of hosts, correctly identifying mcp.myhome.lan → 8091 and news.myhome.lan → 8090, and it also flagged a host whose meta.nginx_online was stale — while separately verifying that nginx -t passed inside the container, i.e. the reported error was historical, not current. That distinction (reported state vs actual state) is exactly the sort of thing a gateway agent is useful for.
5.4 A write operation, deliberately gated
“Call the tailscale-write tool manage_acl with operation ‘validate’.”
{"success":true,"tool":"metamcp__tailscale-write__manage_acl","result":{"data":{}}}
operation: validate is write-gated (it’s read only for operation: get), so this proves the write server really is write-capable, and that the read-only twin still refuses the same call. Starting with validate rather than update is a nice pattern: it exercises the write path end-to-end without changing the tailnet policy.
5.5 The failure modes you’ll actually hit
Being honest about the debugging, because “it just worked” would be a lie:
HTTP 401 Invalid API key typefrom PatchMon while every other server was fine. PatchMon’s read API validates ametadata.integration_typefield on the token, and the credential I’d inherited was an auto-enrolment token (direct-host), not an API token (api). The token and secret were correct; the type wasn’t. Fixing it is a one-row change — and if you can’t log into the PatchMon UI as an admin, verify the secret against the stored bcrypt hash first so you know the credential itself is fine before touching anything.nginx-proxy-manager__list_proxy_hostsdying with a Pydantic error aboutcreated_onbeing anint. Not a credential problem at all: a couple of proxy hosts had been written directly into NPM’s SQLite (bypassing the app) and stored epoch integers instead of datetimes, plus''instead of[]forlocations. One bad row poisons the entire listing because the client validates the whole array. Normalising those columns toYYYY-MM-DD HH:MM:SSand[]fixed every tool in that server.uvx --from patchmon-mcpfailing with “not found in the package registry” — hence the vendored package and wrapper script above.AttributeError: 'Server' object has no attribute 'list_tools'from nginx-proxy-manager-mcp — an incompatibility with the newestmcplibrary, fixed by pinning--with mcp==1.30.0.
None of these were MetaMCP bugs. All of them were upstream packaging or data-quality issues that only became visible because a gateway makes you exercise every server the same way.
6. Final thoughts
A gateway is the right abstraction for more than one agent. The moment a second client needs the same eight services, per-client credential sprawl becomes the dominant maintenance cost. Registering servers once, in one place, with one API key per client, is the difference between “add a client” and “add a client and eight config blocks”.
Namespaces and endpoints are a genuinely good design. One namespace per trust boundary, one endpoint per consumer, and you can revoke a client by deleting a key instead of rotating nine tokens. The server__tool prefixing also solves a real problem for free: two instances of the same server with different risk levels are trivially distinguishable.
Runtime-fetched stdio servers need real persistence. MetaMCP shelling out to npx/uvx is a great default — no packaging work for most servers — but those caches must live on persistent, shared storage in a swarm, or every reschedule re-downloads the world. Same for Postgres: PGDATA in a subdirectory, major version pinned.
Risk gating belongs in the server, not the config file. TAILSCALE_ALLOWED_TOOL_RISK is enforced at call time, so you can’t “accidentally” get write access by registering the wrong command. Running two instances at different levels, and letting the agent see both, is a better pattern than one omnipotent server plus hope.
Expect the friction to be in the last mile. MetaMCP installed, bootstrapped, and proxied fine. The time went into apt/sqv on trixie, a vendored Python package, a pinned mcp version, one token type rather than token value, and two rows of hand-written SQLite. That’s the honest shape of homelab integration work — the architecture is easy, the edges are where the hours go.
Would I do it again? Yes, and sooner. The end state is one URL and one key in any agent’s config, ~450 tools behind it, and a write-enabled Tailscale server that can be turned on for a single task rather than living permanently in every config file. That’s a much better place to build from than nine bespoke credential blocks.