second-brain-mcp

second-brain-mcp

Turns an Obsidian vault into semantic memory for coding agents, providing read-only semantic search and a human-approved write workflow via MCP.

Category
访问服务器

README

second-brain-mcp

PyPI version Python versions License: MIT CI

Turn your Obsidian vault into semantic memory for any MCP-capable coding agent.

v1.0.0 — early release. Works end-to-end on macOS and Linux; published on PyPI on 2026-04-15. Windows is untested. Feedback, bug reports, and testing notes are very welcome — please open an issue if anything misbehaves or if the docs are unclear.

What it does. Ships a stdio MCP server with four read-only tools (obsidian_overview, obsidian_search, obsidian_read, obsidian_backlinks) plus one prompt (to_obsidian) that drives a human-in-the-loop write workflow. Works with Claude Code, Cursor, Zed, or any client that speaks MCP.

What it is not. No auto-writes — nothing is written to the vault without an explicit /to_obsidian invocation. No background extraction, no reflection or compaction loops running on your behalf. The LLM does the extraction work when you call /to_obsidian, but every candidate note requires your explicit per-note approval before it is written. You control what enters the vault; the server only reads from it.

How this is different from other Obsidian MCP servers. Existing Obsidian MCP servers (e.g. variants of mcp-obsidian) typically talk to the running Obsidian app through its Local-REST plugin and expose file-level tools — list_files, get_file, append_to_note, etc. second-brain-mcp is offline and plugin-free: it reads the vault as plain files from disk, builds a local semantic index with bge-m3, and exposes semantic search rather than path-based CRUD. Obsidian does not need to be running. The write path is a curated workflow with per-note human approval, not a raw write_file tool.

30-second quick start

# 1. Install (uvx — no venv pollution)
uvx second-brain-mcp serve --help

# 2. Point at your vault
export OBSIDIAN_VAULT=$HOME/obsidian/vault

# 3. Register with Claude Code
claude mcp add -s user second-brain \
  -e OBSIDIAN_VAULT="$OBSIDIAN_VAULT" \
  -- uvx second-brain-mcp serve

# 4. Restart Claude Code, then ask: "call obsidian_overview"

First run downloads the bge-m3 embedder (~2.3 GB) on the first tool call — roughly 5 seconds after that. See docs/CUSTOMIZE.md for lighter models, or to point at an OpenAI-compatible embeddings API (Cloud.ru FM API, OpenAI, self-hosted Infinity) instead of the local model.

Vault requirements

Hard minimum: a directory with .md files somewhere (any nesting).

Everything else is optional:

  • YAML frontmatter (type, verified, confidence) enables filtering
  • [[wikilinks]] enable backlinks navigation
  • _index.md at the vault root is returned whole in obsidian_overview

Start with your existing vault — unused features simply stay inactive until you add the relevant structure.

Feature No frontmatter No wikilinks No _index.md
semantic search
type_filter in search
obsidian_read body
obsidian_read frontmatter empty dict
obsidian_read outlinks/backlinks empty
obsidian_backlinks tool empty
obsidian_overview index_md placeholder

Why editorial, not archival

Most agent-memory systems default to the archival model: capture everything — raw conversation turns, every tool call, every message — then rely on semantic search to pull the right thing back later. Comparative retrieval tests against one such system (MemPalace, with its exchange-pair chunking and multi-layer palace) surfaced a clear trade-off: on realistic queries a small set of human-approved notes outperformed a much larger raw conversation archive sitting in the same index.

The reason is simple. In any given session roughly 95% of what's said is working noise — code, syntactic back-and-forth, tactical detail that expires with the task. The 5% that survives — atomic facts, decisions, insights — is what you actually want to find six months later. Archival memory keeps both and leans on the embedder to separate them, and that separation is hard to get right in practice.

second-brain-mcp takes the editorial position: memory is what you chose to remember. Nothing reaches the vault by accident. The loop:

  1. You work a session normally. The agent reads from the vault through the four read-only tools but writes nothing on its own.
  2. When you're done, you invoke to_obsidian. The agent walks the session, pulls out candidate facts, frames each as an atomic statement, and checks for duplicates against the existing vault.
  3. It shows you the list. You approve, reject, merge, or rewrite each candidate individually.
  4. Only the approved notes land in the vault.

The LLM does the extraction work — it is good at abstracting and generalising. You are the editor — you know which of the candidates actually matter. The vault ends up small, dense, and almost entirely signal. That curated remnant is what makes retrieval surface the right thing instead of the loudest thing.

This is why there is no reflection loop, no background extraction, no auto-writes. The approval gate is the whole point.

Documentation

License

MIT. See LICENSE.

Credits

The pattern of embedding a PROTOCOL string in the first read-tool's response is borrowed from MemPalace's tool_status. The design was shaped by empirical comparisons with raw conversation archives — curation beats volume.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选