0003 — One daemon owns all upstreams; clients connect over local HTTP
Status: Accepted (2026-11-03). Amended:
- 2026-11-04 (wayfindr-fth):
wayfindr service installsupports launchd and systemd only, and refuses elsewhere, Windows included. - 2026-11-04 (wayfindr-st1): an HTTP upstream that doesn't speak Streamable HTTP falls back to the legacy HTTP+SSE transport;
transport = "sse"forces it. - 2026-11-05 (wayfindr-6hj): HTTP upstreams are re-polled for tool changes every
index.refresh_interval. - 2026-11-06 (wayfindr-t08.11): a daemon lock allows one daemon per data directory.
- 2026-11-07 (wayfindr-r609):
wayfindr stopandwayfindr logs. - 2026-11-09 (wayfindr-7a8p): the daemon advertises elicitation and relays it to clients (0008); sampling and roots stay declined.
- 2026-11-11 (wayfindr-5rbg): client auth has a default client token and scoped ones (0012).
- 2026-11-12 (wayfindr-3e6f): the command is now
wayfindr start, which runs the daemon in the background by default (--foregroundruns it in place);wayfindr serveremains as a hidden alias. - 2026-11-21 (wayfindr-z5q8): a request through a tunnel can reach
/mcpwith a remote client token, for cloud agents (0021).
Context
If every harness spawned its own stdio gateway, N processes would each spawn duplicate stdio upstreams and race each other to refresh the same OAuth tokens. With rotating refresh tokens, that race logs users out (0004).
Decision
wayfindr serveruns one daemon that exposes Streamable HTTP on127.0.0.1:7777(configurable).wayfindr service installregisters it as a launchd or systemd user unit. (Amended 2026-11-12, wayfindr-3e6f: the command iswayfindr start.) On other systems, Windows included,service installrefuses and says to run the daemon under your own supervisor (amended 2026-11-04, wayfindr-fth).- The daemon holds an OS lock on a file in its data directory while it runs, so a second daemon on that directory refuses to start rather than share its store. The OS drops the lock when the process exits, so it is never stale (amended 2026-11-06, wayfindr-t08.11).
wayfindr stopstops the daemon that holds it, andwayfindr logsprints the daemon's log (amended 2026-11-07, wayfindr-r609). wayfindr stdiois a stateless shim that forwards stdio to the daemon and starts the daemon if needed.- Client auth: the daemon binds to loopback only, validates
Origin, and requires a bearer client token generated bywayfindr init. Amended 2026-11-11: that is the default client token; scoped client tokens limit a client to named connectors and can't use the admin API (0012). The daemon still binds to loopback only, but a request through a tunnel the user runs can reach/mcpwhen it carries a remote client token (amended 2026-11-21, wayfindr-z5q8; 0021). - Protocol versions: the daemon serves 2025-06-18, 2025-11-25, and 2026-07-28 to clients. It negotiates the highest common version with each upstream independently, and holds stateful 2025-x upstream sessions itself, hidden from stateless clients.
- Toward upstreams, the daemon advertises no sampling, elicitation, or roots capability. Server-to-client requests (2025-x) and
input_requiredresults (2026-07-28) are declined, and the originatingcall_toolreturns an error. (Amended 2026-11-09, wayfindr-7a8p: the daemon advertises elicitation and relays it; see 0008.) - Upstream lifecycle: on startup, every connector is connected and synced. After that, stdio upstreams are spawned on demand and stopped after 10 minutes idle. HTTP upstreams reconnect lazily. They are also re-polled for tool changes every
index.refresh_interval, or at the interval atools/listcache hint gives (amended 2026-11-05, wayfindr-6hj). An HTTP upstream whoseinitializePOST gets a 4xx other than 401 or 403, as a legacy server answers, is retried over HTTP+SSE;transport = "sse"uses it from the start (amended 2026-11-04, wayfindr-st1).
Consequences
- Single-flight token refresh only needs in-process locking.
- HTTP-only clients need the daemon running, so the service unit matters.
- The data model carries a user dimension (a single default user in local mode), so a later multi-user server mode doesn't need a schema rewrite. Team mode, and refresh coordination across replicas, are deferred.