The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu
Go agent-ai-cliagent-harnessesagent-securitybrowser-extensionciclaude-codecloudcodexcursordetection-engineeringjevknowledge-basememorymobile-device-managementobservabilitysecuritysecurity-information-and-event-managementsecurity-toolstelemetrytraces
docs: document beacon mcp connect and the two MCP server names
Claude89d39a418b0d
diff --git a/CLAUDE.md b/CLAUDE.mdindex f3aac908..0e230dee 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -67,6 +67,7 @@ Supported runtime surfaces today:- Local threat detection via `beacon scan`, which runs the open Threat Rules format (`spec/threat-rules`; CEL match conditions over the endpoint event schema, with embedded conformance fixtures) over the runtime JSONL. The engine (`pkg/asymptoteobserve/threatrules`) ships in the binary; the rule corpus is external data loaded from a local store (`~/.beacon/endpoint/rules`) managed by `beacon rules`, so the corpus can grow without enlarging the binary. `scan` is read-only and offline; only the explicit, user-initiated `beacon rules pull <url>` reaches the network. A small frozen baseline is embedded so `scan` works before any rules are installed.- Session handoff via `beacon handoff list|export|resume` (`cli/beacon/internal/handoff`, `cli/beacon/cmd/handoff*.go`; docs in `docs/cli/handoff.mdx` and `docs/concepts/session-handoff.mdx`). Every runtime is one entry in the registry in `cli/beacon/internal/handoff/runtimes.go`: its session source, the names it answers to, and the commands that reopen it or start it from a brief; `TestRegistryIsConsistent` checks the entries. Handoff reads the session stores of Claude Code, Codex CLI, OpenCode, Cline, Pi, Prime Agent, Factory Droid, GitHub Copilot CLI, Hermes Agent, DeepSeek Harness, fx, Grok Build, OpenClaw Gateway and Cursor read-only and never touches the network. Oh My Pi, Gemini CLI, Qwen Code, Kiro, Antigravity CLI, Devin CLI, Muse Code, OpenHands and goose have no store Beacon reads: their sessions come from the runtime log, and they take a brief as the target of `--agent`. `resume` reopens a session natively with its runtime's own command when it can, and otherwise writes a brief to `~/.beacon/endpoint/handoffs` (0700/0600) and starts a new session pointed at it. DeepSeek Harness cannot be started, and Hermes Agent and fx only reopen their own sessions, so their sessions continue in another runtime. fx, Grok Build and Cursor find a session by the directory they run in, so they are reopened natively only in the session's own directory. The brief is passed by absolute path, never inlined on a command line. Every launch keeps the runtime's approvals on: Beacon never passes a flag that turns them off, names the approval mode that asks where a CLI takes one (Cline always gets `--auto-approve false`, because Cline defaults to approving every tool call), and removes or overrides environment switches that would approve everything (`COPILOT_ALLOW_ALL`, `COPILOT_PLAN_THEN_AUTOPILOT`, `HERMES_YOLO_MODE`, `GOOSE_MODE`); `--print` shows them under `env`. Briefs run every event through `SanitizeEvent`, and quoted content goes in fences longer than any backtick run it contains, with inline fields reduced to one line, so quoted content cannot forge brief structure. A new session's first prompt ends with the `[beacon-handoff from=<harness> session=<id>]` marker (`pkg/asymptoteobserve/handoff.go`). The hook and plugin prompt paths and the session-store mappers record a `session.handoff` event with `handoff.{source_harness,source_session_id}` when they see it; that is an observed claim, not a verified identity.- Commit-to-session links via `beacon git setup|status|remove|link|notes` (`cli/beacon/internal/gitlink`, `cli/beacon/cmd/git*.go`; docs in `docs/cli/git.mdx`). A link is a `beacon:<harness>/<session-id>` line in a git note under `refs/notes/beacon`; it carries identifiers only, never content, because notes can be pushed. Which sessions to link is inferred from the local runtime log: a session is linked when, between the parent commit and the commit (at least two hours, at most 24), it wrote a file the commit changes (for a merge, only files that differ from every parent, so a clean merge or pull links nothing). Evidence is file write events, write-type `file.operation`s, plainly readable shell targets, and `apply_patch` envelopes; reads never count. Note updates are a compare-and-swap on the notes ref through a private `refs/notes/beacon-tx/` working ref, and every existing note line, a teammate's or a person's, is kept verbatim. `setup` installs post-commit (links HEAD in the foreground with a 3 s budget, silent, never fails the commit, skips rebase/cherry-pick/revert) and post-rewrite (normalizes the note git concatenates on amend) as standalone `beacon-<hook>` scripts called from a marked block inserted after the shebang of the repository's own hook; only shell hooks are edited, `core.hooksPath` is refused without `--hooks-path`, and `notes.rewriteRef` carries links through amend and rebase. `BEACON_GIT_HOOKS=0` disables the hooks for one command. Every link a run adds is also written to the runtime log as one `session.commit_linked` event in the linked session's timeline (`event.fidelity=inferred`, no collection method), with commit id, branch and credential-stripped remote in the OTel-shaped `vcs` block and overlap counts in `vcs.attribution`; the event deliberately carries no file, command or tool fields so it can never become attribution evidence. Sharing is opt-in (`setup --share-notes`, off by default): a non-destructive fetch refspec `+refs/notes/beacon:refs/notes/beacon-remotes/<remote>` so git's own fetch brings teammates' links into a read-only tracking ref that `beacon git notes` unions with the local one (never force-fetch into `refs/notes/beacon`: it would destroy unpushed links), and a pre-push hook that fetches, merges with `cat_sort_uniq` through the same CAS, and pushes only the notes ref with `--no-verify`, within a 10 s budget and never failing the push. That pre-push hook is the only Beacon git hook that touches the network, and only during a push the person started; `beacon git notes push|fetch` do the same by hand.+- Beacon Managed MCP registration via `beacon mcp connect|disconnect|status` (`cli/beacon/internal/mcpconnect`, `cli/beacon/cmd/mcp_connect.go`; docs in `docs/cli/mcp-connect.mdx`). It registers the Beacon Managed MCP server as `beacon-managed`, a different name from the local stdio server `beacon`, in the user-level config of Claude Code, Codex CLI, Cursor, VS Code, Gemini CLI and OpenCode. It prints manual steps for runtimes without confirmed MCP OAuth support. OAuth is the default and writes only the URL; `--token-env` writes a reference to an environment variable in each harness's own syntax, never a value. The account token is never read or copied, and Beacon does not mint MCP tokens. It is explicit and interactive: never run by `endpoint install` or onboarding (the install only suggests it after the wizard's Managed choice), refused as root, and refused in CI or without a terminal unless `--yes` is given. Its one network request is the RFC 9728 resource-metadata check of the URL, which `--dry-run` skips. Configs are edited like the Kimi Code writer: never re-serialized, spliced as text, parsed back and compared before an atomic replace, backed up first. What was written is recorded in `~/.beacon/mcp/connections.json`, and `disconnect` removes only entries recorded there that still point at the recorded URL. `cmd/mcp_connect_e2e_test.go` runs the real harness CLIs when they are installed; re-run it when a harness changes its MCP config format.- An optional, off-by-default policy seam in the hook path (`cli/beacon-hooks/internal/policy`) governed by the stable contract in `pkg/asymptoteobserve/policycontract`. When `BEACON_POLICY_PROVIDER` names an executable, the `pre-tool` and `permission-request` hooks send it a JSON request describing the imminent tool call and honor an allow/deny response, returning the runtime's native deny shape and `policy.enforcement=enforce` telemetry on a deny. The seam is inert when unset and fail-open on any error (timeout, non-zero exit, malformed output), so the open build ships no enforcement of its own; all audit/enforce decision logic lives in the external provider. `rules/agent-control/agent-permission-bypass-spawn.rule.yaml` is the open detect twin that flags the same pattern in `beacon scan`.Current non-goals unless explicitly requested:diff --git a/README.md b/README.mdindex 29cd9eb9..4160925c 100644--- a/README.md+++ b/README.md@@ -154,6 +154,14 @@ Or inspect the raw event stream:> Local to keep everything on this machine, and disconnect any time with> `beacon endpoint disconnect`.+If this endpoint forwards to Beacon Managed, your agents can search that history over MCP:++```bash+beacon mcp connect+```++This registers the `beacon-managed` MCP server in Claude Code, Codex CLI, Cursor, VS Code, Gemini CLI, and OpenCode, and each harness signs in with OAuth the first time it connects. No token is written. `beacon mcp disconnect` removes exactly what it added. The local `beacon` MCP server (`beacon mcp serve`) is separate and never touches the network. See [`beacon mcp connect`](https://docs.beacon.sh/cli/mcp-connect).+Inspect the account used during interactive setup:```bashdiff --git a/cli/beacon/cmd/endpoint_install.go b/cli/beacon/cmd/endpoint_install.goindex 5b6cf7ec..c60f7f54 100644--- a/cli/beacon/cmd/endpoint_install.go+++ b/cli/beacon/cmd/endpoint_install.go@@ -187,11 +187,22 @@ func runEndpointInstall(cmd *cobra.Command, args []string) error {fmt.Fprintf(cmd.ErrOrStderr(), "beacon: managed ingest was not connected (%v). Run `beacon endpoint connect` to try again.\n", err)} else {recordDestinationAsymptote(cmd)+ suggestMCPConnect(cmd.OutOrStdout(), onboarded.Connect)}}return nil}+// suggestMCPConnect points a person who just chose Beacon Managed in the wizard at+// `beacon mcp connect`. It only prints: registering the MCP server stays a separate,+// explicit command, and the unattended install paths never reach the wizard at all.+func suggestMCPConnect(out io.Writer, chosenInWizard bool) {+ if !chosenInWizard {+ return+ }+ fmt.Fprintln(out, "To let your agents search this history through Beacon Managed MCP, run `beacon mcp connect`.")+}+func runEndpointStatus(cmd *cobra.Command, args []string) error {status := lifecycle.GetStatus(endpointUserMode(), endpointOpts.logPath)if endpointOpts.jsonOutput {diff --git a/cli/beacon/cmd/mcp.go b/cli/beacon/cmd/mcp.goindex b3838691..0c4153c1 100644--- a/cli/beacon/cmd/mcp.go+++ b/cli/beacon/cmd/mcp.go@@ -30,7 +30,12 @@ var mcpOpts struct {var mcpCmd = &cobra.Command{Use: "mcp",- Short: "Expose local Beacon activity through MCP",+ Short: "Expose Beacon activity through MCP",+ Long: `Expose Beacon activity through MCP.++serve and doctor run and check the local "beacon" server, which reads this machine's runtime+log. connect, disconnect and status manage the "beacon-managed" entry that points your harnesses+at Beacon Managed MCP, which searches the session history this endpoint forwards.`,}var mcpServeCmd = &cobra.Command{@@ -151,6 +156,10 @@ func runMCPDoctor(cmd *cobra.Command, args []string) error {fmt.Println(` }`)fmt.Println(` }`)fmt.Println(`}`)+ fmt.Println()+ fmt.Println(`"beacon" is the local server: it reads this machine's runtime log and approved memory.`)+ fmt.Println(`For session history forwarded to Beacon Managed, run ` + "`beacon mcp connect`" + `, which registers`)+ fmt.Println(`the separate "beacon-managed" server in your harnesses. The two names never overwrite each other.`)}return nil}diff --git a/cli/beacon/cmd/mcp_connect_test.go b/cli/beacon/cmd/mcp_connect_test.goindex f9b4c021..049aae26 100644--- a/cli/beacon/cmd/mcp_connect_test.go+++ b/cli/beacon/cmd/mcp_connect_test.go@@ -519,3 +519,15 @@ func TestMCPServerNamesDoNotCollide(t *testing.T) {t.Fatal("the Beacon Managed server must not share the local stdio server's name")}}++func TestInstallSuggestsMCPConnectOnlyAfterTheWizardChoseManaged(t *testing.T) {+ var buf bytes.Buffer+ suggestMCPConnect(&buf, false)+ if buf.Len() != 0 {+ t.Fatalf("an unattended or --connect install printed %q", buf.String())+ }+ suggestMCPConnect(&buf, true)+ if !strings.Contains(buf.String(), "beacon mcp connect") {+ t.Fatalf("got %q", buf.String())+ }+}diff --git a/docs/cli/index.mdx b/docs/cli/index.mdxindex 2e4068b4..45e7270f 100644--- a/docs/cli/index.mdx+++ b/docs/cli/index.mdx@@ -41,7 +41,7 @@ Top-level Agent Beacon CLI commands.| [`beacon login`](/cli/account-auth) | Sign in through beacon.sh without enabling telemetry forwarding. || [`beacon logout`](/cli/account-auth#sign-out) | Revoke and remove the local Beacon account session. || [`beacon memory`](/cli/memory) | Evaluate traces, review candidates, and install approved project memory. |-| [`beacon mcp`](/cli/mcp) | Expose local Beacon activity to MCP clients. |+| [`beacon mcp`](/cli/mcp) | Expose Beacon activity to MCP clients, locally and through Beacon Managed. || [`beacon rules`](/cli/rules) | Manage and author Beacon threat-detection rules. || [`beacon scan`](/cli/scan) | Run threat-detection rules over local endpoint telemetry. || [`beacon status`](/cli/endpoint-status) | Alias for `beacon endpoint status`. |@@ -137,6 +137,9 @@ Expose local Beacon runtime activity through MCP.|---------|-------------|| [`beacon mcp serve`](/cli/mcp-serve) | Run the local Beacon MCP server over stdio or loopback HTTP JSON-RPC. || [`beacon mcp doctor`](/cli/mcp-doctor) | Validate local Beacon MCP setup and print client configuration. |+| [`beacon mcp connect`](/cli/mcp-connect) | Register Beacon Managed MCP (`beacon-managed`) in every detected harness. |+| [`beacon mcp disconnect`](/cli/mcp-connect#beacon-mcp-disconnect) | Remove the Beacon Managed MCP entries that connect wrote. |+| [`beacon mcp status`](/cli/mcp-connect#beacon-mcp-status) | Show where Beacon Managed MCP is configured. |## beacon endpointdiff --git a/docs/cli/mcp-connect.mdx b/docs/cli/mcp-connect.mdxnew file mode 100644index 00000000..bc7700d6--- /dev/null+++ b/docs/cli/mcp-connect.mdx@@ -0,0 +1,257 @@+---+title: "beacon mcp connect"+description: "Register Beacon Managed MCP in every harness on this machine"+---++## Command overview++`beacon mcp connect` adds the Beacon Managed MCP server to the MCP configuration of each harness it+finds, so an agent can search the session history this endpoint forwards to Beacon Managed.+`beacon mcp disconnect` removes exactly what connect added, and `beacon mcp status` shows what is+configured where.++```bash title="Command syntax"+beacon mcp connect [--harness a,b] [--url URL] [--token-env NAME] [--dry-run] [--yes] [--force]+beacon mcp disconnect [--harness a,b]+beacon mcp status [--harness a,b] [--url URL] [--check] [--json]+```++The server is registered as **`beacon-managed`**. The local server that+[`beacon mcp serve`](/cli/mcp-serve) runs is called **`beacon`**. The two are different servers+with different names, so neither entry ever overwrites the other:++| Server name | What it reads | Where it runs | Set up with |+|---|---|---|---|+| `beacon` | This machine's `runtime.jsonl` and approved local memory | Locally, over stdio or loopback HTTP | [`beacon mcp doctor`](/cli/mcp-doctor) prints the config |+| `beacon-managed` | Session history this endpoint forwarded to Beacon Managed | Beacon Managed, over HTTPS | `beacon mcp connect` |++Beacon Managed MCP is read-only. Its tools are `beacon_search_sessions`, `beacon_grep`,+`beacon_read_session`, `beacon_get_event`, `beacon_lookup` and `beacon_usage`.++<Note>+ `beacon mcp connect` is an explicit, opt-in command. `beacon endpoint install` and the onboarding+ wizard never run it; after you choose Beacon Managed in the wizard, the install only suggests it.+ It refuses to run as root, and in CI or without a terminal it runs only with `--yes`.+</Note>++## `beacon mcp connect`++```bash+beacon mcp connect+```++```text title="Example output"+Beacon Managed MCP: https://mcp.beacon.sh (checked)+Server name: beacon-managed+Auth: OAuth; Beacon writes only the URL, and each harness signs in on first use++HARNESS FILE ACTION AUTH NOTE+Claude Code ~/.claude.json add oauth via claude CLI+Codex CLI ~/.codex/config.toml add oauth+Cursor ~/.cursor/mcp.json present oauth already configured by Beacon+OpenCode ~/.config/opencode/opencode.jsonc add oauth++Write 3 change(s)? Each changed file is backed up first. [y/N] y++✓ Claude Code: added to ~/.claude.json+✓ Codex CLI: added to ~/.codex/config.toml+✓ OpenCode: added to ~/.config/opencode/opencode.jsonc++Next steps:+ Claude Code: In Claude Code, run /mcp, choose beacon-managed, and sign in.+ Codex CLI: Run `codex mcp login beacon-managed`.+ Cursor: In Cursor Settings → MCP, find beacon-managed (marked "Needs login") and sign in.+ OpenCode: Run `opencode mcp auth beacon-managed`.+ Restart any harness that is already running so it loads the new server.+```++Connect works in these steps:++1. **Harnesses.** Without `--harness`, connect acts on every harness `beacon endpoint discover`+ detects. `--harness` accepts the same names as `beacon endpoint install --harness`, such as+ `claude`, `codex`, `cursor`, `vscode`, `gemini` and `opencode`.+2. **URL.** The URL is `--url`, or the Beacon Managed URL recorded by+ [`beacon endpoint connect`](/cli/endpoint-connect) with `/mcp` added. The Beacon Managed backend+ may name its own canonical MCP URL, `https://mcp.beacon.sh` in production. When it does, connect+ uses that URL. Without either, connect stops and asks you to run `beacon endpoint connect` or+ pass `--url`.+3. **URL check.** Before writing anything, connect fetches+ `<origin>/.well-known/oauth-protected-resource` and requires its `resource` to be the URL.+ The URL must be `https://` (plain `http` is allowed only for a loopback development server).+ This is the command's only network request. It sends no token or cookie, and it does not+ follow redirects.+4. **Plan.** For each harness connect shows the file, the action and the auth mode:++ | Action | Meaning |+ |---|---|+ | `add` | No `beacon-managed` entry yet; connect adds one. |+ | `update` | Beacon's own entry, with a different URL or auth mode; connect updates it. |+ | `present` | Already configured as asked. Nothing changes. |+ | `conflict` | A `beacon-managed` entry that Beacon did not write, or one that points at another URL. It is left alone unless you pass `--force`. |+ | `skip` | The config cannot be read or edited safely, for example because it does not parse. The reason is shown. |++5. **Confirm and write.** Connect asks before writing, unless you pass `--yes`. Each changed file+ is first backed up next to itself as `<file>.beacon.<UTC time>.bak`, then replaced atomically.+ The file keeps its permissions, and a file Beacon creates is `0600`.++Running connect again changes nothing. Every file stays byte for byte the same, and no new+backup is made.++### How files are edited++Harness configs are your files, and several of them hold other servers' credentials. Connect never+decodes and re-encodes a whole config. It adds or removes its one entry as text, keeping every+other byte, including comments, trailing commas, indentation and line endings. It then parses the+result and checks that the only difference from the original is the `beacon-managed` entry.+If anything else would change, nothing is written. A symlinked config, such as one managed by a+dotfiles tool, is written through the link.++What connect wrote is recorded in `~/.beacon/mcp/connections.json` (`0600`): the harness, file, URL,+auth mode, variable name and backup, and never a token. `disconnect` uses this record rather than+a comment in the config, because some harnesses rewrite their config files and drop comments.++### Flags++| Flag | Description |+|------|-------------|+| `--harness a,b` | Harnesses to connect. Defaults to every detected harness |+| `--url URL` | Beacon Managed MCP URL. Defaults to the URL recorded by `beacon endpoint connect` |+| `--token-env NAME` | Use a personal MCP token read from environment variable `NAME` instead of OAuth |+| `--dry-run` | Show the plan without checking the URL or writing anything |+| `--yes` | Write without asking |+| `--force` | Replace a `beacon-managed` entry that Beacon did not write |++## Authentication: OAuth or a token++**OAuth is the default and the recommended mode.** Connect writes only the URL. The first time the+harness connects, Beacon Managed answers `401` with a pointer to its OAuth metadata. The harness+then registers itself, opens a browser, and you approve access on beacon.sh. No secret is written+by Beacon, and access is revoked from the dashboard.++**A personal token** is for harnesses or setups where browser sign-in does not work. Create one at+beacon.sh → Dashboard → MCP Access, export it, and connect with `--token-env`:++```bash+export BEACON_MCP_TOKEN=... # from beacon.sh → Dashboard → MCP Access+beacon mcp connect --token-env BEACON_MCP_TOKEN+```++Each config then references the variable in its harness's own syntax. The token itself is never+written, and connect refuses a `--token-env` value that looks like a token rather than a variable+name. The harness must be started from an environment where the variable is set.++<Warning>+ Beacon does not create MCP tokens. The Beacon account token from `beacon login` is never copied+ into a harness config, an environment, a log or the command's output.+</Warning>++## Per-harness notes++Connect writes these entries (OAuth mode shown, then what `--token-env NAME` adds):++| Harness | File | Entry | Token mode | Sign in |+|---|---|---|---|---|+| Claude Code | `~/.claude.json` (`$CLAUDE_CONFIG_DIR/.claude.json`), user scope. Written with `claude mcp add --scope user` when `claude` is on `PATH` | `{"type": "http", "url": …}` | `headers.Authorization: "Bearer ${NAME}"` | Run `/mcp` and choose `beacon-managed` |+| Codex CLI | `~/.codex/config.toml` (`$CODEX_HOME`) | `[mcp_servers.beacon-managed]` `url = …` | `bearer_token_env_var = "NAME"` | `codex mcp login beacon-managed` |+| Cursor | `~/.cursor/mcp.json` | `mcpServers.beacon-managed = {"url": …}` | `"Bearer ${env:NAME}"` | Cursor Settings → MCP, then sign in where it says "Needs login" |+| VS Code | User-profile `mcp.json` (next to the user `settings.json`) | `servers.beacon-managed = {"type": "http", "url": …}` | `"Bearer ${input:beacon-managed-token}"` and a password prompt input | "MCP: List Servers", then start `beacon-managed` |+| Gemini CLI | `~/.gemini/settings.json` | `mcpServers.beacon-managed = {"url": …, "type": "http"}` | `"Bearer ${NAME}"` | `/mcp auth beacon-managed` |+| OpenCode | `~/.config/opencode/opencode.json`, or `opencode.jsonc` | `mcp.beacon-managed = {"type": "remote", "url": …, "enabled": true}` | `"oauth": false`, `"Bearer {env:NAME}"` | `opencode mcp auth beacon-managed` |++- **VS Code** asks for the token the first time the server starts and keeps it in its own secret+ storage, so in token mode it does not read `NAME`.+- **Gemini CLI** loads MCP servers only in trusted folders. In an untrusted folder,+ `beacon-managed` shows as disabled.+- **OpenCode** reads `opencode.json` when both it and `opencode.jsonc` exist. Connect edits the+ same file OpenCode's own `opencode mcp add` would.++### Harnesses you add by hand++These harnesses have no MCP OAuth support Beacon has confirmed, so connect writes nothing for them.+It prints the command or snippet instead, with a `<token>` placeholder for a token from+beacon.sh → Dashboard → MCP Access:++- GitHub Copilot CLI: `copilot mcp add --transport http beacon-managed <url> --header "Authorization: Bearer <token>"`+- Cline: a `streamableHttp` entry in `cline_mcp_settings.json`+- Kiro: `~/.kiro/settings/mcp.json`+- Devin Desktop: `~/.codeium/windsurf/mcp_config.json` (`serverUrl`)+- Qwen Code: `~/.qwen/settings.json` (`httpUrl`)+- Factory Droid: `droid mcp add beacon-managed <url> --type http --header …`+- Hermes Agent: `mcp_servers` in `~/.hermes/config.yaml`+- Kimi Code: `kimi mcp add --transport http beacon-managed <url> --header …`+- Antigravity CLI: `~/.gemini/antigravity/mcp_config.json` (`serverUrl`)++Other detected runtimes are listed as not connected.++## `beacon mcp disconnect`++```bash+beacon mcp disconnect+beacon mcp disconnect --harness codex+```++Disconnect removes only entries that the record says Beacon wrote and that still point at the+URL Beacon wrote. An entry you added yourself, or one you have since pointed somewhere else, is+left alone.++- When a file has not changed since connect wrote it, disconnect restores the exact original+ bytes from the backup.+- Otherwise, disconnect removes only the `beacon-managed` entry. It also removes any+ `mcpServers`-style container Beacon created, if nothing else is in it.+- A config file that connect created is deleted once nothing else is in it.++Backups are kept.++## `beacon mcp status`++```bash+beacon mcp status+beacon mcp status --check+beacon mcp status --json+```++```text title="Example output"+Server name: beacon-managed+Beacon Managed MCP URL: https://mcp.beacon.sh+URL check: ok++HARNESS CONFIGURED URL AUTH BY BEACON FILE+Codex CLI yes https://mcp.beacon.sh oauth yes ~/.codex/config.toml+Cursor yes https://mcp.beacon.sh oauth yes ~/.cursor/mcp.json+OpenCode no - - - ~/.config/opencode/opencode.jsonc+GitHub Copilot CLI unknown - manual - configured by hand; Beacon does not read this runtime's MCP config+```++Status reads configs and never changes them. `AUTH` is `oauth`, `token-env` (the entry references+a variable), or `token` (the entry has a header written outside Beacon, whose value is never+shown). Status makes no network request unless you pass `--check`, which runs the same URL check+as connect and exits non-zero if it fails.++## What Beacon Managed MCP can find++Beacon Managed MCP searches what this endpoint forwarded, which limits what it can find:++- Each retained string is capped at 4 KB before it is written locally. Text past that point in a+ long tool output or diff is never forwarded, so it cannot be grepped.+- An endpoint connected in Metadata-only mode forwards no prompts, responses, tool arguments or+ output. For such an endpoint, grep and read return little beyond identifiers, counts and token+ usage.++See [Downstream consumers](/telemetry-schema/normalization#downstream-consumers).++## Related++<Columns cols={2}>+ <Card title="beacon mcp" icon="server" href="/cli/mcp">+ The local Beacon MCP server and its tools.+ </Card>+ <Card title="beacon mcp doctor" icon="stethoscope" href="/cli/mcp-doctor">+ Validate the local server and print its client config.+ </Card>+ <Card title="beacon endpoint connect" icon="cloud-arrow-up" href="/cli/endpoint-connect">+ Connect this endpoint to Beacon Managed.+ </Card>+ <Card title="Redaction and size limits" icon="scissors" href="/security/retention-redaction">+ What is retained, truncated and forwarded.+ </Card>+</Columns>diff --git a/docs/cli/mcp-doctor.mdx b/docs/cli/mcp-doctor.mdxindex 4108f11c..35a2e5b1 100644--- a/docs/cli/mcp-doctor.mdx+++ b/docs/cli/mcp-doctor.mdx@@ -35,6 +35,28 @@ The expected tool set is `search_activity`, `summarize_activity`,If the runtime log does not exist yet, doctor reports that Beacon MCP can still start, but activity answers will be empty until endpoint telemetry writes events.+## Client configuration++With the stdio transport, doctor prints the client configuration for the local server, named+`beacon`:++```json title="Local server entry"+{+ "mcpServers": {+ "beacon": {+ "command": "beacon",+ "args": ["mcp", "serve", "--transport", "stdio"]+ }+ }+}+```++This is not the Beacon Managed server. The session history this endpoint forwards to Beacon+Managed is served by a separate server, registered as `beacon-managed` by+[`beacon mcp connect`](/cli/mcp-connect). A harness can have both entries at once, because the+names differ. Doctor checks only the local server; to see where `beacon-managed` is configured and+whether its URL answers, run `beacon mcp status --check`.+## Flags| Flag | Description |@@ -80,6 +102,9 @@ sudo beacon mcp doctor --system<Card title="beacon mcp serve" icon="server" href="/cli/mcp-serve">Run the local Beacon MCP server after validation.</Card>+ <Card title="beacon mcp connect" icon="plug" href="/cli/mcp-connect">+ Register the separate Beacon Managed MCP server, `beacon-managed`.+ </Card><Card title="Test MCP Access" icon="server" href="/guides/local-testing/mcp">Understand Beacon MCP and test local client access.</Card>diff --git a/docs/cli/mcp.mdx b/docs/cli/mcp.mdxindex 99ab9e03..8fa0637a 100644--- a/docs/cli/mcp.mdx+++ b/docs/cli/mcp.mdx@@ -1,6 +1,6 @@---title: "beacon mcp"-description: "Expose local Beacon activity to MCP clients"+description: "Expose Beacon activity to MCP clients, locally and through Beacon Managed"---## Command overview@@ -19,10 +19,27 @@ and the local `memory.db` store next to the endpoint log base directory. Itsupports stdio for desktop MCP clients and loopback HTTP JSON-RPC for local toolsthat connect to a running server.+## Local and Beacon Managed servers++Beacon has two MCP servers, registered under different names so that neither entry overwrites+the other:++| Server name | What it reads | Commands |+|---|---|---|+| `beacon` | This machine's `runtime.jsonl` and approved local memory, served locally over stdio or loopback HTTP | [`serve`](/cli/mcp-serve), [`doctor`](/cli/mcp-doctor) |+| `beacon-managed` | The session history this endpoint forwards to Beacon Managed, served by Beacon Managed over HTTPS | [`connect`, `disconnect`, `status`](/cli/mcp-connect) |++`beacon mcp connect` registers `beacon-managed` in Claude Code, Codex CLI, Cursor, VS Code,+Gemini CLI and OpenCode. By default it writes only the URL, and each harness signs in with OAuth.+With `--token-env`, the config instead references a personal token from beacon.sh → Dashboard →+MCP Access, held in an environment variable. For other harnesses it prints the steps to add the+server by hand.+## Commands<span id="beacon-mcp-serve" /><span id="beacon-mcp-doctor" />+<span id="beacon-mcp-connect" /><Columns cols={2}><Card title="beacon mcp serve" icon="server" href="/cli/mcp-serve">@@ -31,11 +48,14 @@ that connect to a running server.<Card title="beacon mcp doctor" icon="stethoscope" href="/cli/mcp-doctor">Validate local Beacon MCP setup and print client configuration.</Card>+ <Card title="beacon mcp connect" icon="plug" href="/cli/mcp-connect">+ Register Beacon Managed MCP in every harness, and remove or inspect it with `disconnect` and `status`.+ </Card></Columns>## MCP tools-Beacon exposes these MCP tools:+The local `beacon` server exposes these MCP tools:| Tool | Description ||------|-------------|@@ -59,6 +79,9 @@ rather than widening the search.## Flags+These flags apply to `serve` and `doctor`. For the flags of `connect`, `disconnect` and `status`,+see [`beacon mcp connect`](/cli/mcp-connect#flags).+| Flag | Description ||------|-------------|| `--user` | Use per-user endpoint paths. Enabled by default |@@ -68,9 +91,11 @@ rather than widening the search.| `--addr ADDR` | Loopback HTTP JSON-RPC listen address for `--transport http`. Defaults to `127.0.0.1:8766` |<Note>- `beacon mcp` only reads local Beacon runtime logs and approved local memory. It- does not require a hosted Beacon account, and HTTP transport should remain bound- to loopback.+ `beacon mcp serve` and `beacon mcp doctor` only read local Beacon runtime logs and+ approved local memory. They do not require a Beacon account, and HTTP transport+ should remain bound to loopback. `beacon mcp connect` is the one `beacon mcp`+ command that makes a network request: an opt-in check of the Beacon Managed MCP+ URL before it writes harness configs.</Note>## Related@@ -82,6 +107,9 @@ rather than widening the search.<Card title="beacon mcp doctor" icon="stethoscope" href="/cli/mcp-doctor">Validate local Beacon MCP setup.</Card>+ <Card title="beacon mcp connect" icon="plug" href="/cli/mcp-connect">+ Register Beacon Managed MCP in your harnesses.+ </Card><Card title="Connect Cursor and Claude Code" icon="plug" href="/guides/local-testing/mcp#4-connect-cursor-and-claude-code">Install Beacon MCP in local assistant clients.</Card>diff --git a/docs/docs.json b/docs/docs.jsonindex e485bf02..cd5ac8fb 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -331,7 +331,8 @@"root": "cli/mcp","pages": ["cli/mcp-serve",- "cli/mcp-doctor"+ "cli/mcp-doctor",+ "cli/mcp-connect"]},"cli/memory",