mcp-docs-reader
# mcp-docs-reader
[](https://github.com/aranshayan/mcp-docs-reader/actions/workflows/ci.yml)
[](https://www.npmjs.com/package/@aranshayan/mcp-docs-reader)
[](LICENSE)
An [MCP](https://modelcontextprotocol.io) server that lets Claude **read your PDFs, Word documents, spreadsheets and CSVs** as clean text, Markdown and tables.
- **PDF** — text per page, page ranges (`"1-3,5"`), title metadata.
- **Word (.docx)** — Markdown with headings, lists, bold, tables and links, or plain text.
- **Excel (.xlsx) / CSV / TSV** — sheet listing, header + rows with paging, cached formula results, ISO dates, automatic CSV delimiter detection.
- **Sandboxed.** Only folders passed with `--root` are readable; symlinks are resolved first, so a link pointing outside is refused. 25 MB file limit. Read-only.
- Pure JavaScript, no native dependencies, no network access. Node.js 22+.
## Quick start
```json
{
"mcpServers": {
"docs": { "command": "npx", "args": ["-y", "@aranshayan/mcp-docs-reader", "--root", "/path/to/Documents"] }
}
}
```
Claude Code: `claude mcp add docs -- npx -y @aranshayan/mcp-docs-reader --root "$HOME/Documents"`. Multiple `--root` flags (or `MCP_DOCS_ROOTS`) are allowed; the default is the current directory.
## Tools
| Tool | Description |
| --- | --- |
| `list_documents` | PDF/DOCX/XLSX/CSV/MD/TXT files in a folder (optionally recursive). |
| `read_pdf` | Text by page; `pages`, `max_chars`. |
| `read_docx` | Markdown or text; paginated with `start_index`. |
| `read_spreadsheet` | `.xlsx` (with `sheet`) or `.csv`/`.tsv`; `start_row`, `max_rows` (≤500). |
| `read_text` | `.md` / `.txt`, paginated. |
All tools are `readOnlyHint`. Document contents are untrusted: a document can contain text that tries to instruct the model.
## Limits
- **No OCR.** Scanned PDFs return empty pages with an explanatory note.
- Images in Word documents are dropped; charts and pivot tables are not interpreted.
- Legacy `.doc` / `.xls` are not supported.
- `exceljs` depends on `uuid` 8.x, which has a moderate advisory about a `buf` argument that exceljs does not use. Consumers cannot override this from a dependency; it is not reachable here.
## Tests
`npm test` generates real PDF, DOCX and XLSX fixtures and checks every tool, path traversal, absolute paths, symlink escape, wrong file types, corrupt files, and the built CLI over stdio.
## License
[MIT](LICENSE)
TDQS
Scored across 5 tools
Each tool maps to a distinct file format (PDF, docx, spreadsheet, md/txt) plus one listing tool, so an agent can dispatch purely on file extension. The only borderline case is read_text vs read_docx for docx-as-plain-text, but read_docx's description explicitly covers that path, keeping boundaries clear.
All tools follow a verb_noun snake_case pattern (list_documents, read_*), which is predictable. Minor deviation: read_text names the output format (text) while siblings are named after input formats (pdf, docx, spreadsheet), so the noun category isn't perfectly uniform.
Five tools is well-scoped for a read-only document reader, with one listing tool and one reader per major format family. No tool feels redundant or filler.
Coverage spans all common office/text formats with pagination and sheet enumeration, which is strong for a reader. The notable gap is scanned/image-only PDFs, which the description admits return empty pages with no OCR or image-read fallback, leaving a dead end; no pptx support is also missing but minor.