# Pdf4me — how to use (mcp.ai)

Connect your Pdf4me account and use 4 tools for documents straight from your AI agent. Connect with your own API key. PDF4me provides robust, secure, and scalable APIs for document generation, manipulation, and management, enabling easy integration and automation across various applications.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_pdf4me?ms=1787291280000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `pdf4me_convert_to_pdf`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/pdf4me`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/pdf4me/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/pdf4me/convert/to/pdf` — Tool to convert various document and image formats to PDF. Handles one file per call; multi-file PDFs require multiple calls followed by a separate merge step. Conversion permanently removes interacti
  - body: { document: object, pdfConvertActions?: object[] }
- `POST https://api.mcp.ai/api/pdf4me/extract/text` — Tool to extract embedded text from text-based PDFs using PDF4me's ExtractResources endpoint. Use when you need to retrieve searchable text content from PDFs for analysis or processing. This tool does 
  - body: { docData: string, docName: string }
- `POST https://api.mcp.ai/api/pdf4me/fill/pdf/form` — Tool to fill PDF form fields programmatically using JSON or XML data. Use when you need to generate reports or populate forms from various data sources with mail merge functionality. Supports filling 
  - body: { metaData?: string, dataArray: string, outputType: string, metaDataJson?: string, InputFormData: object[], inputDataType: string, templateDocName: string, templateDocContent: string }
- `POST https://api.mcp.ai/api/pdf4me/read/barcodes/from/image` — Tool to read and extract barcode or QR code data from image files (JPG/PNG). Use when you need to decode barcodes from images for data extraction or verification. Supports various barcode types includ
  - body: { docName: string, imageType: string, docContent: string }

## Example prompts
- "What can I do in Pdf4me?"
- "Show me a summary of my Pdf4me account"

## More
- Page: https://mcp.ai/pdf4me
- Agent spec (llms.txt): https://mcp.ai/pdf4me/llms.txt
- Postman collection: https://mcp.ai/pdf4me/postman.json
