bh-pdfdoc-reader
Integrates with GitHub Copilot in VS Code to provide document reading capabilities for PDF and DOCX files directly within the IDE.
Click on "Install 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., "@bh-pdfdoc-readerRead the API docs from api-spec.pdf"
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.
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
Related MCP server: MokuPDF
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 a PDF/DOCX file and return content (markdown or json) |
| Read a specific page from a PDF (1-indexed) |
| 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-onlyOutput Formats
Format | Flag | Best For |
Plain Text |
| Terminal reading |
Markdown |
| AI assistants, documentation |
JSON |
| Programmatic processing |
Supported Formats
Format | Extension | Features |
| Text extraction, table extraction, page selection, metadata | |
Word |
| 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.mdDevelopment
# 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_readerComparison 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 markdownIDE 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/.csvsupportOCR for scanned PDFs (via Tesseract)
Streaming/chunked output for large documents
PyPI package publishing
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/BilhosDev/bh-pdfdoc-reader'
If you have feedback or need assistance with the MCP directory API, please join our Discord server