library-mcp
v1.3.0MCP server for local personal library — .md + SQLite FTS5 trigram, read-only by default
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
search
在个人知识库中检索。中文子串召回好(trigram 分词):如「检索增强」能命中「RAG 检索增强生成」。配置了 LIBRARY_EMBEDDING_* 时为混合检索(关键词精确 + 语义近似,同义改写也能召回),返回中 retrieval 标注实际通道、matched_via 标注每条命中的来源通道;未配置或语义服务失败时自动降级纯关键词,接口不变。返回 doc_id + 标题 + 命中摘要(⟨⟩ 包裹);需要全文时再用 read 工具取 doc_id。
| Parameter | Type | Description |
|---|---|---|
query * | string | 自然语言查询词;支持中英混合,多个词按 AND 召回 |
tags | array | 按标签过滤(命中任一即保留) |
top_k | integer | 返回条数上限,默认 5 |
type | string | 按文档类型过滤 |
read
按 doc_id 读取单篇知识库文档的完整内容(frontmatter 元数据 + 正文 + 合并后的双链)。
| Parameter | Type | Description |
|---|---|---|
doc_id * | string | 文档 ID,形如 doc_2026-09-12_001(search/list 的返回值) |
list
列出知识库文档(按更新时间倒序,摘要不含正文)。浏览库、核对 doc_id、找最近写入的笔记时用它。
| Parameter | Type | Description |
|---|---|---|
limit | integer | 返回条数上限,默认 20 |
status | string | 按状态过滤;缺省时返回 active + draft(排除已删除) |
tags | array | 按标签过滤(命中任一即保留) |
type | string | 按文档类型过滤 |