officegrep
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@officegrepsearch my documents for 'bending moment' and show highlighted snippets"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
officegrep
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.
$ officegrep search "bending moment"
Found 3 hits:
F:\reports\pole-design.docx [table p 89]
design bending moment (load point 0.25 m from tip); deflection limit; test moment = 2× …
F:\notes\composites.md [line 32]
… utilization 81%. **test bending moment = 2× the standard test moment** …中文说明: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.
Related MCP server: my-kb
Install
pip install git+https://github.com/Asgoresmilelong/officegrep
# optional PDF support
pip install "officegrep[pdf] @ git+https://github.com/Asgoresmilelong/officegrep"Runtime deps: lxml, openpyxl. PDF needs optional pypdf.
CLI
officegrep index ~/Documents ~/Downloads # build / update (incremental)
officegrep search "island reef" --limit 5
officegrep search "wind load" --under ~/Documents
officegrep statsThe index lives in ~/.officegrep/index.db; override with --db or OFFICEGREP_DB.
MCP server
officegrep mcpClient config (Claude Desktop / Cursor / Codex / any MCP host):
{
"mcpServers": {
"officegrep": {
"command": "officegrep",
"args": ["mcp", "--db", "/Users/me/.officegrep/index.db"]
}
}
}Tool | What it does |
| Full-text search → file path, locator ( |
| Indexed files with block counts |
| Build / refresh the index (incremental) |
The protocol is a hand-written JSON-RPC over stdio — no MCP SDK dependency.
How it works
docx / pptx → zipfile + lxml, read the XML directly
xlsx → openpyxl (read_only)
pdf → pypdf (optional)
txt / md → line chunks, line numbers keptEvery 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:
Metric | Value |
Files | 43 (docx / pptx / xlsx / md, incl. an 8.6 MB deck) |
Text blocks | 2,260 |
First index | 2.16 s |
Database | 1.9 MiB |
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
This server cannot be deployed
Maintenance
Related MCP Connectors
Securely search and manage workspace context files for AI agents and teams.
Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.
Ingest, manage, and retrieve documents for RAG-powered AI applications
Hosted document tools for agents: extract, parse, classify, convert, OCR, sign, and redact.
Related MCP Servers
- AlicenseAqualityBmaintenanceIndexes local documents (PDF, Word, Markdown, text) into a SQLite database for AI agents to search and retrieve bounded, source-located passages. Runs fully locally with optional OCR, preserving privacy.5MIT
- FlicenseNot gradedqualityCmaintenanceEnables agents to search a local, fully offline personal document library (Markdown/txt/PDF/docx) via SQLite FTS5 trigram search with subject-terminology expansion, returning every hit with its domain, document title, section path, and page or offset provenance. It also exposes domain statistics, incremental ingestion, and document deprecation as tools, alongside a read-only, runtime-persona-scoped ask/coverage mode.-
- AlicenseNot gradedqualityAmaintenanceTurns a local folder of documents into a queryable index that an LLM agent can pull from on demand, keeping only a compact table of contents in context. Exposes five tools (index, search, read, grep, neighbours) over a single offline SQLite FTS5 store so the model retrieves exact, citable sections instead of being handed whole files.MIT
- AlicenseNot gradedqualityCmaintenanceEnables Claude to search and read the user's local document collection (PDF, Word, Excel, Markdown, plain text) during a conversation by subject, by file name/path, or by exact word, and to retrieve file contents page by page. It also supports finding folders relevant to a topic and checking indexing status, with everything running locally on the user's machine.MIT