Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

chore: regen llms-full, structural suites and CLI help golden for serve --advertise

garrytan6fc1201f6c0e
diff --git a/llms-full.txt b/llms-full.txt
index b1fc2b4a4a..c35f682407 100644
--- a/llms-full.txt
+++ b/llms-full.txt
@@ -45,7 +45,7 @@ in this shape.
## What `gbrain mcp expose` does
```bash
-gbrain mcp expose # tailnet-only, port 3131, full surface, service installed
+gbrain mcp expose # tailnet-only, port 3131, full surface listing the memory verbs, service installed
gbrain mcp expose --funnel # also reachable by cloud agents (public HTTPS)
gbrain mcp expose --dry-run # print the plan, change nothing
```
@@ -96,7 +96,7 @@ alone. Which exit 2 it is matters:
The wrapper reads the admin token from its file at run time, sources your
shell profile and `~/.gbrain/env`, prepends the Bun directory to `PATH`, and
`exec`s `gbrain serve --http --port N --public-url URL [--surface X]
-[--enable-dcr]`. The token never lands in the plist, unit or wrapper.
+[--advertise verbs] [--enable-dcr]`. The token never lands in the plist, unit or wrapper.
Paths above use the default GBrain home. Use the receipt's `admin_token_file`
and `mcp_url` for the intended server, especially with a custom `GBRAIN_HOME`.
@@ -159,7 +159,7 @@ gbrain mcp expose --remove [--yes] [--json]
| --- | --- |
| `--port N` | Local port for `gbrain serve --http` (default `3131`). Tailscale proxies `:443` on your MagicDNS name to it. With `--status` or `--remove` and no receipt, the port whose leftover `:443` handler is looked for and cleaned up. |
| `--funnel` | Public HTTPS via Tailscale Funnel instead of tailnet-only Serve. Required for cloud agents. |
-| `--surface verbs\|starter\|full` | Tool surface of the served MCP server (default `full`, same as `serve --http`). |
+| `--surface verbs\|starter\|full` | Tool surface of the served MCP server, listed in full. Without it the server serves `full` and runs with `--advertise verbs`: clients without their own surface see the seven memory verbs and `request_tools`, and every operation stays callable. An exposure made before this default keeps listing everything when re-run. |
| `--enable-dcr` | Turn on self-service client registration on the served server (off by default; every self-registered connection still stops for your approval in the admin dashboard). |
| `--no-tailscale` | Skip Tailscale entirely: install the service on loopback only, publish nothing. Exclusive with `--funnel`. |
| `--no-service` | Do not create a user service; only publish a server you run yourself. Also the way to publish from a host with no brain config (`no_brain_config`). |
@@ -170,7 +170,7 @@ gbrain mcp expose --remove [--yes] [--json]
| `--json` | One JSON document on stdout: `{ status, receipt, checks: [{name, status, detail}], next_actions, reason?, message? }`; prose goes to stderr. |
`--status` and `--remove` are exclusive with each other. Defaults: port
-3131, tailnet-only, `--surface full`, DCR off, service installed whenever a
+3131, tailnet-only, `--surface full` listing the memory verbs (`--advertise verbs`), DCR off, service installed whenever a
supervisor exists.
### `--status`
@@ -3142,7 +3142,7 @@ model gbrain removed in v0.33, needs `gbrain skillpack migrate-fence` once.)
**If you are Hermes:** register gbrain as your MCP server:
```bash
-printf 'Y\n' | hermes mcp add gbrain --env GBRAIN_HOME=$HOME --connect-timeout 60 --command $(which gbrain) --args serve --surface full
+printf 'Y\n' | hermes mcp add gbrain --env GBRAIN_HOME=$HOME --connect-timeout 60 --command $(which gbrain) --args serve --surface full --advertise verbs
```
Keep `--args` last (everything after it becomes server argv) and verify with
@@ -3152,7 +3152,7 @@ Keep `--args` last (everything after it becomes server argv) and verify with
**If you are Grok Build** (xAI's `grok` CLI): register gbrain as your MCP server:
```bash
-grok mcp add gbrain -e "GBRAIN_HOME=$HOME" -- "$(command -v gbrain)" serve --surface full
+grok mcp add gbrain -e "GBRAIN_HOME=$HOME" -- "$(command -v gbrain)" serve --surface full --advertise verbs
```
The add is lazy (exit 0 without connecting) — verify with
@@ -3168,7 +3168,7 @@ install, follow `BOOTSTRAP_FOR_AGENTS.md` instead of this page. For the
brain-only MCP registration:
```bash
-opencode mcp add gbrain --env GBRAIN_HOME=$HOME -- "$(command -v gbrain)" serve --surface full
+opencode mcp add gbrain --env GBRAIN_HOME=$HOME -- "$(command -v gbrain)" serve --surface full --advertise verbs
```
The add is lazy (exit 0 without connecting) — verify with `opencode mcp list`,
@@ -5150,7 +5150,7 @@ The agent starts with keyless memory and verifies it. API keys, automatic captur
### Lighter ways in
-**Just want a memory for your coding agent — no identity, no repo.** On Claude Code or Codex use `gbrain setup` (above). By hand: `gbrain init --pglite --no-embedding`, then `codex mcp add gbrain -- "$(command -v gbrain)" serve --surface full` (`claude mcp add` takes the same argv; `--surface verbs` or `starter` for a harness that caps its tool count). Saved memories are brain-wide by default; pass `visibility: "private"` for local-only facts.
+**Just want a memory for your coding agent — no identity, no repo.** On Claude Code or Codex use `gbrain setup` (above). By hand: `gbrain init --pglite --no-embedding`, then `codex mcp add gbrain -- "$(command -v gbrain)" serve --surface full --advertise verbs` (`claude mcp add` takes the same argv; the tool list shows the seven memory verbs and `request_tools`, and every operation stays callable; drop `--advertise verbs` to list everything). Saved memories are brain-wide by default; pass `visibility: "private"` for local-only facts.
**Already have a brain on a remote host** (OpenClaw, Hermes, or any `gbrain serve --http`)? Point your laptop agents at it with one command each — `--install` wires it up and smoke-tests the token before handoff:
@@ -5187,15 +5187,15 @@ Choose the connection instructions for your actual product:
**Upgrading a brain indexed before v0.48.3.0?** Rebuild its search chunks first: [upgrade recovery guide](skills/migrations/v0.48.3.0.md). **Say to your agent:** *"Upgrade gbrain and check whether my search index needs rebuilding."*
-- **[Claude Code](docs/mcp/CLAUDE_CODE.md)** — plugin: `/plugin marketplace add garrytan/gbrain` + `/plugin install gbrain@gbrain` (MCP + skills; persona variants `gbrain-coding` / `gbrain-daily` install curated subsets; pick one). Marketplace-free skills: `gbrain skillpack scaffold --harness claude-code` copies a persona-curated skill set into your user-scope skills dir. Or local one-liner: `claude mcp add gbrain -- "$(command -v gbrain)" serve`. Remote with just a bearer token: `gbrain connect https://your-host/mcp --token gbrain_xxx` prints a paste-ready block (or `--install` wires it up and smoke-tests the token).
+- **[Claude Code](docs/mcp/CLAUDE_CODE.md)** — plugin: `/plugin marketplace add garrytan/gbrain` + `/plugin install gbrain@gbrain` (MCP + skills; persona variants `gbrain-coding` / `gbrain-daily` install curated subsets; pick one). Marketplace-free skills: `gbrain skillpack scaffold --harness claude-code` copies a persona-curated skill set into your user-scope skills dir. Or local one-liner: `claude mcp add gbrain -- "$(command -v gbrain)" serve --surface full --advertise verbs`. Remote with just a bearer token: `gbrain connect https://your-host/mcp --token gbrain_xxx` prints a paste-ready block (or `--install` wires it up and smoke-tests the token).
- **[Codex](docs/mcp/CODEX.md)** — plugin (recommended): `codex plugin marketplace add garrytan/gbrain@codex-plugin` + `codex plugin add gbrain@gbrain` installs the MCP server AND the curated skill set. Or connect-only: `gbrain connect https://your-host/mcp --token gbrain_xxx --agent codex` (or `--install`); the token path reads `$GBRAIN_REMOTE_TOKEN` at runtime, while the private-handoff installer writes a private managed HTTP header so the connection survives a new shell.
-- **[Cursor / Windsurf / any stdio MCP client](docs/mcp/CLAUDE_CODE.md)** — same shape, add `{"command": "gbrain", "args": ["serve", "--surface", "full"]}` to your MCP config.
-- **[Hermes](docs/mcp/HERMES.md)** — `printf 'Y\n' | hermes mcp add gbrain --env GBRAIN_HOME=$HOME --connect-timeout 60 --command $(which gbrain) --args serve --surface full`. Keep `--args` last, and verify with `hermes mcp test gbrain` (the add exits 0 even on failure).
+- **[Cursor / Windsurf / any stdio MCP client](docs/mcp/CLAUDE_CODE.md)** — same shape, add `{"command": "gbrain", "args": ["serve", "--surface", "full", "--advertise", "verbs"]}` to your MCP config.
+- **[Hermes](docs/mcp/HERMES.md)** — `printf 'Y\n' | hermes mcp add gbrain --env GBRAIN_HOME=$HOME --connect-timeout 60 --command $(which gbrain) --args serve --surface full --advertise verbs`. Keep `--args` last, and verify with `hermes mcp test gbrain` (the add exits 0 even on failure).
- **[Grok Bot](docs/guides/grok-bot.md)** — recommended: keep the brain on your computer, publish it with `gbrain mcp expose --funnel`, grant the Bot a `memory-writer` client and install the thin CLI at `/workspace/gbrain`; or install memory inside the Bot computer when no machine of yours stays online. Bots share local files and credentials; sources organize memory without isolating Bots. **Say to your agent:** *"connect grok bot to my brain"*.
- **[Muse personal agent](docs/guides/muse.md)** — first verify its durable user-files location; then either connect it to your published brain (`gbrain mcp expose --funnel` + thin CLI) or install the local CLI there. Native MCP configuration and skill activation are not assumed. **Say to your agent:** *"connect muse to my brain"*.
-- **[Grok Build](docs/mcp/GROK.md)** — `grok mcp add gbrain -e "GBRAIN_HOME=$HOME" -- "$(command -v gbrain)" serve --surface full`. The add is lazy (exit 0 without connecting) — verify with `grok mcp doctor gbrain`, which spawns the server. Verified against Grok Build v1.0.4.
-- **[opencode](docs/mcp/OPENCODE.md)** (opencode.ai / SST — not OpenClaw) — `opencode mcp add gbrain --env GBRAIN_HOME=$HOME -- "$(command -v gbrain)" serve --surface full`, or let `gbrain bootstrap hooks --harness opencode` write the config for you (opencode is a bootstrap-supported harness — it reads AGENTS.md natively). The add is lazy — verify with `opencode mcp list`, which spawns the server (`✓ gbrain connected`). Remote: `gbrain connect https://your-host/mcp --token gbrain_xxx --agent opencode [--install]` — the config stores only the `{env:GBRAIN_REMOTE_TOKEN}` interpolation. Verified against opencode v1.18.18.
-- **[OpenClaw](docs/mcp/OPENCLAW.md)** — the ClawHub bundle plugin registers gbrain automatically (`openclaw.plugin.json` ships in this repo), or register the stdio server with `openclaw mcp add gbrain --command "$(command -v gbrain)" --arg serve --env GBRAIN_HOME=$HOME` (absolute path: the launchd gateway PATH lacks `~/.bun/bin`); verify with `openclaw mcp list`.
+- **[Grok Build](docs/mcp/GROK.md)** — `grok mcp add gbrain -e "GBRAIN_HOME=$HOME" -- "$(command -v gbrain)" serve --surface full --advertise verbs`. The add is lazy (exit 0 without connecting) — verify with `grok mcp doctor gbrain`, which spawns the server. Verified against Grok Build v1.0.4.
+- **[opencode](docs/mcp/OPENCODE.md)** (opencode.ai / SST — not OpenClaw) — `opencode mcp add gbrain --env GBRAIN_HOME=$HOME -- "$(command -v gbrain)" serve --surface full --advertise verbs`, or let `gbrain bootstrap hooks --harness opencode` write the config for you (opencode is a bootstrap-supported harness — it reads AGENTS.md natively). The add is lazy — verify with `opencode mcp list`, which spawns the server (`✓ gbrain connected`). Remote: `gbrain connect https://your-host/mcp --token gbrain_xxx --agent opencode [--install]` — the config stores only the `{env:GBRAIN_REMOTE_TOKEN}` interpolation. Verified against opencode v1.18.18.
+- **[OpenClaw](docs/mcp/OPENCLAW.md)** — the ClawHub bundle plugin registers gbrain automatically (`openclaw.plugin.json` ships in this repo), or register the stdio server with `openclaw mcp add gbrain --command "$(command -v gbrain)" --arg serve --arg --surface --arg full --arg --advertise --arg verbs --env GBRAIN_HOME=$HOME` (absolute path: the launchd gateway PATH lacks `~/.bun/bin`); verify with `openclaw mcp list`.
- **[Claude Desktop (Cowork)](docs/mcp/CLAUDE_DESKTOP.md)** — Settings → Integrations → add the URL of your HTTP server. Remote only; the local `claude_desktop_config.json` does not work for remote servers.
- **[Claude Cowork (team plan)](docs/mcp/CLAUDE_COWORK.md)** — org Owner adds the connector under Organization Settings → Connectors.
- **[Perplexity Computer](docs/mcp/PERPLEXITY.md)** — choose native OAuth or a managed bearer connection according to the actual connector settings. The owner registers the matching client and delivers any confidential credentials privately.
@@ -8525,7 +8525,7 @@ the same registry.
```bash
gbrain init --pglite # 2-second local brain
-claude mcp add gbrain -- "$(command -v gbrain)" serve --surface full # every operation, the verbs included
+claude mcp add gbrain -- "$(command -v gbrain)" serve --surface full --advertise verbs # lists the verbs; every operation stays callable
gbrain remember "gbrain install check" --provenance install-check
gbrain recall --query "gbrain install check" # …now ask your agent in a NEW session
```
@@ -8540,24 +8540,30 @@ If `claude` is not found: install Claude Code first, or use a block below.
**Codex**
```bash
-codex mcp add gbrain -- "$(command -v gbrain)" serve --surface full
+codex mcp add gbrain -- "$(command -v gbrain)" serve --surface full --advertise verbs
```
**Grok Build** (verify with `grok mcp doctor gbrain` — the add is lazy)
```bash
-grok mcp add gbrain -e "GBRAIN_HOME=$HOME" -- "$(command -v gbrain)" serve --surface full
+grok mcp add gbrain -e "GBRAIN_HOME=$HOME" -- "$(command -v gbrain)" serve --surface full --advertise verbs
```
**opencode** (verify with `opencode mcp list` — the add is lazy, and list SPAWNS the server)
```bash
-opencode mcp add gbrain --env GBRAIN_HOME=$HOME -- "$(command -v gbrain)" serve --surface full
+opencode mcp add gbrain --env GBRAIN_HOME=$HOME -- "$(command -v gbrain)" serve --surface full --advertise verbs
```
**OpenClaw / any stdio MCP host** — register the server command
-`gbrain serve --surface full`. Remote brains: `gbrain serve --http` on the
+`gbrain serve --surface full --advertise verbs`. Remote brains: `gbrain serve --http` on the
host, then `gbrain connect https://host/mcp --token gbrain_xxx --install` on
each client.
+**Listing:** `--advertise verbs` (what gbrain's own registrations write)
+shows the seven verbs plus `request_tools` in tools/list while everything
+`--surface` allows stays callable; `request_tools` lists the rest and returns
+full schemas, and a tool it describes joins the session's list. An explicit
+`--surface` without `--advertise` lists that whole surface.
+
**Surface modes:** `--surface verbs` exposes EXACTLY the seven verbs —
advertised list AND dispatch are filtered fail-closed (a hidden op returns
`unknown_tool` even when called by name). `--surface starter` exposes the
diff --git a/scripts/structural-suites.tsv b/scripts/structural-suites.tsv
index a8f33ab66c..36c1a3f638 100644
--- a/scripts/structural-suites.tsv
+++ b/scripts/structural-suites.tsv
@@ -219,7 +219,7 @@ test/link-source-check-repair.test.ts regex literal drift guard (#4613) 1 readFi
test/longmemeval-embed-cache.test.ts EmbeddingCache — canonical hash 4 readFileSync
test/loops-extract-wiring.test.ts jobs.ts wiring 2 source-surface-helper
test/loops-extract-wiring.test.ts relational edge vocabulary 2 readFileSync,source-surface-helper
-test/mcp-registration.test.ts every stdio registration path builds from REGISTRATION_SURFACE 4 readFileSync
+test/mcp-registration.test.ts every stdio registration path builds from REGISTRATION_SURFACE 5 readFileSync
test/meeting-ingestion-attendance-template.test.ts (file-level) 3 readFileSync
test/migrate-stdout-clean.test.ts migration output stays off stdout 2 source-surface-helper
test/migrate.test.ts PR #356 + #363 — session timeouts applied via startup parameters 1 readFileSync,source-surface-helper
diff --git a/test/fixtures/goldens/cli/help-and-errors.json b/test/fixtures/goldens/cli/help-and-errors.json
index fdfadabe35..faa5a94caa 100644
--- a/test/fixtures/goldens/cli/help-and-errors.json
+++ b/test/fixtures/goldens/cli/help-and-errors.json
@@ -205,6 +205,8 @@
" --surface verbs|starter|full Tool surface: the 7 memory verbs, the ~20-op",
" starter set, or every op (default full).",
" On --http this is the per-client CEILING.",
+ " --advertise verbs|starter|full List only this surface in tools/list (plus",
+ " request_tools); the rest stays callable.",
" --access read-only|full stdio: list and dispatch only read operations",
" serve --http [--port N] HTTP MCP server with OAuth 2.1",
" --token-ttl N Access token TTL in seconds, 60-7776000 (default: 3600)",
@@ -431,6 +433,8 @@
" --surface verbs|starter|full Tool surface: the 7 memory verbs, the ~20-op",
" starter set, or every op (default full).",
" On --http this is the per-client CEILING.",
+ " --advertise verbs|starter|full List only this surface in tools/list (plus",
+ " request_tools); the rest stays callable.",
" --access read-only|full stdio: list and dispatch only read operations",
" serve --http [--port N] HTTP MCP server with OAuth 2.1",
" --token-ttl N Access token TTL in seconds, 60-7776000 (default: 3600)",
@@ -657,6 +661,8 @@
" --surface verbs|starter|full Tool surface: the 7 memory verbs, the ~20-op",
" starter set, or every op (default full).",
" On --http this is the per-client CEILING.",
+ " --advertise verbs|starter|full List only this surface in tools/list (plus",
+ " request_tools); the rest stays callable.",
" --access read-only|full stdio: list and dispatch only read operations",
" serve --http [--port N] HTTP MCP server with OAuth 2.1",
" --token-ttl N Access token TTL in seconds, 60-7776000 (default: 3600)",