# second-brain MCP

A local Markdown vault that your AI agent reads, writes and tidies up on its own. Useful when notes and papers pile up faster than you can file them.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 6
- Author: ddmanyes
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/ddmanyes/second-brain-mcp
- Updated: 2026-09-12
- HTML: https://affpapa.org/en/nevibecode/mcp/second-brain-mcp

## What it does

second-brain MCP exposes a folder of plain Markdown files to your agent over MCP. One call to `save_article` pulls in a URL or PDF, turns it into Markdown, OCRs the figures, embeds the result and links it to related notes. Search covers both note text and figure content, so `search_figures` can return the exact panel you remember from somewhere in the library.

The vault also thins itself out. Notes nobody opens get compressed over time, and ranking follows the Ebbinghaus forgetting curve. At session start `get_context` reloads goals, rules and the top-ranked notes, so the agent does not begin from nothing. The index can be rebuilt whenever you like with `sync_index`; the files stay the source of truth.

You need Python 3.11–3.13 and Chromium for Playwright. The vault directory and templates appear on first run. DuckDB is the default index and works offline; Postgres with pgvector is there for setups across several machines. Installing from PyPI may give you an older build than the source tree, so take the newest version from the repository if that matters.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add mcp-second-brain -- uvx mcp-second-brain
```
uvx runs the command named after the package; if the README names another one, use uvx --from mcp-second-brain <command>

### Codex

**Platform CLI**
```bash
codex mcp add second-brain-mcp -- uvx mcp-second-brain
```
uvx runs the command named after the package; if the README names another one, use uvx --from mcp-second-brain <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "second-brain-mcp": {
            "command": "uvx",
            "args": [
                "mcp-second-brain"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from mcp-second-brain <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "second-brain-mcp": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "mcp-second-brain"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from mcp-second-brain <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add second-brain-mcp uvx mcp-second-brain
```
uvx runs the command named after the package; if the README names another one, use uvx --from mcp-second-brain <command>

## When to use it
- save a paper or PDF into a knowledge base with one call
- find a specific figure by description across the whole library
- link a new note to ones you already have
- compress stale notes so recall stays cheap
- reload goals and rules when a session starts

## Example prompts
- Save this article to the vault with `save_article`
- Find the UMAP melanocyte panel using `search_figures`
- Load my session context: goals, rules and top notes

## Similar
- [second-brain-query](https://affpapa.org/en/nevibecode/skills/second-brain-query.md) — skill · 2500 installs
- [second-brain-ingest](https://affpapa.org/en/nevibecode/skills/second-brain-ingest.md) — skill · 2500 installs
- [second-brain](https://affpapa.org/en/nevibecode/skills/coreyhaines31-second-brain.md) — skill · 355 installs
- [company-brain](https://affpapa.org/en/nevibecode/skills/company-brain.md) — skill · 357 installs
- [Open Brain](https://affpapa.org/en/nevibecode/mcp/open-brain.md) — MCP server · ★ 8
- [myco-brain](https://affpapa.org/en/nevibecode/mcp/myco-brain.md) — MCP server · ★ 7

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
