Saphan StudioDocs
Reference/Command reference

saphan server

Serve the record's read-only projection: MCP (stdio + HTTP), static HTML, and the /console shell

saphan server

Serve the record's read-only projection: MCP (stdio + HTTP), static HTML, and the /console shell

saphan server

Serve the fleet record's projections — the same compositions the fleet/wave/ledger/board verbs run, over MCP, as static HTML (board_export), and as the live GET /console HTML shell (order dashboard-shell-p1; renamed from /dashboard by console-owner-surface-w6, which carries the old path as a 308 for one release, and behind the master-admin session since w4b). Read-only without exception (§1.1): mutating tools do not exist. The served tool list is NOT repeated here — it is the projection's own, enumerated at runtime by tools/list, by the server instructions and by the unknown-tool refusal, so this sentence cannot outlive it — a hand-kept copy here once did. Every response carries contract v4; state is read fresh from the record on every request (zero cache beyond the read).

Subcommands

SubcommandWhat it does
saphan server reloadRe-read the server's CONFIG (SIGHUP) — state is always fresh from the record
saphan server startStart the projection server (foreground by default; --detach to background it)
saphan server statusReport whether the projection server is running
saphan server stopStop the running projection server (SIGTERM)

saphan server reload

Re-read the server's CONFIG (SIGHUP) — state is always fresh from the record

saphan server reload

saphan server start

Start the projection server (foreground by default; --detach to background it)

saphan server start [--listen host:port] [--stdio] [--access-log path|off] [--tunnel] [--detach] [flags]

Start the projection server in the foreground.

Default bind is 127.0.0.1:7654 — loopback. Binding wider (0.0.0.0, [::]) requires the address given EXPLICITLY: a bare or host-less --listen never widens the bind (the ":port" form is refused, class listen-ambiguous).

--stdio speaks MCP on stdin/stdout instead (for local MCP clients); no listener, no pidfile — the client owns the process lifetime.

--tunnel launches cloudflared as a supervised child process, fronting the loopback listener with a quick tunnel (no named-tunnel config/credentials). The server itself never opens a wider bind and never terminates TLS — cloudflared owns TLS/DNS/network exposure entirely; every route it forwards still sits behind the bearer-auth middleware (server_auth.go) exactly as it does on loopback. Requires a listener (--stdio is refused together with it, class tunnel-needs-listener); a cloudflared binary missing from PATH refuses the start with a named error, not a silent no-op front door.

--access-log writes one Apache-combined line per request (MCP requests log a virtual path: POST /mcp/tools/<name>; refusals log their honest 4xx). Default is stdout (stderr under --stdio: stdout there IS the MCP wire); "off" disables it deliberately; a path is append-opened AT START — an unwritable path refuses the start (class access-log-unwritable).

--detach (order server-detach-v1, parity with "saphan serverd start --detach") re-execs this same binary detached from the invoking terminal (new session, log redirected) and returns once a bounded readiness handshake confirms the server is actually up — never a fork-and-lie. It is refused together with --stdio (class detach-stdio-conflict): --stdio's whole point is that the invoking terminal owns the MCP wire for the life of the process, which a detached process can never provide. The pidfile is always written by the FOREGROUND child, never by the detaching parent.

Options

OptionTypeDefaultDescription
--access-logstringunsetaccess log destination: a path (append), "off", or empty for stdout (stderr under --stdio)
--detachboolfalsere-exec detached (new session, log redirected) and return once the server is confirmed up, instead of blocking in the foreground
--listenstring127.0.0.1:7654bind address (host:port; host is REQUIRED when the flag is given)
--stdioboolfalsespeak MCP on stdin/stdout instead of serving HTTP
--tunnelboolfalsefront the loopback listener with a cloudflared quick tunnel (requires the cloudflared binary on PATH)

saphan server status

Report whether the projection server is running

saphan server status

saphan server stop

Stop the running projection server (SIGTERM)

saphan server stop

On this page