From e4eb1cc6a25f7ada9d68b393db28fc62e462632c Mon Sep 17 00:00:00 2001 From: Anders Olsson Date: Mon, 7 Sep 2026 09:51:05 +0200 Subject: [PATCH] docs(readme): document the stdin option Refs #2 Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01TWLFEoRaRafJm1SpdhWQ6F --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index a360da7..80ca103 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,25 @@ Waiting does **not** consume the restart budget: a slow dependency costs patience, not retries. This is what stops a Docker-backed server from being marked failed at login while the Docker daemon is still starting. +## Servers that read stdin + +MCP servers are stdio-first by convention, and several that also speak HTTP +still start their stdio transport unconditionally. Under the launchd agent the +daemon's stdin is `/dev/null`, so such a server sees EOF on its first read and +shuts down seconds after binding its port. + +`stdin` picks what the child gets on fd 0: + + stdin "keep-open" + +- `inherit` (default) — the child inherits the daemon's stdin. +- `null` — `/dev/null`; a read sees EOF immediately. +- `keep-open` — a pipe that `xy` holds open for the child's lifetime and never + writes to, so a read blocks instead of seeing EOF. + +Use `keep-open` for a server you want supervised in HTTP mode that insists on +running its stdio transport anyway. + ## Start on login (macOS) xy service install # write the LaunchAgent, load it, start the daemon