botrun-mcp-js-pdf
v1.0.1
Published
JavaScript PDF processing MCP Server - Pure JS implementation using pdf-parse
Downloads
196
Maintainers
Readme
botrun-mcp-js-pdf
JavaScript PDF processing MCP Server - Pure JS implementation using pdf-parse
Features
This is a pure JavaScript implementation of PDF MCP Server, providing the same functionality as the Rust version (botrun-mcp-rust-pdf) but with:
- Zero native dependencies - Works on any platform with Node.js 18+
- Smaller package size - No binary downloads needed
- Easy to extend - Pure JavaScript, easy to customize
Available Tools
| Tool | Description |
|------|-------------|
| get_pdf_metadata | Get PDF metadata (page count, file size, token estimation) |
| extract_pdf_text | Extract text with page range and character limit |
| extract_pdf_chunked | Extract PDF in chunks for large files |
| search_pdf_keyword | Search keywords with context (like ripgrep) |
Installation
For Claude Code
claude mcp add botrun-mcp-js-pdf -- npx botrun-mcp-js-pdfFor Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"js-pdf": {
"command": "npx",
"args": ["botrun-mcp-js-pdf"]
}
}
}Global Installation
npm install -g botrun-mcp-js-pdfUsage Examples
1. Get PDF Metadata (Always Start Here)
Use get_pdf_metadata on https://example.com/document.pdfReturns:
- Total pages
- File size (MB)
- Estimated tokens
- AI strategy suggestion (extract vs chunked)
2. Extract Text from Specific Pages
Extract pages 1-5 from https://example.com/document.pdf3. Extract Large PDF in Chunks
Get chunk 0 from https://example.com/large-document.pdf4. Search for Keywords
Search for "introduction" in https://example.com/document.pdfLocal File Support
Both remote URLs and local files are supported:
# Remote URL
https://example.com/file.pdf
# Local file (only ./ prefix allowed for security)
./data/sample.pdfComparison with Rust Version
| Feature | JS Version (this) | Rust Version | |---------|------------------|--------------| | Performance | Good | Excellent | | Package Size | ~2MB | ~15MB | | Platform Support | Any (Node.js) | macOS, Linux | | Dependencies | Pure JS | Binary | | Customization | Easy | Requires Rust |
Choose JS version if:
- You want smaller package size
- You need to customize the code
- You're on a platform without pre-built binaries
Choose Rust version if:
- You need maximum performance
- You process many large PDFs
- You want the fastest extraction speed
Development
# Clone the repository
git clone https://github.com/bohachu/botrun-mcp-8.git
cd botrun-mcp-8/npm-packages/js-pdf-mcp
# Install dependencies
npm install
# Run tests
npm test
# Start server directly
npm startTechnical Details
- Built with @modelcontextprotocol/sdk
- PDF parsing by pdf-parse
- ESModule (type: module)
- Node.js 18+ required
License
MIT
Author
bohachu
