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>
40 lines
1.0 KiB
Python
40 lines
1.0 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Simple test script to verify the MCP server can be initialized
|
|
"""
|
|
|
|
import sys
|
|
import asyncio
|
|
from pathlib import Path
|
|
|
|
# Add the src directory to the path
|
|
sys.path.insert(0, str(Path(__file__).parent.parent / "src"))
|
|
|
|
async def main():
|
|
try:
|
|
from mcp_pdf_tools import create_server, __version__
|
|
|
|
print(f"✅ MCP PDF Tools v{__version__} imported successfully!")
|
|
|
|
# Try to create the server
|
|
mcp = create_server()
|
|
print("✅ Server created successfully!")
|
|
|
|
# Check available tools
|
|
tools = await mcp.get_tools()
|
|
|
|
print(f"\n📋 Available tools ({len(tools)}):")
|
|
for tool_name in sorted(tools.keys()):
|
|
print(f" - {tool_name}")
|
|
|
|
print("\n✅ All systems operational! The MCP server is ready to use.")
|
|
|
|
except Exception as e:
|
|
print(f"❌ Error: {e}")
|
|
import traceback
|
|
traceback.print_exc()
|
|
sys.exit(1)
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|