Brain logo

Brain

by @backbencher

Indexes projects locally with 50 Tree-sitter analyzers, SQLite-backed code intelligence, CLI search, and an MCP interface.

Install Brain

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "backbencher-brain": {
      "command": "npx",
      "args": [
        "-y",
        "@backbencher/brain"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

We couldn’t confirm it starts correctly

The install command installed and started the server, which then stopped for configuration (such as an API key) that our sandbox does not have — expected for servers that connect to your account.

npx -y @backbencher/brain

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

@backbencher/brain indexes repositories with 50 Tree-sitter language analyzers and stores symbols, relationships, complexity data, and other index results in a per-project SQLite database. It exposes the index through the bb CLI, a stdio MCP server, and a library, with support for Node.js and Bun. Answers report freshness and missing results rather than guessing, while optional embeddings enable semantic retrieval. Reach for it when an agent needs local, repository-specific code intelligence through Claude Code, Cursor, or VS Code.

Use cases

  • Index a repository for local code intelligence
  • Search symbols and source content from an agent host
  • Trace relationships across languages
  • Ask semantic questions about an indexed project
  • Inspect index freshness and health in CI or remote shells

Key features

  • 50 Tree-sitter language analyzers
  • Per-project SQLite indexes
  • CLI, MCP, and library access
  • Symbol, content, file, and semantic search
  • Freshness-aware answers with missing-result reporting
  • Optional model-labeled embeddings

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 6d ago via OSV.dev · @backbencher/brain (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars19Stargazers on the source repository.
npm downloads3kPackage downloads in the last 30 days.
Last commit5d agoMost recent push to the default branch.
Install checkRunsOur sandbox started it; it then asked for an API key or config.

How Brain works

What @backbencher/brain does

@backbencher/brain, also called bb, builds a local code index for a repository and makes that index available to command-line workflows, MCP hosts, and library consumers. Its analyzers cover 50 languages through Tree-sitter. The resulting SQLite database records symbols, relationships, cross-language edges, complexity information, framework and security-flow inputs, and optionally embeddings.

The design is local-first. Indexing does not require a server, account, or telemetry service. Network access is limited to an embedding provider that you configure and the upgrade check. Each project gets its own database under the ~/.bb data directory by default.

How it works

Run bb index <directory> to parse a repository and populate its project database. Re-running the command processes changed files rather than reparsing everything; --force rebuilds the index, while --changed performs an incremental pass. The command reports parsed, skipped, and unchanged files, discovered symbols and relationships, phase timings, and final index health.

The index can be queried with bb search, including symbol, content, file, and individual-symbol search modes. bb stats reports counts and the database path, while bb status and bb health expose run state, phase timings, freshness, and index health. Semantic retrieval is available through the bb_ask tool after setup. Embeddings are labeled by model, and retrieval does not mix rows from different vector spaces; a forced re-index is required when changing models.

The MCP mode runs in the foreground over stdio for as long as the host keeps the process open. There is no daemon, systemd unit, or background service to manage.

Setup and configuration

Install the package globally with Node.js 18 or newer:

Terminal
npm install -g @backbencher/brain@latest
bb --version

Then index a project and start using its queries:

bash
bb index ~/my-project
bb search "calculateTotal" --dir ~/my-project
bb stats ~/my-project
bb health ~/my-project

Run bb setup before using semantic retrieval. The optional BB_DATA_DIR variable moves the complete data directory, which is useful for containers, read-only home directories, or keeping indexes beside a repository. BB_INDEX_CONCURRENCY or bb index --concurrency <n> controls the parsing worker count.

The package also provides installer scripts for Linux, macOS, and Windows. Building from source requires npm ci and npm run build; Bun can run the source development path.

Tools and capabilities

  • Index repositories using 50 Tree-sitter language analyzers.
  • Preserve symbols, relationships, cross-language links, complexity data, and selected analysis inputs in SQLite.
  • Search symbols, content, files, or a specific symbol from the CLI.
  • Query indexed code through the stdio MCP server, including the bb_ask semantic retrieval tool.
  • Inspect project counts, database paths, run status, timing data, health, and file freshness.
  • Re-index incrementally or rebuild from scratch with explicit indexing modes and controls.

Limitations and notes

Node.js 18 or newer is required for the npm installation, which uses the native better-sqlite3 module. Supported platforms include Linux, macOS, and Windows on x64 and arm64; WSL users should use the Linux path and index files within the Linux filesystem for better performance.

SQLite uses WAL mode, so the data directory must support creation, renaming, and locking of the database, WAL, and shared-memory files. Network filesystems with unreliable POSIX locking are not supported. Indexing runs in the foreground, and memory use increases with parser concurrency and file size.

A semantic query does not search embeddings written by another model as though they belonged to the same vector space. Re-run indexing with --force to re-embed when changing embedding models. The local fallback can provide semantic retrieval without an API key.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Brain

@backbencher/brain is an MCP server that connects agent hosts to a local SQLite index of a code repository. It uses 50 Tree-sitter analyzers and provides repository search, code-intelligence queries, and the bb_ask semantic retrieval tool through a stdio MCP interface.

Install it globally with Node.js 18 or newer using npm: `npm install -g @backbencher/brain@latest`. Then index a project with `bb index <directory>` and configure the host to run the foreground stdio server with `bb mcp --dir <directory>`.

Yes, @backbencher/brain can be queried from Cursor through its stdio MCP server. Install the package, create an index for the project, and configure Cursor to launch the `bb mcp` command for that directory.

Yes, local indexing and standard search work without an API key, and the semantic retrieval fallback can also run locally. An external embedding provider is only needed when you choose to configure one.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewBrain AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/backbencher-brain?style=directory)](https://allmcps.com/mcp/backbencher-brain)
HTML Embed
<a href="https://allmcps.com/mcp/backbencher-brain"><img src="https://allmcps.com/api/badge/backbencher-brain?style=directory" alt="Brain on AllMCPs" /></a>