About
This project provides an MCP server for 0xPdf, enabling schema-first PDF to structured JSON conversion specifically designed for AI agents. It acts as a wrapper for the 0xPdf HTTP API, preserving its authentication, billing, and rate limiting features. AI agents can leverage this server to parse invoices and forms into a defined JSON schema, generate schemas dynamically, and manage asynchronous parsing jobs.
Key Features
- Schema-First Parsing: Converts PDF documents into structured JSON based on a provided schema.
- AI Agent Integration: Designed to work seamlessly with AI agents like Claude and Cursor.
- 0xPdf API Wrapper: Utilizes the robust 0xPdf HTTP API for core functionality.
- Schema Generation: Supports generating JSON schemas from natural language descriptions using AI.
- Asynchronous Job Processing: Allows agents to submit parsing jobs and poll for completion.
- Tool Support: Includes tools for synchronous and streaming PDF parsing, job management, schema handling, and pricing information.
Installation
Install via pip:
pip install oxpdf-mcp
Or using uvx:
uvx oxpdf-mcp
An API key from 0xpdf.io/dashboard is required.
Configuration for Cursor/Claude Desktop
Configure your MCP settings with the provided JSON structure, including API endpoints, keys, and allowed hosts/file roots.
Environment Variables
Key environment variables include:
- PDF_PARSING_API_KEY: Your API key (required).
- PDF_PARSING_API_BASE_URL: The base URL for the 0xPdf API.
- PDF_PARSING_ALLOWED_API_HOSTS: Hosts allowed for API calls (e.g., api.0xpdf.io).
- PDF_PARSING_REQUIRE_HTTPS: Set to true for production environments.
- PDF_PARSING_ALLOWED_FILE_ROOTS: Specifies allowed directories for PDF files.
SDKs
In addition to the MCP server, official SDKs are available:
- Python: oxpdf
- JavaScript/TypeScript: @0xpdf/client
License
This project is licensed under the MIT License.