Transports & ports
stdio is the default MCP transport; streamable-http multiplexes many agent sessions for orchestrators. The default ports, and why the UI stays loopback-only.
Transports#
memtrace mcp serves MCP tools over one transport per process, chosen by MEMTRACE_TRANSPORT. stdio is the default — the shape every coding agent (Claude Code, Cursor, Codex, and the rest) is registered to use out of the box.
| MEMTRACE_TRANSPORT value | Resolves to | Notes |
|---|---|---|
(unset) / stdio | stdio | Default. One agent process per server instance, launched by the client. |
streamable-http | streamable-HTTP | One server multiplexes many concurrent agent sessions — for orchestrators and dashboards. |
http | streamable-HTTP | Alias for streamable-http. |
sse | streamable-HTTP | Deprecated MCP-spec name, still accepted as an alias — prints a one-line stderr deprecation hint. |
anything else | (refused) | Unrecognized values are a hard error: the process exits 2 rather than silently falling back to stdio. |
memtrace mcp attaches to an already-running memtrace start daemon for the same workspace instead of spawning a second stack, and stays headless (no UI port) unless you pass --ui or set MEMTRACE_MCP_UI=1.
Ports#
| Port | Service | Env override | Default bind |
|---|---|---|---|
3030 | UI + REST API + MCP-HTTP dashboard server | MEMTRACE_UI_PORT | 127.0.0.1 (loopback-only) |
3000 | MCP server when MEMTRACE_TRANSPORT is streamable-http/http/sse | MEMTRACE_PORT | 0.0.0.0 (all interfaces) |
50051 | MemDB loopback gRPC — the memcore-server sidecar | MEMTRACE_MEMDB_LOOPBACK_PORT | 127.0.0.1 |
A bind failure on the MCP HTTP port surfaces a clear message telling you the port may be in use and to set MEMTRACE_PORT to a free one.
$ MEMTRACE_TRANSPORT=streamable-http MEMTRACE_PORT=3000 memtrace mcp # [memtrace] MCP streamable-HTTP transport listening on http://0.0.0.0:3000/mcp
Loopback by default#
memtrace start's own dashboard/API server on port 3030 binds 127.0.0.1 by default — nothing is exposed to your LAN unless you explicitly opt in with MEMTRACE_UI_HOST.
| Variable | Default | Description |
|---|---|---|
MEMTRACE_UI_HOST | 127.0.0.1 | Overrides the bind address for the UI/REST/MCP-HTTP dashboard server that memtrace start binds on port 3030. Set to 0.0.0.0 to expose it beyond localhost. |
MEMTRACE_MCP_UI | (unset) | Set to 1 to have a headless memtrace mcp also start the browser-facing UI server (same effect as --ui). This UI server binds 0.0.0.0 unconditionally — it does not read MEMTRACE_UI_HOST and is not loopback-only. |
The MEMTRACE_UI_HOST loopback default above only applies to memtrace start's UI server. When memtrace mcp starts its own UI via --ui or MEMTRACE_MCP_UI=1, that listener binds 0.0.0.0 unconditionally, regardless of MEMTRACE_UI_HOST. Separately, the streamable-HTTP MCP transport on port 3000 also binds 0.0.0.0 — every interface, not just loopback — with no env knob to change that, and there is no authentication in front of the /mcp route at this layer. Treat both as fine only for trusted orchestration hosts on a trusted network, not something to expose directly to the internet.
See also memtrace mcp, memtrace start, and Environment variables for the full list of runtime env overrides.