Skip to main content
Glama

PDF Reader MCP Server

by pablontiv

PDF Reader MCP Server

A Model Context Protocol (MCP) server for extracting and processing content from PDF documents. This server provides secure, efficient, and flexible PDF content extraction capabilities following the MCP specification.

Features

  • Text Extraction: Extract plain text from PDF documents with formatting preservation
  • Metadata Extraction: Extract document metadata (title, author, dates, page count, etc.)
  • Page-Level Processing: Extract content from specific pages or page ranges
  • PDF Validation: Validate PDF file integrity and readability
  • Security-First: Input validation and sandboxed processing
  • Type-Safe: Full TypeScript implementation with comprehensive type definitions

Installation

npm install npm run build

Usage

As MCP Server

Start the server:

npm start

Available Tools

1. extract_pdf_text

Extract text content from PDF documents.

Parameters:

  • file_path (required): Path to the PDF file
  • pages (optional): Page range ("1-5", "1,3,5", or "all")
  • preserve_formatting (optional): Whether to preserve text formatting
  • include_metadata (optional): Whether to include document metadata
2. extract_pdf_metadata

Extract metadata and document information from PDF files.

Parameters:

  • file_path (required): Path to the PDF file
3. extract_pdf_pages

Extract content from specific pages or page ranges.

Parameters:

  • file_path (required): Path to the PDF file
  • page_range (required): Page range to extract
  • output_format (optional): "text" or "structured"
4. validate_pdf

Validate PDF file integrity and readability.

Parameters:

  • file_path (required): Path to the PDF file

Configuration

Environment variables:

  • PDF_MAX_FILE_SIZE: Maximum file size in bytes (default: 104857600 = 100MB)
  • PDF_PROCESSING_TIMEOUT: Processing timeout in milliseconds (default: 60000)
  • PDF_MAX_MEMORY_USAGE: Maximum memory usage in bytes (default: 524288000 = 500MB)
  • LOG_LEVEL: Logging level (default: 'info')

Security

  • Input validation for all file paths
  • Directory traversal protection
  • File size and memory limits
  • Processing timeouts
  • No temporary file persistence

Error Handling

The server provides comprehensive error handling with specific error codes:

  • -32602: Validation errors
  • -32603: File access errors
  • -32604: Size/resource errors
  • -32605: Format errors

Performance

  • Supports files up to 100MB
  • Memory usage limited to 500MB
  • Concurrent processing support
  • Optimized for text-based PDFs

License

MIT

-
security - not tested
F
license - not found
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

A Model Context Protocol server that extracts and processes content from PDF documents, providing text extraction, metadata retrieval, page-level processing, and PDF validation capabilities.

  1. Features
    1. Installation
      1. Usage
        1. As MCP Server
        2. Available Tools
      2. Configuration
        1. Security
          1. Error Handling
            1. Performance
              1. License

                Related MCP Servers

                • A
                  security
                  F
                  license
                  A
                  quality
                  A Model Context Protocol server that converts PDF documents into PNG images through a simple MCP tool call.
                  Last updated -
                  1
                  5
                  Python
                  • Apple
                  • Linux
                • -
                  security
                  A
                  license
                  -
                  quality
                  A server that provides document processing capabilities using the Model Context Protocol, allowing conversion of documents to markdown, extraction of tables, and processing of document images.
                  Last updated -
                  13
                  Python
                  MIT License
                  • Linux
                  • Apple
                • -
                  security
                  F
                  license
                  -
                  quality
                  A PDF processing server that extracts text via normal parsing or OCR, and retrieves images from PDF files through the MCP protocol with a built-in web debugger.
                  Last updated -
                  26
                  Python
                • -
                  security
                  A
                  license
                  -
                  quality
                  A Model Context Protocol (MCP) based server that efficiently manages PDF files, allowing AI coding tools like Cursor to read, summarize, and extract information from PDF datasheets to assist embedded development work.
                  Last updated -
                  6
                  Apache 2.0

                View all related MCP servers

                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/pablontiv/pdf-reader-mcp'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server