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 the compile tool, with 3 successful compilations per day (failed attempts do not count). In Claude Code:

Terminal
claude mcp add --transport http pressa https://api.pressa.dev/mcp

Any 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.

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

1

Add to Claude Desktop config

Open your claude_desktop_config.json and add the Pressa server. No API key is needed:

claude_desktop_config.json
{
"mcpServers": {
"pressa": {
"command": "npx",
"args": ["-y", "@pressa/mcp"]
}
}
}
2

Restart Claude Desktop

Quit and reopen Claude Desktop. The Pressa compile tool will appear in the tool list.

3

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 only compile, 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:

claude_desktop_config.json
{
"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

.cursor/mcp.json
{
"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 is 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

ParameterTypeRequiredDescription
latexstringYesThe LaTeX source code to compile.
compilerstringNoCompiler to use: pdflatex, xelatex, or lualatex. Defaults to pdflatex.
assetsobjectNoMap 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_assetsarray of stringNoNames 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.

Example: extracting a logo from a PDF and including it

Typical AI workflow when the user uploads a PDF that contains images:

  1. Agent reads the PDF and extracts the logo as PNG bytes.
  2. Agent base64-encodes the PNG.
  3. Agent calls compile with assets: { "logo.png": "iVBORw0..." } and generated LaTeX that references \includegraphics{logo.png}.
  4. Pressa compiles the PDF with the real logo embedded.

Save once, reuse many

If the user will reuse the same logo across many future compiles (monthly invoices, repeat contracts, recurring reports), save it to the library once instead of re-encoding the bytes every compile:

  1. Agent calls save_asset with the base64-encoded logo bytes, name logo.png. Returns .
  2. Every future compile passes use_stored_assets: ["logo.png"] instead of re-uploading the bytes. The LaTeX still references \includegraphics{logo.png} normally - the server loads the bytes from storage.
  3. When the user wants to see or refresh what's saved, call list_assets. When they change brand, call save_asset again with the same name to upsert.

Returns

FieldTypeDescription
pdf_urlstringURL to download the compiled PDF.
pagesnumberNumber of pages in the generated PDF.
compilation_time_msnumberServer-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

ParameterTypeRequiredDescription
templatestringYesV2 template numeric ID or name (case-insensitive).
dataobjectYesValues 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.

Parameters

ParameterTypeRequiredDescription
namestringYesTemplate name. Max 100 characters.
latex_contentstringYesLaTeX source code for the template.
descriptionstringNoShort human-readable summary. Max 500 characters.
instructionsstringNoAgent 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.

Returns

FieldTypeDescription
idnumberTemplate ID.
namestringTemplate name.
createdbooleanTrue 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

FieldTypeDescription
templatesarrayArray 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

ParameterTypeRequiredDescription
id_or_namestringYesTemplate ID (numeric) or name (string).

Returns

FieldTypeDescription
templateobjectTemplate 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

ParameterTypeRequiredDescription
id_or_namestringYesTemplate ID (numeric) or name (string).

Returns

Confirmation message on success.

save_asset

Upload a binary file (logo, signature, diagram, embedded PDF) to the user's persistent asset library. Upsert by name. Paid plans only. Reuse the saved asset in any future compile via use_stored_assets: ["name"] - no need to re-encode bytes each time.

Parameters

ParameterTypeRequiredDescription
namestringYesFilename used to reference the asset from LaTeX (e.g. logo.png). Max 64 chars; extensions limited to png/jpg/jpeg/pdf/svg.
content_base64stringYesBase64-encoded file bytes. Magic bytes verified server-side.
content_typestringNoMIME type. Inferred from the filename extension if omitted.

Returns

FieldTypeDescription
assetobjectAsset object with id, name, content_type, size_bytes, sha256, updated_at.
createdbooleanTrue 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

FieldTypeDescription
assetsarrayArray of asset objects with id, name, content_type, size_bytes, sha256, updated_at.
countnumberNumber of stored assets.
total_bytesnumberSum of decoded sizes across all assets.
count_limitnumber | nullPer-plan asset count cap. null when unlimited (Business).
total_bytes_limitnumberPer-plan total bytes cap (Starter 50 MB, Pro 500 MB, Business 5 GB).
remaining_bytesnumbertotal_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

ParameterTypeRequiredDescription
id_or_namestringYesAsset ID (numeric) or name (string).

Returns

FieldTypeDescription
assetobjectAsset 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

ParameterTypeRequiredDescription
id_or_namestringYesAsset 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

FieldTypeDescription
user.planstringCurrent plan name (e.g. "free", "pro").
usage.compilations_this_monthnumberSuccessful compilations counted this month.
usage.monthly_limitnumberCompilations allowed per month on your plan.
usage.remainingnumberCompilations left this month.
usage.resets_atstringISO 8601 time when the monthly counter resets.
limitsobjectPer-document limits for your plan: pages, source size, PDF size, assets, timeout and allowed compilers.
templates, stored_assetsobjectCounts and limits for saved templates and stored assets.

Environment Variables

VariableRequiredDescription
PRESSA_API_KEYNoYour Pressa API key (starts with pressa_). Without it the server starts in anonymous mode and registers only compile.
PRESSA_API_URLNoAPI 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:

  1. The AI understands your request and generates LaTeX source code.
  2. It calls the compile tool, passing the LaTeX to the Pressa MCP server.
  3. The MCP server sends the LaTeX to Pressa's API, which compiles it on the server.
  4. 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.