# second-brain MCP server

> Converts a Markdown folder into a structured second brain for Obsidian, allowing an AI to capture ideas, link concepts, and resurface related notes.

- Repository: https://github.com/Portaltocoding/second-brain-mcp
- Page: https://hostedmcp.org/servers/portaltocoding/second-brain-mcp
- Transport: stdio
- Stars: 0
- License: MIT
- Latest version: 0.1.1

## Install

### Claude Code

```sh
claude mcp add --env 'BRAIN_VAULT=<BRAIN_VAULT>' second-brain-mcp -- npx -y @toportal/second-brain-mcp
```

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

```json
{
  "mcpServers": {
    "second-brain-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@toportal/second-brain-mcp"
      ],
      "env": {
        "BRAIN_VAULT": "<BRAIN_VAULT>"
      }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "second-brain-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@toportal/second-brain-mcp"
      ],
      "env": {
        "BRAIN_VAULT": "<BRAIN_VAULT>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"second-brain-mcp","type":"stdio","command":"npx","args":["-y","@toportal/second-brain-mcp"],"env":{"BRAIN_VAULT":"<BRAIN_VAULT>"}}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "second-brain-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@toportal/second-brain-mcp"
      ],
      "env": {
        "BRAIN_VAULT": "<BRAIN_VAULT>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add second-brain-mcp --env 'BRAIN_VAULT=<BRAIN_VAULT>' -- npx -y @toportal/second-brain-mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.second-brain-mcp]
command = "npx"
args = ["-y", "@toportal/second-brain-mcp"]

[mcp_servers.second-brain-mcp.env]
BRAIN_VAULT = "<BRAIN_VAULT>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'BRAIN_VAULT=<BRAIN_VAULT>' second-brain-mcp npx -- -y @toportal/second-brain-mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "second-brain-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@toportal/second-brain-mcp"
      ],
      "env": {
        "BRAIN_VAULT": "<BRAIN_VAULT>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `BRAIN_VAULT` | yes | no | Ruta al vault de Obsidian (carpeta de Markdown) |
| `BRAIN_MODO` | no | no | Motor de resurgir: lexico o rag |

## FAQ

### Can I use my existing Obsidian vault?

Yes, you can point the server to your existing vault by setting the BRAIN_VAULT environment variable to your vault's path.

### Does it require a database or cloud storage?

No, everything is stored in your own Markdown files without databases or cloud services.
