# brain-mcp

> brain-mcp is an open-source MCP server for knowledge and memory. Open-source MCP server that serves your Obsidian vault as private memory to AI clients. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Self-hosted, API
- **Website:** https://2brain.debawho.xyz
- **Repository:** https://github.com/debashishthakur/brain-mcp
- **MCP Registry name:** io.github.debashishthakur/brain-mcp
- **Categories:** [knowledge and memory](https://ai-powered.com/categories/knowledge-and-memory), [productivity](https://ai-powered.com/categories/productivity)
- **Listing updated:** 2026-11-23

## About

brain-mcp runs on your own machine as one Node process with a single SQLite file. It watches an Obsidian vault of plain Markdown, indexes each note by section with its links, topics and project, and serves the results over stdio, HTTP with a bearer token, or OAuth 2.1 through a Cloudflare Tunnel for remote clients.

Retrieval is hybrid and local. Keyword search, embeddings (bge-small), exact dates and note titles are fused, then a bge reranker orders the best candidates on CPU. When nothing scores above a floor, it says the vault does not record the answer instead of guessing, and it labels coverage as good, thin or none. Link following is off by default.

It also writes back. brain_remember appends durable facts and refuses near duplicates, facts can be replaced or expire, and further tools write, edit, move and delete hand-written notes inside folders you allow. The README describes scopes, secret redaction, an audit log and two bundled evals, in about 3,800 lines of TypeScript.

## Features

- **Local hybrid search:** Combines keyword, embedding, date and title search with a CPU reranker.
- **Honest empty answers:** Returns a no-relevant-result signal and a coverage label instead of guessing.
- **Memory that writes back:** Remembers facts, captures notes and edits files in allowed folders.
- **Time-aware facts:** Facts can replace earlier ones, expire or start at a set date.
- **Private remote access:** Bearer token on a network or OAuth 2.1 through Cloudflare Tunnel.
- **Audit and redaction:** Read, write and private scopes, secret redaction and an audit log of calls.

## Good for

- Give Claude or Cursor standing context about you and your projects
- Ask what you wrote about a topic last month
- Capture a decision from a chat as a vault note
- Brief a model on one project's recent changes
- Reach your notes from claude.ai or a phone

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add brain-mcp -- npx -y debawho-brain-mcp
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "brain-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "debawho-brain-mcp"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "brain-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "debawho-brain-mcp"
      ]
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "brain-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "debawho-brain-mcp"
      ]
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "brain-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "debawho-brain-mcp"
      ]
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add brain-mcp -- npx -y debawho-brain-mcp
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.brain-mcp]
command = "npx"
args = ["-y", "debawho-brain-mcp"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "brain-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "debawho-brain-mcp"
      ]
    }
  }
}
```

Or run: gemini mcp add -s user brain-mcp npx -- -y debawho-brain-mcp

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "brain-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "debawho-brain-mcp"
      ]
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "brain-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "debawho-brain-mcp"
      ]
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "brain-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "debawho-brain-mcp"
      ]
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "brain-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "debawho-brain-mcp"
      ]
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "brain-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "debawho-brain-mcp"
      ]
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "brain-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "debawho-brain-mcp"
      ]
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "brain-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "debawho-brain-mcp"
      ]
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "brain-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "debawho-brain-mcp"
      ]
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 2 of 12 tools change data; 8 names don't say. From the server's own tool labels and tool names; not verified by us.

- `brain_identity`: Returns a persona bundle of profile, memory notes, current facts, skills and projects.
- `brain_context`: Returns the most relevant sections for a question with a coverage label.
- `brain_search` (name suggests: reads): Hybrid search with project, type, topic and date filters.
- `brain_read` (name suggests: reads): Reads one note or one section with metadata and links.
- `brain_project`: Briefs on a project or lists projects.
- `brain_graph`: Shows links, backlinks and notes sharing topics.
- `brain_recent`: Lists notes modified in the last N days.
- `brain_capture`: Writes a new note with frontmatter into the capture folder.
- `brain_remember`: Appends durable facts and refuses near duplicates.
- `brain_facts`: Keeps the history of captured facts.
- `brain_write` (name suggests: changes): Writes hand-written notes in allowed folders.
- `brain_edit` (name suggests: changes): Edits notes in allowed folders.

## FAQ

### Do my notes leave my machine?

The README says nothing is uploaded to a third party and the models run locally.

### Can brain-mcp change my notes?

Yes. Remember, capture, write, edit, move and delete tools work only in folders you allow.

### How is brain-mcp installed?

As the npm package debawho-brain-mcp, over stdio.

### Can I turn off semantic search?

Yes. Set BRAIN_MCP_HYBRID=0 to stay keyword-only.

### Is brain-mcp free?

Yes. brain-mcp is open source, so you can use and self-host it for free.

### How do I add brain-mcp to Claude Code?

Run this command in your terminal: claude mcp add brain-mcp -- npx -y debawho-brain-mcp

### What are the best alternatives to brain-mcp?

The closest alternatives to brain-mcp are Codebase Memory, XERJ, Ha MCP, Claude Code Ultimate Guide and Concord MCP.

## Where this comes from

- Description: written from the project's README and the project's website.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ha MCP](https://ai-powered.com/mcp/ha-mcp): Ha MCP is an open-source MCP server for productivity.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.
- [Nautilus Compass Memory](https://ai-powered.com/mcp/nautilus-compass-memory): Nautilus Compass Memory is an open-source MCP server for knowledge and memory.
- [Myco: Agent-First Cognitive Substrate](https://ai-powered.com/mcp/myco-agent-first-cognitive-substrate): Myco: Agent-First Cognitive Substrate is an open-source MCP server for knowledge and memory.
- [Open Sunsama](https://ai-powered.com/mcp/open-sunsama): Open Sunsama is an open-source MCP server for productivity.

---
Source: https://ai-powered.com/mcp/brain-mcp
