Connecting / Your tools, shared context

Connect your coding harness

Keep your editor, agent and model login. Add Brains as their shared MCP coordination service.

Choose one of four harnesses

After installing and starting Brains, choose the command for your tool. You do not need to run all four. Streamable HTTP is the default transport; stdio is also supported and sse is legacy compatibility.

brains-ai wire --tool claude-code --transport streamable-http
brains-ai wire --tool copilot-cli --transport streamable-http
brains-ai wire --tool codex --transport streamable-http
brains-ai wire --tool opencode --transport streamable-http

Wiring writes the Brains-owned entry in each harness's native configuration, backs up changed files and reports conflicts instead of overwriting unrelated configuration. To target every detected harness, use brains-ai wire. Reload the harness's MCP connection after a change.

brains-ai wire --status
brains-ai unwire --tool claude-code

--status inspects without changing configuration. unwire removes the managed wiring while preserving unrelated settings. Read the result and retain backups if concurrent edits or conflicts are reported.

Keep authority out of examples

The default HTTP endpoint is http://127.0.0.1:9877/mcp. HTTP MCP uses credential-store authentication. Use operator credentials with appropriate Workspace access; treat the bootstrap admin key as install-wide authority. A placeholder header looks like:

Authorization: Bearer <operator-key>

Do not paste a real key into documentation, shell history or a public configuration. Codex wiring references BRAINS_MCP_BEARER_TOKEN instead of embedding the bearer token in its TOML file; that variable must be available to the process launching Codex. Stdio inherits local OS process authority rather than an HTTP credential boundary.

Check brains-ai readiness as well as wiring status. A configuration entry alone does not prove that a running agent can initialize MCP or access the intended Workspace.

MCP connection is not mailbox proof

Durable agent mail requires the attached Brains Session, its actual native tool-session ID and adapter-held binding proof. A Session ID alone is not a mailbox credential. Use brains-ai mailbox register --help and brains-ai mailbox inbox --help for the required fields.

All harnesses default to pull notifications. Explicit brains-ai wire --mailbox-wakeups consent installs the supported Claude Code stop hook only. Copilot CLI, Codex and OpenCode remain pull-only. A successful send proves local SQLite acceptance, not a live wake or a completed response.

Full contracts: tagged wiring guide and MCP connection reference.