Bh Pdfdoc Reader
БесплатноНе проверенEnables AI-powered IDEs to read PDF and DOCX files directly, supporting structured output in Markdown, JSON, or plain text.
Описание
Enables AI-powered IDEs to read PDF and DOCX files directly, supporting structured output in Markdown, JSON, or plain text.
README
📄 bh-pdfdoc-reader
Lightweight document reader for AI-powered IDEs
Read PDF & DOCX files directly in Cursor, Windsurf, VS Code, Antigravity, and Claude Desktop via MCP
Installation • MCP Integration • CLI Usage • Formats
Why?
AI coding assistants in IDEs like Cursor, Windsurf, Antigravity, and VS Code Copilot can't natively read PDF or Word documents. When you need to reference API docs, specifications, or reports while coding, you're stuck copy-pasting.
bh-pdfdoc-reader solves this by:
- 🔌 MCP Server — Plugs directly into your IDE's AI assistant
- 📑 Structured output — Markdown, JSON, or plain text
- 📊 Table extraction — Preserves tables from both PDF and DOCX
- ⚡ Lightweight — Minimal dependencies, fast startup
- 🖥️ CLI tool — Also works standalone from the terminal
Installation
Quick install (from GitHub)
# With MCP server support (recommended for IDE integration)
pip install "bh-pdfdoc-reader[mcp] @ git+https://github.com/BilhosDev/bh-pdfdoc-reader.git"
# Core only (CLI, no MCP)
pip install "bh-pdfdoc-reader @ git+https://github.com/BilhosDev/bh-pdfdoc-reader.git"
From source (for development)
git clone https://github.com/BilhosDev/bh-pdfdoc-reader.git
cd bh-pdfdoc-reader
pip install -e ".[all]"
MCP Integration
What is MCP?
Model Context Protocol (MCP) is an open standard that lets AI assistants use external tools. By running bh-pdfdoc-reader as an MCP server, your IDE's AI can read documents on demand.
Cursor
Add to your .cursor/mcp.json (project-level) or ~/.cursor/mcp.json (global):
{
"mcpServers": {
"bh-pdfdoc-reader": {
"command": "bh-pdfdoc-reader-mcp",
"args": []
}
}
}
Windsurf
Add to your MCP configuration:
{
"mcpServers": {
"bh-pdfdoc-reader": {
"command": "bh-pdfdoc-reader-mcp",
"args": []
}
}
}
VS Code + GitHub Copilot
Add to your .vscode/mcp.json:
{
"servers": {
"bh-pdfdoc-reader": {
"type": "stdio",
"command": "bh-pdfdoc-reader-mcp",
"args": []
}
}
}
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"bh-pdfdoc-reader": {
"command": "bh-pdfdoc-reader-mcp",
"args": []
}
}
}
Antigravity (Google DeepMind)
Antigravity supports MCP servers natively. Add to your MCP settings:
{
"mcpServers": {
"bh-pdfdoc-reader": {
"command": "bh-pdfdoc-reader-mcp",
"args": []
}
}
}
Note: If the command isn't found, use the full path:
"command": "python"and"args": ["-m", "bh_pdfdoc_reader.mcp_server"]
Available MCP Tools
Once connected, your AI assistant can use these tools:
| Tool | Description |
|---|---|
read_document |
Read a PDF/DOCX file and return content (markdown or json) |
read_page |
Read a specific page from a PDF (1-indexed) |
get_document_info |
Get document metadata without reading full content |
Example prompts you can use in your IDE:
"Read the API documentation from docs/api-spec.pdf"
"What does page 5 of the contract say?"
"Summarize the report in reports/quarterly.docx"
"Extract the tables from data/pricing.pdf"
CLI Usage
# Read a PDF (plain text output)
bh-pdfdoc-reader document.pdf
# Read a specific page
bh-pdfdoc-reader document.pdf --page 3
# Output as Markdown (great for piping to AI tools)
bh-pdfdoc-reader document.pdf --format markdown
# Output as JSON (for programmatic use)
bh-pdfdoc-reader report.docx --format json
# Raw text only (no formatting)
bh-pdfdoc-reader document.pdf --text-only
Output Formats
| Format | Flag | Best For |
|---|---|---|
| Plain Text | --format text (default) |
Terminal reading |
| Markdown | --format markdown |
AI assistants, documentation |
| JSON | --format json |
Programmatic processing |
Supported Formats
| Format | Extension | Features |
|---|---|---|
.pdf |
Text extraction, table extraction, page selection, metadata | |
| Word | .docx |
Paragraphs, headings, tables, document properties |
Python API
You can also use bh-pdfdoc-reader as a library:
from bh_pdfdoc_reader.readers import get_reader
from bh_pdfdoc_reader.formatters import get_formatter
# Read a document
reader = get_reader("report.pdf")
result = reader.read("report.pdf", page=1)
# Format output
formatter = get_formatter("markdown")
print(formatter.format(result))
# Or get raw text
print(result.get_full_text())
Project Structure
bh-pdfdoc-reader/
├── src/bh_pdfdoc_reader/
│ ├── __init__.py # Package metadata
│ ├── __main__.py # python -m support
│ ├── cli.py # CLI entry point
│ ├── mcp_server.py # MCP server for IDE integration
│ ├── readers/
│ │ ├── base.py # Base reader class & factory
│ │ ├── pdf_reader.py # PDF reader (pdfplumber)
│ │ └── docx_reader.py # DOCX reader (python-docx)
│ └── formatters/
│ ├── markdown_fmt.py # Markdown output
│ ├── json_fmt.py # JSON output
│ └── text_fmt.py # Plain text output
├── tests/ # Unit tests
├── pyproject.toml # Package configuration
└── README.md
Development
# Clone and install in dev mode
git clone https://github.com/BilhosDev/bh-pdfdoc-reader.git
cd bh-pdfdoc-reader
pip install -e ".[all]"
# Run tests
pytest
# Run tests with coverage
pytest --cov=bh_pdfdoc_reader
Comparison with Alternatives
| Feature | bh-pdfdoc-reader | markitdown | docling |
|---|---|---|---|
| MCP Server | ✅ Built-in | ❌ Separate package | ❌ No |
| Lightweight | ✅ ~200 lines | ❌ Heavy | ❌ Very heavy |
| PDF Support | ✅ | ✅ | ✅ |
| DOCX Support | ✅ | ✅ | ✅ |
| Table Extraction | ✅ | ⚠️ Basic | ✅ |
| Multiple Formats | ✅ MD/JSON/Text | Markdown only | JSON only |
| Install Size | ~5 MB | ~50 MB | ~500 MB+ |
| Page Selection | ✅ | ❌ | ❌ |
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License — see the LICENSE file for details.
🇹🇷 Türkçe
bh-pdfdoc-reader, Cursor, Windsurf, Antigravity ve VS Code gibi AI destekli IDE'lerde PDF ve DOCX dosyalarını doğrudan okuyabilmenizi sağlayan hafif bir araçtır.
Ne İşe Yarar?
Yazılım geliştirirken API dökümanlarına, teknik şartnamelere veya raporlara başvurmanız gerektiğinde, PDF/Word dosyalarını kopyala-yapıştır yapmak zorunda kalırsınız. Bu araç, IDE'nizdeki AI asistanının dokümanları doğrudan okumasını sağlar.
Nasıl Çalışır?
- MCP Server olarak çalışır — IDE'nizdeki AI asistanı bu aracı otomatik olarak kullanır
- CLI aracı olarak da kullanılabilir — terminalden doğrudan dosya okuyabilirsiniz
- Python kütüphanesi olarak da import edilebilir
Hızlı Kurulum
# Kurulum (tek komut)
pip install "bh-pdfdoc-reader[mcp] @ git+https://github.com/BilhosDev/bh-pdfdoc-reader.git"
# CLI kullanımı
bh-pdfdoc-reader belge.pdf
bh-pdfdoc-reader belge.pdf --page 3
bh-pdfdoc-reader rapor.docx --format markdown
IDE Entegrasyonu
IDE'nizin MCP ayarlarına aşağıdaki yapılandırmayı ekleyin:
{
"mcpServers": {
"bh-pdfdoc-reader": {
"command": "bh-pdfdoc-reader-mcp",
"args": []
}
}
}
Kurulumdan sonra IDE'nizde şu tür komutlar verebilirsiniz:
- "docs/api.pdf dosyasını oku"
- "Sözleşmenin 5. sayfasında ne yazıyor?"
- "rapor.docx dosyasındaki tabloları çıkar"
Roadmap
-
.doc(legacy Word) support -
.pptx(PowerPoint) support -
.xlsx/.csvsupport - OCR for scanned PDFs (via Tesseract)
- Streaming/chunked output for large documents
- PyPI package publishing
Установка Bh Pdfdoc Reader
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/BilhosDev/bh-pdfdoc-readerFAQ
Bh Pdfdoc Reader MCP бесплатный?
Да, Bh Pdfdoc Reader MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Bh Pdfdoc Reader?
Нет, Bh Pdfdoc Reader работает без API-ключей и переменных окружения.
Bh Pdfdoc Reader — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Bh Pdfdoc Reader в Claude Desktop, Claude Code или Cursor?
Открой Bh Pdfdoc Reader на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
Fetch
Web content fetching and conversion for efficient LLM usage.
AWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
автор: modelcontextprotocolSpring AI MCP Server
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
llm-analysis-assistant
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
автор: xuzexin-hzCompare Bh Pdfdoc Reader with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории ai
