
officegrep
io.github.Asgoresmilelong由 GitHub 账号 Asgoresmilelong 发布v0.1.3更新于 Oct 26, 2026
Full-text search inside Word, PPT, Excel and PDF files, with precise locators.
概览
本地 MCP 服务器,将 Word、PowerPoint、Excel、PDF 和文本文件索引到 SQLite,让助手进行全文检索并给出精确定位。
- 可以做什么
- 按字面全文检索已索引文档,返回文件路径、页码/幻灯片/工作表单元格等定位信息以及高亮片段
- 列出已索引文件及其文本块数量
- 为指定文件夹建立或增量刷新索引
- 通过命令行或服务器后台监视文件夹变化,保持索引同步
- 适用场景
- 当助手需要在本机 Office 文档和 PDF 中查找具体段落,而普通 grep 读不到这些内容时适用;适合希望离线、增量检索、不依赖嵌入服务或向量库的场景。
- 运行要求
- 作为本地进程在桌面运行,可通过 pip 或 .mcpb 安装包安装(安装包需要 uv)。运行时依赖 lxml 和 openpyxl,PDF 支持需可选安装 pypdf。无需账号或 API 密钥。可选环境变量 OFFICEGREP_DB、OFFICEGREP_AUTOINDEX、OFFICEGREP_ROOTS、OFFICEGREP_WATCH 分别控制索引路径、首次自动扫描、扫描目录和后台监视。
安装
在 SourceWeft 中
- 打开 控制台中的 officegrep,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
officegrep
[ci] [license: MIT] [python] [MCP]
Full-text search inside Word, PowerPoint, Excel and PDF — for agents.
grep cannot see a single character inside a .docx. officegrep extracts the text, indexes it into one SQLite file, and hands it to any agent over MCP.
中文说明:README.zh-CN.md
Why
grep/ripgreponly read plain text..docxis a zip of XML,.xlsxkeeps strings in a shared table,.pdfis a compressed stream.- Generic RAG needs an embedding service, a vector store, and a network round-trip.
- This needs one SQLite file: offline, incremental, milliseconds.
Install
Runtime deps: lxml, openpyxl; PDF support adds optional pypdf.
Listed in the official MCP Registry as io.github.Asgoresmilelong/officegrep; there is also an .mcpb bundle on the releases page for MCP hosts that install bundles (needs uv).
CLI
The index lives in ~/.officegrep/index.db; override with --db or OFFICEGREP_DB.
First run
Nothing to do. If the index is empty when officegrep mcp starts, it scans ~/Documents, ~/Downloads and ~/Desktop in the background (25 MB per-file cap) while the agent keeps talking; a search_docs call made in the meantime answers with a "still building" note instead of a misleading "no results".
- opt out:
OFFICEGREP_AUTOINDEX=0 - scan other folders:
OFFICEGREP_ROOTS="~/work;~/papers"
Stay in sync
Or let the MCP server watch in the background:
The index runs in WAL mode, so a watch process and an MCP server can share one database file concurrently — something that fails with database is locked on a default rollback journal.
MCP server
Client config (Claude Desktop / Cursor / Codex / any MCP host):
The protocol is a hand-written JSON-RPC over stdio — no MCP SDK dependency.
How it works
- Every block carries a human-readable locator, because the first question an agent asks is "where?".
- The index uses SQLite FTS5 with the
trigramtokenizer: substring matching for both CJK and Latin text, no word segmenter required, ranked bybm25(). - Queries of 1–2 characters cannot match trigrams, so they fall back to a scan ranked by hit count (CJK queries are frequently two characters).
- Incremental: compare
(size, mtime)first, hash with SHA-1 only when they differ.
Benchmark on a real engineering corpus:
Limits
- No OCR: scanned PDFs yield nothing.
- Literal search, not semantic — "tower" will not find "pole" unless both appear.
- 1–2 character queries scan the table; slow past a few hundred thousand blocks.
- Indexes body text only: no comments, tracked changes, headers or footers.
License
MIT
来源:README.md,提交 7c1314a
工具
0版本历史
2- v0.1.3最新Oct 18, 2026
- v0.1.1Oct 18, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分