Skip to main content

Brainstem — local-first knowledge backend for AI agents. Connect any MCP host (Claude Code, Cursor) to an Obsidian-compatible wiki with indexed retrieval, token-budgeted recall, and secure ingestion.

Project description

Brainstem

Local-first knowledge backend for AI agents.

Connect any MCP host — Claude Code, Cursor, or your own agent harness — to a personal knowledge engine: an Obsidian-compatible wiki with indexed retrieval, token-budgeted memory recall, and secure ingestion. Your agents get quality context; you keep your knowledge on your machine.

┌────────────┐   MCP (stdio/sse)   ┌───────────────────────────────┐
│ Your agent │ ◄─────────────────► │ Brainstem                     │
│ (Claude    │   27 tools          │  · search + read + write wiki │
│  Code,     │   (12 read-only)    │  · memory tree recall (BM25 + │
│  Cursor…)  │                     │    vectors, token-budgeted)   │
└────────────┘                     │  · code graph over your repos │
                                   │  · vault = plain Markdown     │
                                   └───────────────────────────────┘

Install

# Run without installing (recommended)
uvx brainstem-mcp init

# Or install
pip install brainstem-mcp
brainstem init

brainstem init creates a vault at ~/.brainstem/vault (override with --root) and prints the exact one-liner to connect your agent:

claude mcp add brainstem -- uvx brainstem-mcp mcp --root ~/.brainstem/vault

That's it. No API key is required to serve, search, and read — your agent brings its own model.

Docker

docker build -t brainstem .
docker run -i -v ~/.brainstem/vault:/vault brainstem            # stdio
docker run -p 8765:8765 -v ~/.brainstem/vault:/vault brainstem \
  mcp --root /vault --transport sse                             # sse

What your agent can do

  • Search & readsearch_wiki_index, read_wiki_file, cross-references, orphan detection over a plain-Markdown Obsidian-compatible vault.
  • Remember & recall — a hierarchical memory tree with BM25 + vector search and token-budgeted memory_tree_recall, built for agent context windows.
  • Write knowledge — structured pages with YAML frontmatter, index upkeep, supersession instead of duplication.
  • Understand code — ingest a repository and query its architecture (ask_repo, code-graph overview/impact) as part of your agent's context.

Read-only profile

Expose only the 12 safe read tools (no writes, no publishing):

brainstem mcp --readonly

Security posture

Brainstem treats everything it ingests as untrusted input: ingested content cannot trigger writes or publishing on its own, and outbound actions are draft-only by design. The vault is plain Markdown on your disk — no cloud, no telemetry, single-tenant by architecture.

Brainstem vs. OpenWiki

OpenWiki generates documentation that agents read as files. Brainstem is a live backend: your agent queries an indexed knowledge base through MCP tools at run time — retrieval, memory, and ingestion as part of the harness, not a batch-generated artifact.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brainstem_mcp-0.3.0.tar.gz (407.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brainstem_mcp-0.3.0-py3-none-any.whl (485.4 kB view details)

Uploaded Python 3

File details

Details for the file brainstem_mcp-0.3.0.tar.gz.

File metadata

  • Download URL: brainstem_mcp-0.3.0.tar.gz
  • Upload date:
  • Size: 407.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for brainstem_mcp-0.3.0.tar.gz
Algorithm Hash digest
SHA256 ddd892845b50570448969fe599b6c1ccddcc77806d81602be9943e6ff1195748
MD5 8be205227952f4db418c370310036dce
BLAKE2b-256 b9bfd02c69cd00a94564dafc0bdaedc889abaceb56d6bfd0f42e4e876fc0f9c2

See more details on using hashes here.

File details

Details for the file brainstem_mcp-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: brainstem_mcp-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 485.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for brainstem_mcp-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 456408682e00cf5a405c65bf438eb37b6cb55bddbff6996313067c4e5e4935b5
MD5 dc1c87f0ca20c8c4d3f0b056d76943a6
BLAKE2b-256 bdc0c3f7b9f34c1830658da6882c24fa6c44bef15e5e45fec3be4cf4ccee7962

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page