
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 分