# API2PDF — MCP server on mcp.ai > Connect your API2PDF account and use 10 tools for documents straight from your AI agent. Connect with your own API key. Api2Pdf is a REST API that enables developers to generate PDFs from HTML, URLs, and various document formats using engines like wkhtmltopdf, Headless Chrome, and LibreOffice. By: mcp.ai · official Page: https://mcp.ai/api2pdf ## Connect (MCP protocol) Remote MCP endpoint (HTTP, streamable): https://api.mcp.ai/p_api2pdf?ms=1787291460000 Add it as a custom/remote MCP connector, then authenticate when prompted. ## REST API (no MCP client required) Every tool is also a REST endpoint, authed with a workspace API key. Discover: GET https://api.mcp.ai/api/api2pdf/_endpoints # public; lists every endpoint Call: POST https://api.mcp.ai/api/api2pdf/ Authorization: Bearer sk_live_… # create one at https://mcp.ai/settings/api-keys Content-Type: application/json Body: { …args } → { "ok": true, "tool": "", "result": { … } } ## Developer docs How to use (MCP or REST), markdown: https://mcp.ai/api2pdf/skill.md Postman collection (v2.1): https://mcp.ai/api2pdf/postman.json ## Tools - api2pdf_add_header_footer(html: string, options?: object, fileName?: string, inlinePdf?: boolean) — Convert HTML to PDF with customizable headers and footers using Headless Chrome. Use for generating reports, invoices, or documents with consistent page numbering, titles, dates, or branding on every - api2pdf_check_status() — Tool to check the health status of the API2PDF service. Use when you need to verify if the API is available and responding. This endpoint does not require authentication and returns a simple status in - api2pdf_delete_pdf(response_id: string) — Delete a previously generated PDF from API2PDF storage by its response ID. By default, API2PDF automatically deletes PDFs after 24 hours. Use this tool when you need to immediately remove a PDF for se - api2pdf_extract_pages(end?: integer, url: string, start?: integer, inline?: boolean, storage?: object, fileName?: string, extraHTTPHeaders?: object, useCustomStorage?: boolean) — Tool to extract specific pages from a PDF document. Use when you need only certain pages from a larger PDF file. Provide a URL to the source PDF and optionally a page range (0-indexed, end exclusive). - api2pdf_libreoffice_pdf_to_html(url: string, inline?: boolean, fileName?: string) — Tool to convert a PDF document to HTML using LibreOffice. Use when you need HTML output of a PDF file (experimental; images may be excluded). - api2pdf_libreoffice_thumbnail(url: string) — Tool to generate a thumbnail image of a document using LibreOffice. Use when you need a quick visual preview of a PDF or Office file's first page. - api2pdf_merge_pdfs(urls: string[], inline?: boolean, storage?: object, fileName?: string, extraHTTPHeaders?: object, useCustomStorage?: boolean) — Merge multiple PDF documents into a single PDF file. Provide a list of publicly accessible PDF URLs, and they will be combined in the order specified. The merged PDF is available via a download URL fo - api2pdf_optimize_pdf(url: string, inline?: boolean, storage?: object, fileName?: string, extraHTTPHeaders?: object, useCustomStorage?: boolean) — Tool to optimize a PDF document to reduce file size while maintaining quality. Use when you need to minimize storage or bandwidth for an existing PDF. - api2pdf_reorder_pages(url: string, pages: integer[], inline?: boolean, storage?: object, fileName?: string, extraHTTPHeaders?: object, useCustomStorage?: boolean) — Reorder pages of a PDF document by specifying a new page sequence. Provide a URL to the source PDF and a list of zero-based page indices in the desired order. For example, to reverse a 3-page PDF, use - api2pdf_zebra_generate_barcode(value: string, width?: integer, format: string, height?: integer, showlabel?: boolean) — Tool to generate barcodes or QR codes using Zebra Crossing (ZXING). Use when you need a barcode or QR code image from text values. ## Example prompts - "What can I do in API2PDF?" - "Show me a summary of my API2PDF account" ## Links Docs: https://mcp.ai/docs/mcps/api2pdf Website: https://mcp.ai/mcps/api2pdf