secondbrain-mcp

secondbrain-mcp

Enables Claude clients to search, read, and write to a Markdown second brain vault via GitHub, with tools for retrieval, capture, and knowledge graph consistency.

Category
Visit Server

README

secondbrain-mcp

One server. One connector. Every Claude client.

There is no chat UI to build. A custom connector is configured once, on your account, at claude.ai → Customize → Connectors → "+" → Add custom connector. From then on it is available in Claude Desktop, claude.ai, Cowork and the iOS and Android apps. Same server, same vault, same tools everywhere.

Claude connects to this remote MCP server from Anthropic's cloud, so the server must be on the public internet with real TLS. Deploy target: https://brain.lous.info on the shared Hetzner host. Platform services are owned by hetzner-infra; this repo deploys only the app plus nginx / observability drop-ins (same pattern as Padel Vibe / Unseen Servant).

Routes

route who calls it auth
/mcp Claude, every client GitHub OAuth (allow-listed login)
/authorize, /token, /auth/*, /.well-known/* Claude OAuth handshake public endpoints of the OAuth proxy
/ optional browser view optional nginx basic auth
/refresh GitHub webhook (optional) X-Webhook-Secret
/health Docker / CI healthcheck none

Auth

Env Role
GITHUB_OAUTH_CLIENT_ID / GITHUB_OAUTH_CLIENT_SECRET GitHub OAuth App for the Claude connector
GITHUB_ALLOWED_USERS Comma-separated GitHub logins (e.g. TomLous) — everyone else is rejected
VAULT_GITHUB_PAT Fine-scoped PAT for HTTPS clone/pull/push of the vault (separate from OAuth)

In Claude: add connector URL https://brain.lous.info/mcp, leave OAuth Client ID/Secret empty (Dynamic Client Registration), then Connect and sign in with GitHub as an allow-listed user.

How it works

 phone browser ─┐                    ┌─ shared nginx :443 ─┐
                ├── https ───────────┤                     ├── secondbrain-mcp:8000
 Claude cloud ──┘                    └─────────────────────┘         │
                                                                     ├─ /vault  (git clone)
                                                                     │     ▲
                                                                     │     │ pull every 5 min
                                                           github.com/.../SecondBrain
                                                                     ▲
                                                        Obsidian Git │ auto-commit
                                                                  laptop

The container never touches your laptop. GitHub is the sync bus.

Deploy (Hetzner)

See docs/hetzner-deploy.md.

# one-time on the server
sudo mkdir -p /opt/secondbrain/deploy/nginx
sudo chown -R deploy:deploy /opt/secondbrain
cp .env.example /opt/secondbrain/deploy/.env   # fill secrets
chmod 600 /opt/secondbrain/deploy/.env

Push to main builds ghcr.io/<owner>/secondbrain-mcp, SSHs to Hetzner, installs the nginx vhost into /opt/hetzner/deploy/nginx/conf.d/, syncs observability drop-ins, and health-checks https://brain.lous.info/health.

GitHub Environment Hetzner: secret HETZNER_SSH_KEY, vars HETZNER_HOST, HETZNER_USER (same as the other apps).

Local

cp .env.example .env                  # set VAULT_GITHUB_PAT + GitHub OAuth vars
docker compose -f docker-compose.dev.yml up -d --build
curl -s localhost:8770/health

Tools

Reads: search_vault, get_note, neighbors Lenses: next_actions, renewals, annual_cost, open_unknowns, stale_facts, check_graph Writes: capture, answer_unknown

Every write is pull --rebase → edit → check_graph.py → commit → push, and rolls back if the validator reports dangling links.

Known limits

  • answer_unknown does string surgery on frontmatter; fine for current vault shapes, not exotic YAML.
  • renewals needs notes with renewal_date populated.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured