← Docs

API reference

The three surfaces: the MCP server (stdio and HTTP), the bourdon command line, and the on-disk library. Transports, authentication, and the stable contracts.

Bourdon has three programmable surfaces, and all three are documented here. Which one you use depends on where you are standing.

SurfaceUse it fromReference
MCP serverany MCP-aware agent or client (Claude Code, Claude Desktop, Cursor, Codex, ChatGPT, claude.ai)this page, plus MCP tools
Command lineshell, hooks, CI, cron you choose to runthis page
On-disk libraryanything that can read YAMLThe memory format

MCP server#

bourdon serve                                  # stdio, for a client that launches the server
bourdon serve --transport http --port 7500     # HTTP, loopback only by default

Transports#

stdio is the MCP default and the zero-config path: the client launches bourdon serve and talks to it over standard input and output. There are no ports and no tokens because the caller is your own process; it gets the trusted operator identity.

HTTP serves the MCP endpoint at /mcp on port 7500. Binding anything other than loopback requires authentication to be configured, or the server refuses to start:

bourdon agent add my-laptop --tier trusted       # prints a bearer token once
bourdon serve --transport http --host 0.0.0.0 --allowed-host bourdon.example.org

Clients present the token as Authorization: Bearer <token>:

{
  "mcpServers": {
    "bourdon": {
      "url": "https://bourdon.example.org/mcp",
      "headers": { "Authorization": "Bearer bdn_…" }
    }
  }
}

Requests under a Host header you did not declare are refused with 421 Misdirected Request before authentication, as a DNS-rebinding guard. Declare each public name with --allowed-host or BOURDON_ALLOWED_HOSTS.

OAuth front door#

Browser clients that cannot carry a header (claude.ai custom connectors, ChatGPT connectors) authenticate through a built-in OAuth flow with a consent page you gate with a passphrase. There is no identity provider and no third party in the path.

bourdon oauth set-passphrase
bourdon serve --transport http --oauth-public-url https://bourdon.example.org

Setting --oauth-public-url is what turns it on. The full model, including what it does not promise, is in docs/oauth-security-model.md.

Peers#

bourdon serve --transport http --peer https://other-machine.example/ --federate

--peer names one peer (repeatable). --federate also loads ~/.bourdon/peers.yaml. --no-peers forbids federation entirely. Remote peers must be HTTPS. See How federation works for the semantics.

Tools and resources#

Sixteen tools and three resources. They are listed with full signatures on MCP tools, a page generated from the server source at each release. The short map:

NeedCall
recognise what this turn is about, in about a millisecondprepare_recognition_context
then fetch deeper context without blocking recognitionget_deeper_context
who knows about Xfind_entity, query_agent_memory, get_cross_agent_summary
what happened latelylist_recent_work, list_workstreams, list_notes
who is herelist_agents, export_agents, describe_caller
write a fact or decisioncommit_to_federation
audit and undolist_memory_versions, explain_memory_change, rollback_agent_memory

Every read takes access_level (public, team, or private, default public for reads and team for recognition). Every write is validated against the L5 schema before it lands.

Command line#

bourdon --help is authoritative and every subcommand has its own --help. Grouped by job:

Install and check#

CommandDoes
bourdon setupDetect agents, pick which to federate, create ~/agent-library/, wire the Claude Code hooks (SessionEnd export, UserPromptSubmit and SessionStart recognition), run the first export. --dry-run, --non-interactive.
bourdon claude-code hook user-prompt-submit / session-startThe recognition hooks Claude Code runs; read the hook JSON on stdin, print hookSpecificOutput, exit 0 always. Other agents author theirs against docs/AUTHORING_A_HOOK.md.
bourdon claude-code hook stopThe usefulness half: finds the turn's pending recognition row, scores the reply in the transcript, appends a kind: reply row. Wired by bourdon setup with the others (0.22.0).
bourdon recognition eval [--live PROMPTS]Score recognition against the golden set, or against the live library with real prompts.
bourdon recognition usefulness [--from-transcript PATH]Did replies reference what was recognised.
bourdon doctorHealth of every installed participant with a proposed_fix per problem. --strict for CI.
bourdon demoThe production pipeline over synthetic data in a tempdir. Touches nothing real.
bourdon dogfoodPlant a marker, export all, query L6, verify the round trip. Machine-readable report with --report-out.
bourdon audit-leaksStatic scan of published manifests for credential shapes and leaked private rows. --strict --require-files is the CI form.

Publish memory#

CommandDoes
bourdon export-allExport every enrolled participant's manifest. Refuses to overwrite a populated manifest with an empty export unless told to.
bourdon <agent> exportOne participant: claude-code, codex, cursor, copilot, cascade, hermes, lovable, claude-desktop-cowork, claude-desktop-code, *-automations, openclaw (staged).
bourdon agents list / enable / disableThe consent roster. Bare bourdon agents emits the bourdon.agents/v1 JSON contract; --federated merges peers.

Read memory#

CommandDoes
bourdon prepare-turn "<prompt>"The recognition step as a command. --access-level.
bourdon deeper-context "<prompt>"The hydration step.
bourdon codex prepare-turn and friendsCodex-specific turn preparation, including the UserPromptSubmit hook.

Serve and secure#

CommandDoes
bourdon serveThe L6 MCP server. Flags above.
bourdon agent add / list / rotate / set-tierFederation members and their tokens. Tokens print once; only hashes are stored.
bourdon grant / ungrantGive a quarantined member read access to one namespace.
bourdon revokeKill a member's token, effective on the next request.
bourdon staging list / promote / rejectReview quarantined writes.
bourdon auditQuery the append-only audit log. --denials, --agent, --export.
bourdon oauth set-passphrase / statusThe browser-client front door.
bourdon library enrollExplicit library identity, required for caller descriptions.

Move memory#

CommandDoes
bourdon sync push <dest>rsync the library out, visibility-filtered (public by default), machine-scoped.
bourdon sync pull <src>Receive into a quarantine, validate, promote atomically.
bourdon sync stage <dir>The first half of a push as its own step, for destinations rsync cannot reach.

Surfaces#

CommandDoes
bourdon presence register / heartbeat / deregister / listLive-session registry for the desktop tray. Local, TTL-based.
bourdon consoleLoopback-only web page for the roster, per-run access token.
bourdon benchmarkThe recognition and latency harnesses behind the published numbers.

Stable contracts#

These are the shapes other software can depend on. Everything else may change before 1.0; see Status and stability.

ContractWhere
L5 manifest, spec 0.1https://bourdon.ai/schema/L5_manifest_v0.1.json
bourdon.agents/v1output of bourdon agents --json and the export_agents tool
bourdon.roster/v1output of bourdon agents list --json
codex-turn-brief/v1output of compile_codex_turn
Participant contractspec/PARTICIPANT_CONTRACT.md
Conformance fixturesconformance/, regenerated in CI

The CLI, the L5 wire format, the spec, and the conformance fixtures are Apache-2.0. The engine behind them is BUSL-1.1 and converts to Apache-2.0 four years after each release. Details in LICENSING.md.