MCP Server
Let your AI assistant create professional PDFs directly.
Connect in one line, no API key
The hosted server runs at https://api.pressa.dev/mcp over Streamable HTTP. There is nothing to install and no key to create: with no credentials it exposes compile and the public template tools list_public_templates, get_public_template and render_public_template, with 3 successful PDFs per day (failed attempts do not count). Those PDFs carry a small "Made with Pressa" line at the foot of each page; with an account they do not.
In Claude (claude.ai, the Claude app, Cowork), Pressa is in the connector directory: Add to Claude. Steps for every other AI app are on pressa.dev/connect. In Claude Code:
claude mcp add --transport http pressa https://api.pressa.dev/mcpAny client that supports remote MCP servers takes the same URL. With an API key, send it as an Authorization: Bearer pressa_xxx header: a free key raises the limits, and paid plans add saved templates, the asset library and render.
Claude (claude.ai, the Claude app, Cowork) cannot send that header, so there you sign in instead: the server supports OAuth 2.1. From the directory, Connect signs you in to Pressa right away. Added as a custom connector with "Sign in when needed", it runs keyless until a call needs an account (the free PDFs are used up, or a tool that needs a plan), then Claude shows a Connect button and you sign in. Claude Code can sign in the same way with /mcp.
What is MCP?
The Model Context Protocol (MCP) is an open standard that allows AI assistants to use external tools. Pressa's MCP server gives any compatible AI the ability to compile LaTeX to PDF - the assistant generates the LaTeX, and Pressa handles the compilation.
There are two ways to connect, and neither needs an API key to start: the hosted server above, with nothing to install, or the npm package @pressa/mcp, which runs locally over stdio via npx.
Quick Setup with Claude Desktop
Add to Claude Desktop config
Open your claude_desktop_config.json and add the Pressa server. No API key is needed:
{
"mcpServers": {
"pressa": {
"command": "npx",
"args": ["-y", "@pressa/mcp"]
}
}
}Restart Claude Desktop
Quit and reopen Claude Desktop. The Pressa compile tool will appear in the tool list.
Ask Claude to create a PDF
Just ask naturally: "Create a professional invoice PDF for Acme Corp, invoice #1042, total $2,500." Claude will generate the LaTeX and compile it through Pressa automatically.
Optional: add an API key
Without a key the server starts in anonymous mode and registers compile and the public template tools, with 3 successful compilations per day. A free key raises the limit to 50 compilations per month and allows image assets; it also registers the template, asset and render tools, which need a paid plan to save or render. Create one in your dashboard (keys start with pressa_) and pass it as an environment variable:
{
"mcpServers": {
"pressa": {
"command": "npx",
"args": ["-y", "@pressa/mcp"],
"env": {
"PRESSA_API_KEY": "pressa_your_key_here"
}
}
}
}Setup with Other Tools
Any MCP-compatible AI tool can use the Pressa server. The configuration format is similar across tools.
Cursor
{
"mcpServers": {
"pressa": {
"command": "npx",
"args": ["-y", "@pressa/mcp"]
}
}
}To use a key, add the same env block as in the Claude Desktop example above.
Windsurf
Use the same JSON structure in Windsurf's MCP configuration file. Refer to Windsurf's documentation for the exact file path.
n8n (AI Agent)
No community node is needed. Attach an MCP Client Tool to your AI Agent node and set:
- Endpoint:
https://api.pressa.dev/mcp - Server Transport:
HTTP Streamable - Authentication:
Bearer Auth, with your Pressa API key as the token
The agent writes the LaTeX, calls compile and fixes its own errors from the diagnosis. The tool returns a link to the PDF; to attach it in Gmail or upload it to Google Drive, add an HTTP Request node on that link with Response Format set to File. Use a key: n8n Cloud sends requests from a shared pool of addresses, so keyless calls from every Cloud workflow share one anonymous daily limit. The n8n guide covers the HTTP Request route as well.
Any MCP client
Clients that support remote servers can use https://api.pressa.dev/mcp (Streamable HTTP) directly. Clients that only run local servers can launch npx -y @pressa/mcp (stdio). Neither needs an API key to start. With a key, set PRESSA_API_KEY for the local server, or send an Authorization: Bearer pressa_xxx header to the hosted one.
Available Tools
Without an API key only compile and the three public template tools are registered. The other tools appear once a key is set, because a tool that cannot succeed is worse for the agent than an absent one.
compile
Compiles LaTeX source code to PDF and returns the result URL with metadata.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
latex | string | Yes | The LaTeX source code to compile. |
compiler | string | No | Compiler to use: pdflatex, xelatex, or lualatex. Defaults to pdflatex. |
assets | object | No | Map of filename to base64-encoded binary (PNG, JPG, JPEG, PDF, SVG). Files are written
into the compile workspace so LaTeX can reference them by the same filename (e.g. \includegraphics{logo.png}). Per-plan limits: Free 2/1MB, Starter 5/5MB, Pro 20/25MB, Business 50/75MB (decoded). |
use_stored_assets | array of string | No | Names of assets from the user's persistent library to inject into the
compile workspace. Saves re-uploading the same bytes each compile. Prefer
this over assets when the user reuses the same logo, signature, or letterhead across many
documents. See save_asset and list_assets below. |
Files the user gives you: photo, logo, signature
The bytes should never pass through the model. Base64 that an agent writes out costs about 1.8 tokens per character, so a 30 KB photo is about 75,000 output tokens and a phone photo is millions. Use an upload link instead (paid plans):
- Agent calls
create_asset_uploadwithname: "logo.png". It returns a one-timeupload_urland anupload_command. - An agent with a shell (Claude Code, Cursor, Codex) runs
curl -sS -T ./logo.png '<upload_url>'. An agent without one (claude.ai, Claude Desktop) gives the link to the user, who picks the file on that page. - Every compile passes
use_stored_assets: ["logo.png"]and the LaTeX references\includegraphics{logo.png}. A new upload under the same name replaces the file.
The assets parameter (base64 per compile) and save_asset remain for small files the agent already holds as base64, about 30 KB at most.
Returns
| Field | Type | Description |
|---|---|---|
pdf_url | string | URL to download the compiled PDF. |
pages | number | Number of pages in the generated PDF. |
compilation_time_ms | number | Server-side compilation time in milliseconds. |
render
Render a saved V2 template (one with Liquid placeholders and a schema) by
supplying just the data values - no LaTeX in the call. The data is validated
against the template schema server-side, the compiler is auto-detected from
the source, and stored assets referenced via \includegraphics resolve automatically. Prefer this over compile whenever the same document layout is reused. Paid plans only.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
template | string | Yes | V2 template numeric ID or name (case-insensitive). |
data | object | Yes | Values for the template's placeholders, keyed by placeholder name.
Validation errors return missing_fields and type_errors lists so the agent can fix and retry. Extra keys are ignored. |
Returns the PDF URL with page count, timing, the template name and version that was rendered, and the account's usage block.
save_template
Save or update a LaTeX template. If a template with the same name exists, it gets updated. Paid plans only.
Each template carries the LaTeX layout plus two optional fields with different roles. description is a short human-readable summary surfaced in list_templates for UIs. instructions is a longer prose markdown playbook (up to 50000 chars) the agent reads alongside the LaTeX when filling the template - defaults, workflow rules, edge cases, conditional logic. Use description for humans, use instructions for yourself.
A raw LaTeX template is compiled exactly as saved. A placeholder template marks the values that change with Liquid and is filled with JSON data by render, so the layout never changes. Pass placeholder_engine: "liquid" to save one. A source containing placeholders sent without it is refused with liquid_placeholders_in_v1_template, because raw LaTeX would print the braces literally in the PDF.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Template name. Max 100 characters. |
latex_content | string | For a new template | LaTeX source code for the template. May be omitted when converting the saved source with placeholder_engine "liquid". |
description | string | No | Short human-readable summary. Max 500 characters. |
instructions | string | No | Agent playbook (prose markdown). Defaults, workflow, edge cases, conditional logic. Max 50000 characters. Surfaced again in get_template so you receive layout and rules in a single round trip. |
placeholder_engine | string | No | "liquid": the source has Liquid placeholders filled by render; on an existing raw LaTeX template it converts it in place (same id, name and instructions). "none": raw LaTeX whose braces only look like placeholders. Omit to keep the template's current kind. |
Returns
| Field | Type | Description |
|---|---|---|
id | number | Template ID. |
name | string | Template name. |
created | boolean | True if newly created, false if updated. |
list_templates
List all your saved templates. Takes no parameters. Each row carries a has_instructions boolean so you can see which templates ship with an agent playbook before fetching.
Returns
| Field | Type | Description |
|---|---|---|
templates | array | Array of template objects with id, name, description, updated_at, latex_size_bytes, and has_instructions. The latex_content and instructions bodies are intentionally omitted - call get_template to fetch them. |
get_template
Get a single template by ID or name. Returns the full LaTeX content alongside the instructions playbook (or null if the template has none) so the agent receives layout and rules in a single round trip.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id_or_name | string | Yes | Template ID (numeric) or name (string). |
Returns
| Field | Type | Description |
|---|---|---|
template | object | Template object with id, name, description, latex_content, instructions (string or null), updated_at, and latex_size_bytes. |
delete_template
Delete a template by ID or name.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id_or_name | string | Yes | Template ID (numeric) or name (string). |
Returns
Confirmation message on success.
create_asset_upload
Get a one-time link that saves a file into the user's asset library under name, replacing any file with that name. The link takes the file from curl -T, from curl -F file=@path or from a browser page with a file picker. It expires in 30 minutes and works
for one successful upload; a rejected file (wrong type, over quota) leaves it
usable. Paid plans, except replacing a file the account already has. Files up to
the plan's per-document asset limit (Starter 5 MB, Pro 25 MB, Business 75 MB).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name to store the file under, with its real extension (png, jpg, jpeg, pdf,
svg), e.g. logo.png. |
Returns
upload_url, upload_command, expires_at, max_bytes and next_step. The upload itself answers with the same asset object as save_asset.
save_asset
Save a small file the agent already holds as base64 (about 30 KB at most) to the
user's persistent asset library. Upsert by name. Paid plans only. Reuse it in
any future compile via use_stored_assets: ["name"]. For anything larger, or any file the user sends, use create_asset_upload.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Filename used to reference the asset from LaTeX (e.g. logo.png). Max 64 chars; extensions limited to png/jpg/jpeg/pdf/svg. |
content_base64 | string | Yes | Base64-encoded file bytes. Magic bytes verified server-side. |
content_type | string | No | MIME type. Inferred from the filename extension if omitted. |
Returns
| Field | Type | Description |
|---|---|---|
asset | object | Asset object with id, name, content_type, size_bytes, sha256, updated_at. |
created | boolean | True if newly created, false if an existing asset was updated. |
list_assets
List all assets in the user's library. Takes no parameters. Use to discover
names available for use_stored_assets or before uploading a replacement.
Returns
| Field | Type | Description |
|---|---|---|
assets | array | Array of asset objects with id, name, content_type, size_bytes, sha256, updated_at. |
count | number | Number of stored assets. |
total_bytes | number | Sum of decoded sizes across all assets. |
count_limit | number | null | Per-plan asset count cap. null when unlimited (Business). |
total_bytes_limit | number | Per-plan total bytes cap (Starter 50 MB, Pro 500 MB, Business 5 GB). |
remaining_bytes | number | total_bytes_limit - total_bytes. Useful for deciding whether to upload a new asset. |
get_asset
Fetch a single asset's metadata plus its base64-encoded content. Accepts either numeric ID or filename.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id_or_name | string | Yes | Asset ID (numeric) or name (string). |
Returns
| Field | Type | Description |
|---|---|---|
asset | object | Asset object with id, name, content_type, size_bytes, sha256, updated_at,
and content_base64 (base64-encoded full bytes). |
delete_asset
Delete an asset by ID or name. The database row and the underlying bytes are
both removed. Future compiles referencing the deleted name via use_stored_assets will fail with asset_not_found.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id_or_name | string | Yes | Asset ID (numeric) or name (string). |
Returns
Confirmation message on success.
usage
Returns your current plan, compilation usage and plan limits. Takes no parameters. Requires an API key.
Returns
| Field | Type | Description |
|---|---|---|
user.plan | string | Current plan name (e.g. "free", "pro"). |
usage.compilations_this_month | number | Successful compilations counted this month. |
usage.monthly_limit | number | Compilations allowed per month on your plan. |
usage.remaining | number | Compilations left this month. |
usage.resets_at | string | ISO 8601 time when the monthly counter resets. |
limits | object | Per-document limits for your plan: pages, source size, PDF size, assets, timeout and allowed compilers. |
templates, stored_assets | object | Counts and limits for saved templates and stored assets. |
list_public_templates, get_public_template, render_public_template
The ready-made templates from the template gallery (invoices, purchase orders, packing slips, delivery notes, receipts, reports, certificates, resumes and cover letters). They work without an API key, like compile, and a render counts as one compilation.
list_public_templateslists the templates with a summary and a preview image each. Takes no parameters.get_public_templatereturns one template's fields (JSON schema), sample data, filling instructions and source.render_public_templatefills the template with your data and returns a PDF link. A missing field comes back as a list of what to ask for and costs nothing. Designs of one document (the five resume designs) take the same data, and the optional color prints a design in another of its colours.
| Parameter | Type | Required | Description |
|---|---|---|---|
template | string | Yes | get_public_template and render_public_template: the slug, e.g. invoice or packing-slip. |
data | object | Yes | render_public_template only: values shaped like the template's sample data. |
color | string | No | render_public_template only: one of the template's colours from the list, e.g. navy. |
Environment Variables
| Variable | Required | Description |
|---|---|---|
PRESSA_API_KEY | No | Your Pressa API key (starts with pressa_). Without it the server starts in anonymous mode and registers only compile and the public template tools. |
PRESSA_API_URL | No | API base URL. Defaults to https://api.pressa.dev. |
How it works
When you ask your AI assistant to create a document, here is what happens behind the scenes:
- The AI understands your request and generates LaTeX source code.
- It calls the
compiletool, passing the LaTeX to the Pressa MCP server. - The MCP server sends the LaTeX to Pressa's API, which compiles it on the server.
- Pressa returns a PDF URL. The AI shares the link with you.
The entire process takes a few seconds. You never need to install LaTeX, write LaTeX yourself, or leave your AI tool.