Expand description
Spawn the daemon as a detached background process.
When an MCP client starts and no daemon is running, it spawns one using the
current binary with the daemon subcommand. The spawned process is fully
detached so it outlives the parent MCP session.
Functions§
- client_
should_ take_ over - Pure version comparison: returns
trueif the client should take over the daemon. Only returnstruewhen both versions parse successfully AND client > daemon. Unparseable versions or equal/older client always returnfalse(reuse daemon). - ensure_
daemon - Ensure a daemon is running and return its info. If a daemon is found (via discovery file or port scan), we MAY take it over if the client is newer. Otherwise we spawn a fresh daemon on the first free port in the scan range.