# MCP server

Source: https://smartpdf.ru/en/developers/docs/mcp

The SmartPDF MCP server gives an AI agent 47 PDF and image operations plus a balance check — the agent picks the operation based on your request. The key and balance are the same as for the REST API.

## Connection

| | |
|---|---|
| URL | `https://mcp.smartpdf.ru/mcp` |
| Transport | Streamable HTTP, no sessions |
| Key | `Authorization: Bearer sk_live_…` or `X-API-Key: sk_live_…` |

A key in the URL (`?token=`) isn’t accepted: the MCP specification forbids it, and URLs end up in logs. The tool list (`tools/list`) is available without a key; calling a tool without a key returns an error with a link to the dashboard.

Step-by-step guides: [Claude Code](https://smartpdf.ru/en/developers/docs/claude-code), [Claude Desktop](https://smartpdf.ru/en/developers/docs/claude-desktop), [Cursor](https://smartpdf.ru/en/developers/docs/cursor), [VS Code](https://smartpdf.ru/en/developers/docs/vscode), [Codex CLI](https://smartpdf.ru/en/developers/docs/codex), [Gemini CLI](https://smartpdf.ru/en/developers/docs/gemini), [Windsurf and Cline](https://smartpdf.ru/en/developers/docs/other-clients), [n8n](https://smartpdf.ru/en/developers/docs/n8n), [Make](https://smartpdf.ru/en/developers/docs/make).

## How the agent works with files

The tools accept a **public link** to a file (`file_url`, up to 100 MB) and return a link to the result (`download_url`) with an expiry time (`expires_at`). The agent first uploads a file from your computer via the REST API — see [Passing files](https://smartpdf.ru/en/developers/docs/files).

## Tools

| Tool | What it does | REST |
|---|---|---|
| `word_to_pdf` | Word to PDF | `POST /v1/pdf/word-to-pdf` |
| `jpg_to_pdf` | JPG to PDF | `POST /v1/pdf/jpg-to-pdf` |
| `photo_to_pdf` | Photo to PDF | `POST /v1/pdf/photo-to-pdf` |
| `xlsx_to_pdf` | Excel to PDF | `POST /v1/pdf/xlsx-to-pdf` |
| `pptx_to_pdf` | PowerPoint to PDF | `POST /v1/pdf/pptx-to-pdf` |
| `djvu_to_pdf` | DjVu to PDF | `POST /v1/pdf/djvu-to-pdf` |
| `fb2_to_pdf` | FB2 to PDF | `POST /v1/pdf/fb2-to-pdf` |
| `epub_to_pdf` | EPUB to PDF | `POST /v1/pdf/epub-to-pdf` |
| `html_to_pdf` | HTML to PDF | `POST /v1/pdf/html-to-pdf` |
| `pdf_to_word` | PDF to Word | `POST /v1/pdf/to-word` |
| `pdf_to_jpg` | PDF to JPG | `POST /v1/pdf/to-jpg` |
| `pdf_to_png` | PDF to PNG | `POST /v1/pdf/to-png` |
| `pdf_to_excel` | PDF to Excel | `POST /v1/pdf/to-excel` |
| `pdf_to_pptx` | PDF to PowerPoint | `POST /v1/pdf/to-pptx` |
| `pdf_to_markdown` | PDF to Markdown | `POST /v1/pdf/to-markdown` |
| `pdf_to_txt` | PDF to text | `POST /v1/pdf/to-txt` |
| `compress_image` | Compress image | `POST /v1/pdf/compress-image` |
| `heic_to_jpg` | HEIC to JPG | `POST /v1/pdf/heic-to-jpg` |
| `image_to_text` | Image to text | `POST /v1/pdf/image-to-text` |
| `png_to_jpg` | PNG to JPG | `POST /v1/pdf/png-to-jpg` |
| `jpg_to_png` | JPG to PNG | `POST /v1/pdf/jpg-to-png` |
| `webp_to_jpg` | WEBP to JPG | `POST /v1/pdf/webp-to-jpg` |
| `resize_image` | Resize image | `POST /v1/pdf/resize-image` |
| `crop_image` | Crop image | `POST /v1/pdf/crop-image` |
| `rotate_image` | Rotate image | `POST /v1/pdf/rotate-image` |
| `word_to_jpg` | Word to JPG | `POST /v1/pdf/word-to-jpg` |
| `edit_pdf` | PDF editor | `POST /v1/pdf/edit` |
| `compress_pdf` | Compress PDF | `POST /v1/pdf/compress` |
| `grayscale_pdf` | Grayscale PDF | `POST /v1/pdf/grayscale` |
| `pdf_to_pdfa` | PDF to PDF/A | `POST /v1/pdf/to-pdfa` |
| `repair_pdf` | Repair PDF | `POST /v1/pdf/repair` |
| `merge_pdfs` | Merge PDF | `POST /v1/pdf/merge` |
| `split_pdf` | Split PDF | `POST /v1/pdf/split` |
| `ocr_pdf` | OCR PDF | `POST /v1/pdf/ocr` |
| `flatten_pdf` | Flatten PDF | `POST /v1/pdf/flatten` |
| `delete_pages` | Delete pages | `POST /v1/pdf/delete-pages` |
| `crop_pdf` | Crop PDF | `POST /v1/pdf/crop` |
| `extract_pages` | Extract pages | `POST /v1/pdf/extract-pages` |
| `rotate_pdf` | Rotate pages | `POST /v1/pdf/rotate` |
| `reorder_pages` | Reorder pages | `POST /v1/pdf/reorder-pages` |
| `add_page_numbers` | Add page numbers | `POST /v1/pdf/add-page-numbers` |
| `sign_pdf` | Sign PDF | `POST /v1/pdf/sign` |
| `protect_pdf` | Protect PDF | `POST /v1/pdf/protect` |
| `unlock_pdf` | Unlock PDF | `POST /v1/pdf/unlock` |
| `redact_pdf` | Redact personal data | `POST /v1/pdf/redact` |
| `find_personal_data` | Find personal data | `POST /v1/pdf/find-personal-data` |
| `watermark_pdf` | Add watermark | `POST /v1/pdf/watermark` |
| `get_balance` | API balance, spending this month and the request price | `GET /v1/api-keys/balance` |

The agent gets each tool’s parameters from the server — they’re the same as in REST, but with a link to the file instead of `file_id`.

## Pricing

Each tool call is an API request at the same price ([Billing](https://smartpdf.ru/en/developers/docs/billing)). `get_balance` shows the remaining balance and the request price. If there isn’t enough money, the agent gets an error with an explanation.

## Example prompts for the agent

- “Compress the PDFs at these links and send me links to the results”
- “Recognize the text in the contract scan and turn it into a Word document”
- “Merge the three invoices into one PDF and number the pages”
- “Add a ‘COPY’ watermark to all pages”
- “How much is left on my SmartPDF balance?”
