Skip to main content

PDF Reader MCP Server

License: MIT Python 3.11+ PyPI version

A powerful Model Context Protocol (MCP) server that provides comprehensive PDF processing capabilities, including text extraction, OCR support, and network diagram detection. Designed to work seamlessly with Amazon Q Developer CLI and other MCP-compatible systems.

🚀 Features

  • Text Extraction: Extract text content from PDF files with high accuracy
  • PDF Analysis: Get comprehensive metadata (pages, document info, encryption status)
  • Page-Specific Processing: Extract text from specific pages
  • Multi-Language OCR: Support for Thai and English text recognition
  • Smart Processing: Automatically chooses between OCR and direct text extraction
  • Markdown Conversion: Convert PDF content to clean markdown format
  • Document Analysis: Determine if PDFs are scanned images or searchable text
  • Network Diagram Detection: Advanced capability to detect and extract network diagrams
  • MCP Integration: Seamless integration with Amazon Q Developer CLI

📦 Installation

The easiest way to use this MCP server is with uvx:

# Run directly without installation
uvx pdf-reader-mcp # your mcp client can now connect using both sse and stdio transport

# Or install globally
uvx install pdf-reader-mcp

Using pip

pip install pdf-reader-mcp

From Source

git clone https://github.com/zixma13/pdf-reader-mcp.git
cd pdf-reader-mcp
pip install -e .

📋 Prerequisites

  1. Install Tesseract OCR (required for OCR functionality):

    # For macOS
    brew install tesseract
    brew install tesseract-lang  # For language support including Thai
    
    # For Ubuntu/Debian
    # sudo apt-get install tesseract-ocr
    # sudo apt-get install tesseract-ocr-tha  # For Thai language support
    
  2. Install Python dependencies:

    pip install -r requirements.txt
    
  3. Ensure you have the virtual environment activated:

    source .venv/bin/activate
    
  4. Test the server:

    mcp dev main.py
    

Configuration for Amazon Q Developer CLI

Add the following to your ~/.aws/amazonq/mcp.json file:

  • in case you clone the git repository
{
  "mcpServers": {
    "pdf_reader": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/your/pdf_reader/pdf_reader",
        "run",
        "main.py"
      ]
    }
  }
}
  • in case you use uvx
{
  "mcpServers": {
    "pdf_reader": {
      "command": "uvx",
      "timeout": 60000,
      "args": [
        "pdf-reader-mcp"
      ]
    }
  }
}

Usage Examples

Once configured, you can use the PDF reader tools in Amazon Q:

Basic PDF Processing

  • To analyze a PDF and determine if it's a scanned image or searchable text:

    pdf_reader___analyze_pdf("/path/to/document.pdf")
    
  • To intelligently extract content from a PDF (automatically choosing between OCR and text extraction):

    pdf_reader___smart_extract_pdf("/path/to/document.pdf")
    
  • To intelligently convert a PDF to markdown:

    pdf_reader___smart_pdf_to_markdown("/path/to/document.pdf")
    
  • To extract text from a PDF:

    pdf_reader___read_pdf("/path/to/document.pdf")
    
  • To get metadata from a PDF:

    pdf_reader___get_pdf_metadata("/path/to/document.pdf")
    
  • To extract text from a specific page (0-indexed):

    pdf_reader___extract_pdf_page("/path/to/document.pdf", 0)
    
  • To extract text using OCR (supports Thai and English):

    pdf_reader___ocr_pdf("/path/to/document.pdf")
    
  • To extract text from a specific page using OCR:

    pdf_reader___ocr_pdf_page("/path/to/document.pdf", 0)
    
  • To convert PDF to markdown format:

    pdf_reader___pdf_to_markdown("/path/to/document.pdf")
    
  • To convert PDF to markdown format using OCR:

    pdf_reader___pdf_to_markdown("/path/to/document.pdf", use_ocr=True)
    

Metadata

Release files for pdf-reader-mcp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pdf-reader-mcp 0.1.1
File Size Uploaded Provenance Actions
pdf_reader_mcp-0.1.1.tar.gz 7.6 kB Without provenance Details for pdf_reader_mcp-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pdf-reader-mcp 0.1.1
File Interpreter ABI Platform Actions
pdf_reader_mcp-0.1.1-py3-none-any.whl Python 3 none any Details for pdf_reader_mcp-0.1.1-py3-none-any.whl

Total release size: 15.5 kB

Release files / pdf_reader_mcp-0.1.1.tar.gz

Download URL pdf_reader_mcp-0.1.1.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e9ca1086f458c16c2015f3050d54d1a32f6f34fcbbf89992e6f69d57d6c850e9
BLAKE2b-256 checksum
How to use checksums
6e5400e5405992ed526971512bcd7babf2e7b268cc71c24b047efdd41a3b2c6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.12

Release files / pdf_reader_mcp-0.1.1-py3-none-any.whl

Download URL pdf_reader_mcp-0.1.1-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d43e6ab4218ac3608e2671c2faa3968671319ef2e3f4d9cdf958a3d782333f2
BLAKE2b-256 checksum
How to use checksums
a2e3a0fb6e24f1cd21c9c5e5682313def33ba6f507c1d9158901fbc08c043414
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.12

Security for pdf-reader-mcp 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page