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 集成