mBm TUI (mbm2)
Menu

Client and Runtime

Part Responsibility Runs where
mbm2 Draws the terminal UI, reads local client settings, sends requests Your terminal
The runtime: v2's Go engine (mbm-runtime), the one every release ships; v1's mbm serve only when you name a v1 build yourself Sessions, agents, tools, providers and their accounts, permissions, terminals, events Your machine or an operator's server
tui.mbm.mn Installer, downloads, these docs, share pages, account and licence, the mBm model gateway, the agent relay (/relay) Your browser; the runtime and mbm2 call the gateway and the relay

The client and the runtime are separate processes that talk over HTTP and event streams. The client keeps no session of its own: what you see is the runtime's state. The website is not the runtime API, and the client never collects account, licence or payment details (docs/01-product/platform-map.md §1, ADR 0203).

Choose A Connection

Local:   terminal -> mbm2 -> shared Go engine (mbm-runtime) -> project sessions
Remote:  terminal -> mbm2 -> existing server -> server-side project sessions
Mode Command Server lifetime
Local mbm2 --dir /path/to/project The first client starts the Go engine and later ones join it; it stops after the last client exits
Existing server mbm2 --attach https://server.example --dir /server/project The operator starts it; quitting the client does not stop it

Local mode uses the runtime the installer placed in ~/.mbm2/runtime/: the Go engine mbm-runtime (mbm-runtime.exe on Windows) only, with no v1 fallback (ADR 0277). MBM_SERVER_BIN selects another server binary, such as a v1 build; mbm2 is never an alias for mbm (ADR 0204, internal/serverproc/engine.go). For an existing server, get its URL, credentials and project directory from its operator. If the --dir path exists locally, the client changes into it first; otherwise the path is passed to the server as is (cmd/mbm-tui/main.go:255-267). Full steps: Connect to a runtime.

Who Owns What

Data Owner Where it lives
Sessions, messages, todos, shares Runtime The runtime's storage
Agents, permissions, providers, MCP servers Runtime mbm.json and the runtime's config directories; /mcps → + Add server writes its mcp key for you
Provider keys, ChatGPT sign-ins, accounts Runtime Go engine: ~/.local/share/mbm/mbm2/credentials.json; v1's runtime: its auth.json
Your mBm key and licence mbm2 auth mbm / mbm2 license apply (mbm2 login signs the computer in for /rc and mbm code, console.json beside it) v2's credential file above; the Go engine and the agent relay link read it
Word aliases, team auto and its budget, relay switch Client mbm2.json[c]
Terminals and terminal workers Runtime Processes on the runtime host
Theme, keybindings, mouse, copy behaviour Client tui.json[c], mbm2.json[c] (Configuration)
Worker recipes and pipelines Client <project>/.mbm/workers.json[c]
UI toggles, open tabs, task board Client kv.json on this machine
Team messages between workers Client In memory, for this run; a message server on 127.0.0.1 registered with the runtime as mbm2_team
Messages from outside agents (peers) Client and tui.mbm.mn/relay The relay holds them until this mbm2 collects them with your mBm key (Agent relay)
Logs Client ~/.local/share/mbm/log/ (Troubleshooting)

Which Machine Runs What

You do Local mode (mbm2) Attach mode (mbm2 --attach https://server)
Send a prompt; the agent edits main.go Your machine edits your file The server edits the server's file
!go test ./... in shell mode Runs on your machine Runs on the server
Open terminals, a terminal worker, /claude A process on your machine A process on the server; claude must be installed and signed in there
<leader>x export Written to your current directory Also written on your machine: the export file is the client's
/connect a provider The key is stored by your local runtime The key is stored by the server's runtime
Team messages between workers Available Off: the runtime is not on this machine

What Crosses The Boundary

Direction Data Result
Client to runtime Authenticated HTTP requests scoped to the directory The runtime reads or changes its state
Runtime to client Global and directory event streams The client updates the visible session and connection state
Client to tui.mbm.mn Links open in your browser; mbm2 auth mbm/license check your key, mbm2 login signs the computer in with the licence service; with an mBm key and relay not false, the agent relay connection (worker names and states, peer messages) Account and licence actions stay on the website

The client connects with HTTP Basic auth and sends the directory with project requests (docs/03-contract/server-contract.md §1). After the first frame it subscribes to the runtime's event streams and reconciles; an interrupted stream retries with backoff and reconciles again rather than trusting what is on screen (docs/06-flow/reconnect-reconcile-flow.md). Attaching to another server or directory can therefore show different sessions.

If It Does Not Connect

Symptom Check first
Local start cannot find a server Re-run the installer without --no-runtime, or set MBM_SERVER_BIN to a trusted mbm
Remote connection fails The operator's URL, credentials, TLS certificate and reachability
Expected session is missing The server URL and --dir before creating another session

An explicit --session <id> is checked before the TUI starts; a missing session or unreachable server is reported instead of opening an empty replacement (cmd/mbm-tui/main.go:188-192). More cases: Troubleshooting.

Published from revision f88fc66f 2026-11-30