# Self-hosted second brain with MCP

> Source: <https://dev.to/lobrzut/self-hosted-second-brain-with-mcp-59d4>
> Published: 2026-06-17 17:11:21+00:00

I run IT and cybersecurity ops by day and tinker in a homelab at night. The problem I kept hitting: useful context from Cursor and Claude Code sessions evaporates when the chat ends. Notes end up scattered. RAG demos are cloud-first. I wanted something I own.

So I built [Brain AI Hub](https://github.com/lobrzut/brain) Ã¢â‚¬â€ a portable second brain with a local LLM, markdown vault, semantic search, and MCP hooks for IDE agents.

`:11434`

.`brain-vault`

, `brain-library`

, `brain-rag`

) with one-click deploy to Cursor, Claude Code, VS Code.`:7860`

for services, chat, GPU/VRAM, API keys, pipeline status.| Edition | Install |
|---|---|
Windows portable |
`Install.bat` Ã¢â€ â€™ `Start.bat` Ã¢â‚¬â€ copy the folder, run on another PC |
Linux server |
`curl -fsSL Ã¢â‚¬Â¦/linux/bootstrap.sh \ |

Install scripts speak English and Polish ({% raw %}`locale.env`

: `LANG=en`

or `LANG=pl`

).

On Windows, Brain deploys stdio MCP configs from the dashboard. On Linux, point Cursor at the SSE gateway:

```
{
  "mcpServers": {
    "brain-rag": {
      "url": "http://192.168.1.10:7862/sse/brain-rag"
    }
  }
}
```

Agents can search your vault, pull library chunks, and run skills without sending data to a third-party memory API.

RAG answers retrieval. MCP gives agents **tools** Ã¢â‚¬â€ write a note, list vault files, trigger a skill, query the code index. That matches how Cursor and Claude Code actually work: function calls mid-session, not a single embedding search at prompt time.

Python, FastAPI, Ollama, sqlite-vec, PowerShell (Windows), systemd (Linux). Homelab-friendly: MikroTik/UniFi networking, WireGuard, Docker where it helps.

```
git clone https://github.com/lobrzut/brain.git
cd brain
# Windows: Install.bat && Start.bat
# Linux:  curl -fsSL https://raw.githubusercontent.com/lobrzut/brain/main/linux/bootstrap.sh | sudo bash
```

Open `http://127.0.0.1:7860`

, connect MCP from the Tools tab, drop a PDF in the library, run a distill job on an old chat export.

Related homelab projects: [AI Studio](https://github.com/lobrzut/ai-studio) (ComfyUI + ACE-Step) and [NetDash](https://github.com/lobrzut/netdash) (LAN service dashboard).

Feedback and issues welcome on GitHub.
