PDF to Markdown engine for LLMs. Smart table extraction, OCR, MCP server for AI IDEs.
Project description
thinkpdf
Convert PDFs to clean Markdown for LLMs. Includes MCP Server for AI coding assistants.
Features
| Feature | Description |
|---|---|
| Smart Detection | Auto-chooses best engine for each PDF |
| High Table Accuracy | Uses IBM Docling's TableFormer |
| Fast Mode | pdfmd for simple documents |
| Smart Cache | Never reprocess the same PDF |
| MCP Server | For AI coding assistants |
Installation
pip install thinkpdf
For maximum quality (requires GPU):
pip install thinkpdf[docling]
Usage
MCP Server
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"thinkpdf": {
"command": "python",
"args": ["-m", "thinkpdf.mcp_server"]
}
}
}
Then just ask:
"Read the PDF at D:\docs\manual.pdf and explain it"
Python API
from thinkpdf import convert
# Simple conversion
markdown = convert("document.pdf")
print(markdown)
# With output file
convert("document.pdf", "output.md")
CLI
thinkpdf document.pdf -o output.md
How It Works
- Analyzes PDF complexity (tables, scans, simple text)
- Chooses best engine (Docling for complex, pdfmd for simple)
- Checks cache (instant if already converted)
- Converts to structured Markdown
- Caches result for next time
MCP Tools
When using as MCP server:
| Tool | Description |
|---|---|
read_pdf |
Convert and return content directly |
convert_pdf |
Convert and save to file |
get_document_info |
Get PDF metadata |
Requirements
- Python 3.10+
- PyMuPDF (included)
- Docling (optional, for best quality)
License
AGPLv3 - Open source license. Commercial use requires sharing source code.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file thinkpdf-1.0.1.tar.gz.
File metadata
- Download URL: thinkpdf-1.0.1.tar.gz
- Upload date:
- Size: 67.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ca7393e8ecf9f31086fe18f08bfc7165ec99b1d6f2e2a9150ab3790c1ddcf4b
|
|
| MD5 |
8f519465a7666880faccb2dcf0860da7
|
|
| BLAKE2b-256 |
121fd428bd9e83ba46f06536a35f462833374cecfbacc21375e2d38c443eaff7
|
File details
Details for the file thinkpdf-1.0.1-py3-none-any.whl.
File metadata
- Download URL: thinkpdf-1.0.1-py3-none-any.whl
- Upload date:
- Size: 74.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
057233c1a04330efc575a5005595f4ad8b1f0ee7b1209926819535c826c1115e
|
|
| MD5 |
83ccdb183bc8ee7a32800ab3ee6d1650
|
|
| BLAKE2b-256 |
175f8e97f3c5e321ad25775dc8fad6b7f74fa9a4d8378d7251c74a0aaa2b08c8
|