second-brain MCP

io.github.ddmanyes由 GitHub 帳號 ddmanyes 發布v0.1.0更新於 Oct 24, 2026

Self-maintaining knowledge vault: figure-level search, auto-wikilinks, and memory compression.

發布方自己的服務:BrainDog

概覽

AI 產生的概覽

本機 Markdown 知識庫 MCP 伺服器,讓 AI 助理儲存文章與 PDF、檢索筆記和圖表,並維護自動連結與壓縮的記憶。

可以做什麼
儲存來源:抓取網址或 PDF,轉為 Markdown、對圖表做 OCR 並嵌入知識庫,或直接新增與編輯筆記,自動歸檔與自動連結。檢索:對筆記內文和圖表內容做關鍵字與語意混合搜尋,並依作者、DOI、PMID、PMCID 或年份檢索論文。工作階段脈絡:工作階段開始時重新載入目標、高排名筆記和自動規則,並向代理提供歸檔規範。日常維護:唯讀稽核文章中繼資料、連結、重複項目和來源新鮮度,並壓縮長期未讀的舊筆記。索引維護:重建搜尋索引並檢查伺服器健康狀態。
適用情境
適合希望助理長期建立並維護個人研究或閱讀知識庫的情境,把論文和網頁文章收錄後依內容或圖表隨時找回。適用於單一使用者本機環境,或跨機器共享的自架中央伺服器。
執行需求
以 pip 安裝的 Python 套件在本機執行,透過 stdio 以模組方式啟動。需要以 SECOND_BRAIN_PATH 環境變數指定知識庫目錄,首次執行時自動建立。抓取網頁需要 Playwright 與 Chromium;圖表 OCR 使用 Claude Vision,README 提到自架部署需要 API 金鑰。預設使用離線 DuckDB 儲存,可選 Postgres 加 pgvector。
安裝前請注意
助理會寫入你的知識庫:筆記會被新增、編輯、自動連結,舊筆記會被壓縮,建議檢查變更。圖表 OCR 和每週壓縮會把內容傳送給第三方 Claude API。README 提示 PyPI 套件落後於原始碼。另有作者資訊回填指令會寫入中繼資料,只應在中央寫入主機上執行。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 second-brain MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

second-brain MCP Server

A self-maintaining personal knowledge base for AI agents — a plain-Markdown vault, powered by MCP.

[CI] [Python 3.11–3.13] [License: MIT]

📖 English · 繁體中文


A local knowledge base your AI agent can read, write, and maintain on its own. Save a paper or note with one command — second-brain converts it to Markdown, OCRs every figure, embeds it for semantic search, and auto-links it to related notes. Notes you stop reading compress themselves over time, so recall stays cheap as the vault grows.

Everything is plain Markdown — sync via Google Drive / iCloud / git, switch agents anytime, zero lock-in.

Highlights

  • One command saves anything — save_article(url_or_pdf) fetches, converts to Markdown, OCRs figures (Claude Vision), embeds, and auto-links.
  • Figure-level search — search_figures("UMAP melanocyte") returns the exact panel across your whole library.
  • Self-organizing — new notes auto-link to related ones; frequently-read notes extract reusable rules.
  • Memory that forgets like a brain — Ebbinghaus ranking; stale notes auto-compress (60–90% fewer tokens).
  • Read-only housekeeping audit — inspect article metadata, links, exact duplicate candidates, inbox age, and source freshness without changing the vault.
  • Session continuity — get_context() reloads goals + top notes + rules at the start of every session.
  • Pluggable backend — DuckDB (default, offline) or Postgres + pgvector (central, multi-machine). Self-hosted embeddings optional; BM25 fallback when offline.

Quick Start (Claude Code)

bash
pip install mcp-second-brainplaywright install chromium
claude mcp add --scope user second-brain \  --env SECOND_BRAIN_PATH=~/second-brain \  -- python -m mcp_second_brain

The vault directory and templates are created on first run. Then tell your agent init_vault to verify.

⚠️ PyPI currently lags the source tree. For the newest build — plus Claude Desktop, Windows, and multi-machine / central-server setups — see NEW_MACHINE_SETUP.md.

Core Tools

ToolWhat it does
auth_contextRead the authenticated caller's canonical UUID, role, and RBAC state
get_contextSession start — goals + top-ranked notes + auto-rules
save_articleURL / PDF → Markdown + figures + embeddings
search_notes / search_figuresHybrid BM25 + semantic search (note text / figure content)
search_articlesStructured author, ORCID, DOI/PMID/PMCID and year search for papers
audit_article_recordsBounded, read-only article housekeeping and social-source freshness report
new_note / update_note / append_to_noteCreate & edit notes (auto-filed, auto-indexed, auto-linked)
vault_sleepCompress old, low-activity notes
get_agent_instructionsServe the full filing SOP (AGENTS.md) to remote agents

Full tool reference (46 tools) lives in AGENTS.md.

Use search_notes when you need content, health_check when the server or index may be unhealthy, and audit_article_records when you need a housekeeping report. Audit results never merge, archive, or delete notes automatically.

How It Works

text
Any source (paper · PDF · web · note)        │   save_article · new_note        ▼Markdown vault  ──►  index  (DuckDB, or Postgres + pgvector)  00-inbox/            • BM25 + semantic search  10-projects/         • figure OCR + vision descriptions  20-areas/            • auto-wikilinks between related notes  30-resources/        • Ebbinghaus ranking → weekly auto-compression  decisions/ memory/        │        ▼Your AI agent queries it — search_notes · search_figures · get_context

The vault is the source of truth; the index is rebuildable anytime (sync_index). Filing conventions live in one operating manual — AGENTS.md — served to any agent via get_agent_instructions(), so every agent files things the same way without being re-taught.

Vault Structure

text
vault/├── 00-inbox/       Unprocessed captures├── 10-projects/    Active projects├── 20-areas/       Ongoing research / coding domains├── 30-resources/   Papers & articles (save_article writes here)├── 40-archive/     Auto-compressed originals├── decisions/      Architecture Decision Records├── memory/         goals.md · rules.md  (injected every session)└── templates/      Note templates

Legacy author metadata

search_articles reads structured frontmatter, so older article notes without authors are not guessed from body text or references. A bounded two-phase CLI can prepare those notes safely: first create and review a manifest, then apply it separately.

bash
python -m mcp_second_brain.author_backfill \  --vault "<vault>" --limit 20 --out /tmp/author-backfill.jsonpython -m mcp_second_brain.author_backfill \  --vault "<vault>" --apply --manifest /tmp/author-backfill.json

Apply on the central writer host only. Each entry requires an exact DOI/PMID/PMCID or title match and unchanged content/body hashes; successful writes are reindexed.

Documentation

  • AGENTS.md — filing SOP, naming conventions, full tool reference (single source of truth)
  • NEW_MACHINE_SETUP.md — source install, self-hosting, multi-machine central server, API keys
  • CONTEXT.md — domain model / ubiquitous language

Design Notes

Inspired by biological memory: the Ebbinghaus forgetting curve (access_count / ln(age_days)) for ranking, and sleep-dependent consolidation (weekly LLM compression of low-access notes). Built with MarkItDown · DuckDB · pgvector · FastMCP · Playwright · Claude API.

License

MIT © 2026 Chan Chi Ru. See LICENSE.

來源:README.md,提交 0e08505

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Brain 整合