2 Commits

Author SHA1 Message Date
374339a15d 🔧 Fix verbose base64 output in image extraction functions
Resolve MCP client context overflow by saving images to files instead of
returning base64-encoded data that fills client message windows.

Key Changes:
• extract_images(): Save images to CACHE_DIR with file paths in response
• pdf_to_markdown(): Save embedded images to files with path references
• Add format_file_size() utility for human-readable file sizes
• Update function descriptions to clarify file-based output

Benefits:
 Prevents context message window overflow in MCP clients
 Returns clean, concise metadata with file paths
 Maintains full image access through saved files
 Improves user experience with readable file sizes
 Reduces memory usage and response payload sizes

Response Format Changes:
- Remove: "data": "<base64_string>" (verbose)
+ Add: "file_path": "/tmp/mcp-pdf-processing/image.png"
+ Add: "filename": "page_1_image_0.png"
+ Add: "size_bytes": 12345
+ Add: "size_human": "12.1 KB"

This resolves the issue where image extraction caused excessive verbose
output that overwhelmed MCP client interfaces.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-20 11:34:42 -06:00
c902e81e4d Initial commit: Complete MCP PDF Tools server implementation
Features:
- 8 comprehensive PDF processing tools with intelligent fallbacks
- Text extraction (PyMuPDF, pdfplumber, pypdf with auto-selection)
- Table extraction (Camelot → pdfplumber → Tabula fallback chain)
- OCR processing with Tesseract and preprocessing options
- Document analysis (structure, metadata, scanned detection)
- Image extraction with filtering capabilities
- PDF to markdown conversion with metadata
- Built on FastMCP framework with full MCP protocol support
- Comprehensive error handling and user-friendly messages
- Docker support and cross-platform compatibility
- Complete test suite and examples

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-10 16:36:21 -06:00