Metadata-Version: 2.5
Name: doc-toolkit-mcp
Version: 0.1.0
Summary: MCP server for local document work: convert to Markdown, OCR scanned files, chunk for retrieval, and split or merge PDFs
Project-URL: Homepage, https://open.workbuddy.cn
Author: B2B增长工坊
License: MIT
License-File: LICENSE
Keywords: markdown,mcp,ocr,pdf,rag
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: jieba>=0.42
Requires-Dist: mcp>=1.2.0
Requires-Dist: openpyxl>=3.1
Requires-Dist: pymupdf>=1.24
Requires-Dist: pypdf>=4.0
Requires-Dist: python-docx>=1.1
Requires-Dist: python-pptx>=0.6.23
Provides-Extra: ocr
Requires-Dist: rapidocr-onnxruntime>=1.3; extra == 'ocr'
Description-Content-Type: text/markdown

# doc-toolkit-mcp

MCP server for local document work. **Everything runs on your machine** — no upload, no API key, no account.

| Tool | What it does |
|---|---|
| `convert_to_markdown` | PDF / DOCX / PPTX / XLSX → Markdown, tables preserved |
| `ocr_extract` | Images and scanned PDFs → text (optional OCR extra) |
| `split_chunks` | Split a document into retrieval-sized chunks |
| `pdf_merge` | Merge several PDFs in order |
| `pdf_split` | Split by page count, or extract a page range |

## Install

```bash
uvx doc-toolkit-mcp
```

With OCR support:

```bash
uvx --with rapidocr-onnxruntime doc-toolkit-mcp
```

## MCP client config

```json
{
  "mcpServers": {
    "doc-toolkit": {
      "command": "uvx",
      "args": ["doc-toolkit-mcp"]
    }
  }
}
```

## Behaviour notes

- `convert_to_markdown` reads the text layer only; scanned PDFs come back empty and should go through `ocr_extract`.
- `ocr_extract` checks each PDF page for a text layer first and only OCRs pages that lack one.
- `split_chunks` keeps the nearest heading with every chunk so retrieved passages carry context.
- All paths are absolute paths on the machine running the client.

## License

MIT
