ocbrain
Install

Install ocbrain

Stand up ocbrain as a local, read-first MCP server for your coding agents in a couple of minutes. Clone the repo, make a virtualenv, install, and point your runtimes at one shared SQLite brain.

Local SQLite Read-first MCP Codex · Claude Code · OpenClaw One shared brain

Quick start

Clone, create a virtualenv, install in editable mode, and launch the MCP server against a local database file.

git clone https://github.com/jonathangu/ocbrain.git
cd ocbrain
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
ocbrain --db data/ocbrain.sqlite mcp

That last line starts ocbrain over stdio as an MCP server backed by data/ocbrain.sqlite. The same database file is what every runtime will share.

The launcher

scripts/ocbrain-mcp starts the stdio MCP server read-first. It simply runs the ocbrain CLI mcp subcommand with no extra arguments, so every runtime can point at the same script instead of repeating the full command.

scripts/ocbrain-mcp        # runs: ocbrain mcp  (read-first, stdio)

Use the absolute path to this launcher in your runtime configs below.

Connect your runtimes

All three configs are read-first by default and point at the same launcher and the same database, so Codex, Claude Code, and OpenClaw share one brain.

Codex — ~/.codex/config.toml

[mcp_servers.ocbrain]
command = "/path/to/scripts/ocbrain-mcp"
args = []

Claude Code — ~/.claude.json

{
  "mcpServers": {
    "ocbrain": {
      "command": "/path/to/scripts/ocbrain-mcp",
      "args": []
    }
  }
}

OpenClaw — openclaw.json

{
  "mcp": {
    "servers": {
      "ocbrain": {
        "command": "/path/to/scripts/ocbrain-mcp"
      }
    }
  }
}

Replace /path/to/scripts/ocbrain-mcp with the absolute path inside your clone. Because all three point at the same launcher and DB, they read and write the same shared memory.

Read-first vs writes

Read-first (default)

The server exposes only read tools:

search digest get feedback

With --allow-writes

Launch with --allow-writes to additionally expose proposal / mark-stale and approval feedback for human-gated curation.

ocbrain --db data/ocbrain.sqlite \
  mcp --allow-writes

Keep writes off unless you intend human-gated curation.

Smoke test

Confirm the database responds with scoped current memory:

ocbrain --db data/ocbrain.sqlite digest

A successful digest returns the scoped current memory for the database you pointed at.

CLI surface

The ocbrain CLI exposes these subcommands:

init evidence value knowledge search digest loop-ingest propose mark-stale prune heal liveness-check mcp

Next steps

Read how the runtimes wire up, or browse the source.