# DocRaptor — how to use (mcp.ai)

Connect your DocRaptor account and use 10 tools for developer tools straight from your AI agent. Connect with your own API key. The best and easiest HTML-to-PDF API.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_docraptor?ms=1787296020000`
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. `docraptor_create_async_doc`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/docraptor`
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/docraptor/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/docraptor/create/async/doc` — Tool to create documents asynchronously from HTML content. Use when generating PDF, XLS, or XLSX documents and you need to poll for completion status or use a callback URL for notification. Returns a 
  - body: { tag?: string, help?: boolean, name: string, test?: boolean, strict?: string, pipeline?: string, referrer?: string, javascript?: boolean, callback_url?: string, document_url?: string, document_type: string, prince_options?: object, document_content?: string, hosted_expires_at?: string, hosted_download_limit?: integer, ignore_resource_errors?: boolean, ignore_console_messages?: boolean }
- `POST https://api.mcp.ai/api/docraptor/create/doc` — Tool to create a PDF or Excel document synchronously from HTML content or URL. Use when you need to generate a document file from HTML data. The document is returned immediately as a downloadable file
  - body: { tag?: string, help?: boolean, name: string, test?: boolean, strict?: string, pipeline?: string, referrer?: string, javascript?: boolean, callback_url?: string, document_url?: string, document_type: string, prince_options?: object, document_content?: string, hosted_expires_at?: string, hosted_download_limit?: integer, ignore_resource_errors?: boolean, ignore_console_messages?: boolean }
- `POST https://api.mcp.ai/api/docraptor/create/document/from/referrer` — Tool to convert webpages into documents using referrer-based authentication without an API key. Use when you need to generate PDFs or Excel files from registered domains without explicit API credentia
  - body: { name?: string, type?: string, javascript?: boolean, prince_option_media?: string }
- `POST https://api.mcp.ai/api/docraptor/create/hosted/async/doc` — Tool to create a hosted document asynchronously. Use when you need to generate a PDF, XLS, or XLSX document and track its completion status via callback_url or the status API.
  - body: { tag?: string, help?: boolean, name: string, test?: boolean, strict?: string, pipeline?: string, referrer?: string, javascript?: boolean, callback_url?: string, document_url?: string, document_type: string, prince_options?: object, document_content?: string, hosted_expires_at?: string, hosted_download_limit?: integer, ignore_resource_errors?: boolean, ignore_console_messages?: boolean }
- `POST https://api.mcp.ai/api/docraptor/get/async/doc` — Tool to download a completed asynchronous document using the download URL from status response. Use when you have a download_id and need to retrieve the generated document file.
  - body: { id: string }
- `POST https://api.mcp.ai/api/docraptor/get/async/doc/status` — Tool to check the status of an asynchronously created document. Use when monitoring progress of async documents by polling for completion status.
  - body: { id: string }
- `POST https://api.mcp.ai/api/docraptor/list/documents/json` — Tool to retrieve a paginated list of previously created documents with metadata in JSON format. Use when you need to see document creation history or query past documents.
  - body: { page?: integer, per_page?: integer }
- `POST https://api.mcp.ai/api/docraptor/list/documents/xml` — Tool to retrieve a paginated list of previously created documents with metadata in XML format. Use when you need to see document creation history or query past documents in XML format.
  - body: { page?: integer, per_page?: integer }
- `POST https://api.mcp.ai/api/docraptor/list/ips/json` — Tool to get list of IP addresses that DocRaptor uses to download assets. Use when you need to know which IPs DocRaptor uses for asset downloading. Note: Using IPs for securing assets is not recommende
- `POST https://api.mcp.ai/api/docraptor/list/ips/text` — Tool to retrieve a list of IP addresses that DocRaptor uses to download assets in plain text format. Use when you need to identify DocRaptor's IP addresses for network configuration or security purpos

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

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