Pressa - LaTeX to PDF

io.github.pressa-dev由 GitHub 账号 pressa-dev 发布v0.11.4更新于 Oct 30, 2026

Compile LaTeX to PDF without installing TeX Live. No API key needed to start.

已验证Streamable HTTP可网页运行效率与工作流文件与存储开发者工具

概览

AI 生成的概览

把 LaTeX 源码编译成 PDF,并可套用专业文档模板,让助手无需本地 TeX 环境即可产出 PDF。

可以做什么
  • 编译 LaTeX 源码生成 PDF,返回 PDF 链接、页数与编译耗时
  • 列出、查看并填写公开模板,涵盖发票、采购单、收据、报告、证书、简历与求职信
  • 保存、列出、获取和删除自建 LaTeX 模板,包括带助手说明的 Liquid 占位符模板
  • 查询 API 用量与本月剩余编译次数
适用场景
当用户需要 PDF 文档而本机没有 pdflatex 或 TeX Live 时,或需要用用户数据填写现成的商务、简历类模板时使用。
运行要求
可使用托管端点,或通过 npx 运行 npm 包(需 Node.js)。匿名模式无需密钥;可选的 PRESSA_API_KEY 环境变量(托管服务上为 Authorization Bearer 头)可提高限额并解锁已保存模板相关工具。需要能访问 Pressa API 的网络。
安装前请注意
匿名模式仅支持 pdflatex,最多 3 页、30 KB 源码、不支持图片资源,PDF 链接 1 小时后失效。文档源码与模板数据会发送给第三方服务。模板工具可覆盖或删除已保存模板,部分编译器与功能需付费套餐。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Pressa - LaTeX to PDF,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.pressa-dev%2Fpressa/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "pressa-latex-to-pdf": {
      "type": "http",
      "url": "https://api.pressa.dev/mcp"
    }
  }
}

README

@pressa/mcp

MCP (Model Context Protocol) server for Pressa - LaTeX in, publication-quality PDF out. This server lets AI assistants compile documents through a standardized interface.

No API key required to start. Add the server, ask for a PDF, get one. A key raises the limits later.

Setup

Add this to your MCP client configuration (e.g. Claude Desktop, Cursor):

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

That is the whole configuration. The server starts in anonymous mode and exposes the compile tool and the public template gallery, which work with no credentials: 3 successful PDFs per day, and failed attempts do not count against that, so an assistant can iterate on its LaTeX for free.

To unlock the rest, add a key:

json
{  "mcpServers": {    "pressa": {      "command": "npx",      "args": ["-y", "@pressa/mcp"],      "env": {        "PRESSA_API_KEY": "pressa_your_key_here"      }    }  }}

Get a free key at pressa.dev. Takes about 30 seconds, no credit card. It raises the limit to 50 compilations per month and registers the template, asset and render tools.

Hosted server (no install)

The same tools are also served over Streamable HTTP at https://api.pressa.dev/mcp, so a client that supports remote MCP servers needs no Node.js and no local process:

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

Keyless, it exposes compile and the public template gallery (list_public_templates, get_public_template, render_public_template). Send an Authorization: Bearer <key> header to register the template, asset and render tools as well.

Environment Variables

VariableRequiredDefaultDescription
PRESSA_API_KEYNo-Pressa API key (starts with pressa_). Without it the server runs in anonymous mode and exposes only compile and the public template tools.
PRESSA_API_URLNohttps://api.pressa.devAPI base URL

Anonymous mode

With no PRESSA_API_KEY set, the server starts anyway rather than refusing to run, and registers only the tools that work without an account: compile, list_public_templates, get_public_template and render_public_template. Tools that need an account are not registered at all, because a tool that cannot succeed is worse than an absent one.

Anonymous limits: pdflatex only, up to 3 pages, 30 KB of source, no image assets, and PDF links that expire after 1 hour.

Error handling

Compilation failures return a structured diagnosis rather than a raw TeX log: the error class, the offending command, and a concrete suggested fix (often a missing \usepackage). An assistant is expected to apply the fix and retry on its own instead of showing the user a compiler log.

Tools

compile

Compile LaTeX source code into a PDF.

Input:

ParameterTypeRequiredDescription
latexstringYesComplete LaTeX source code. Must contain \documentclass, \begin{document}, \input{}, or \include{}. Plain text, markdown, or raw notes are rejected with not_latex_source (422). The AI agent should generate LaTeX itself, not bounce back to the user.
compilerstringNo"pdflatex" (default), "xelatex", or "lualatex" (Pro and Business plans only)

Each plan has limits on pages per document, LaTeX source size, PDF output size, and compile timeout. If a compile exceeds your plan's page limit, the document does not count against your monthly quota and the MCP response includes the limit and an upgrade URL. Non-LaTeX input is rejected with a structured requirements list and an example_template so the LLM can self-correct without user intervention.

Output (success):

json
{  "job_id": "ffc2bd62-3b67-45d6-be14-b529c4b9489f",  "pdf_url": "https://api.pressa.dev/api/v1/pdfs/ffc2bd62...?sig=xxx&exp=xxx",  "expires_at": "2026-04-09T20:44:55Z",  "pages": 1,  "compilation_time_ms": 359,  "usage": {    "plan": "free",    "compilations_this_month": 9,    "monthly_limit": 50  }}

Output (error): Compilation log and error line number.

list_public_templates, get_public_template, render_public_template

Pressa's public document templates (pressa.dev/templates): invoices, purchase orders, packing slips, delivery notes, receipts, reports, certificates, resumes and cover letters. No key needed.

  • list_public_templates: every template with a summary, a preview image URL and its colours. Designs of one document (document, e.g. five resume designs) take the same data.
  • get_public_template (template: slug): the fields (JSON schema), sample data and filling instructions.
  • render_public_template (template: slug, data: object shaped like the sample, optional color): fills the template and returns pdf_url. A field that is missing or of the wrong type comes back as a list to fix, at no cost.

Each template also has plain instructions for assistants at https://pressa.dev/templates/<slug>/agent.md.

usage

Get current API usage statistics.

Input: None.

Output:

json
{  "user": {    "email": "[email protected]",    "username": "user",    "plan": "free"  },  "usage": {    "compilations_this_month": 9,    "monthly_limit": 50,    "remaining": 41,    "resets_at": "2026-04-30T23:59:59Z"  },  "api_key": {    "prefix": "pressa_a",    "name": "my-key",    "total_requests": 15,    "last_used_at": "2026-04-08T20:44:55Z"  }}

save_template

Save or update a LaTeX template by name. Paid plans only. Upserts: a second call with the same name overwrites the first.

ParameterTypeRequiredDescription
namestringYesTemplate name (max 100 chars). Unique per user.
latex_contentstringFor a new templateFull LaTeX source for the template body. May be omitted when converting the saved source with placeholder_engine: "liquid".
descriptionstringNoShort human-readable summary (max 500 chars). Shown in list_templates.
instructionsstringNoAgent playbook (prose markdown, max 50000 chars). Describes how to fill the template - defaults, workflow rules, edge cases, conditional logic. Optional but recommended for templates with dynamic parts. See note below.
placeholder_enginestringNo"liquid": the source contains Liquid placeholders ({{ amount }}) filled by render; on an existing raw LaTeX template this 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.

description vs instructions: description is the one-line UI summary ("Standard Toptal monthly invoice"). instructions is the longer playbook your AI agent reads alongside the LaTeX when filling the template ("Ask the user only for total amount; date is today; invoice number format YYYYMMDD-N where N is sequential count for the calendar year; for EU clients add VAT line"). They are different fields.

Raw LaTeX vs placeholder templates: a raw LaTeX template is compiled exactly as saved. A placeholder template is filled with JSON data by render, so the layout never changes. A source containing Liquid placeholders sent without placeholder_engine is refused with liquid_placeholders_in_v1_template, because raw LaTeX would print the braces literally in the PDF. If a placeholder save returns liquid_syntax_error, wrap the literal LaTeX that Liquid misreads (usually a comment right after a brace, \foo{%) in {% raw %}...{% endraw %}.

list_templates

List the user's saved templates. Does not include latex_content or instructions to keep the response small.

Input: None.

Each item in the returned array carries id, name, description, updated_at, latex_size_bytes, and has_instructions (boolean). Use the has_instructions flag to decide whether a follow-up get_template call will return a useful playbook.

get_template

Fetch a single template by ID or name. Returns the full latex_content plus instructions (if any) in one round trip - your agent gets the layout and the playbook together.

ParameterTypeRequiredDescription
id_or_namestringYesNumeric ID or URL-safe template name.

delete_template

Delete a template by ID or name.

ParameterTypeRequiredDescription
id_or_namestringYesNumeric ID or URL-safe template name.

Development

bash
npm installnpm run buildnpm start

License

MIT

来源:README.md,提交 b001979

工具

4

compile

Compile LaTeX to PDF

Compile LaTeX source into a PDF. Returns a PDF URL, page count and compile time. USE THIS WHEN: you have LaTeX source (or a \documentclass) and no local pdflatex / TeX Live installation to run it with. This is that missing compiler, available over HTTP. Also use it whenever the user asks for a document where typesetting matters - an invoice, contract, report, letter, CV, certificate, or academic paper - since you can write the LaTeX yourself and compile it here. DO NOT USE THIS TO: convert HTML to PDF, merge, split or compress existing PDF files, or extract text from a PDF. This compiles LaTeX source and nothing else. No API key is required. Anonymous callers get a small number of compilations per day and failed attempts do not count, so you can iterate on your LaTeX for free. Send an API key in the Authorization header to raise the limits. With a key, a document over the plan's page or size limit still returns a PDF: `preview: true`, the first pages the plan allows, `total_pages`, and `plan_required` naming the plan that covers the whole document. Show the user the preview and relay `warning`; never drop pages silently. IMPORTANT: This tool compiles LaTeX, NOT plain text. You must generate complete, valid LaTeX source yourself before calling it. Do not pass plain text, markdown or JSON directly - convert them to LaTeX first, and never ask the user to write LaTeX. A minimal valid document is: \documentclass{article}\begin{document}<content>\end{document}. Escape these in body text: % & $ # _ { } and backslash. If compilation fails the response includes a `diagnosis` naming the cause and a concrete suggested fix, often a missing \usepackage. Apply it and call again yourself rather than showing the user a TeX log.

输入参数latex必填compiler

list_public_templates

Browse Pressa's public document templates

List Pressa's public, professionally designed document templates (invoices, purchase orders, packing slips, delivery notes, receipts, reports, certificates, resumes, CVs, cover letters), each with a one-line summary, a preview image URL and the colours it comes in. Several designs of one document (`document`, e.g. five resume designs) take the same data. Use this when the user wants one of these documents and has no layout of their own, or asks to see designs to choose from. Works without an API key.

无需输入参数。

get_public_template

Fetch one public template

Get a public template's fields (JSON schema), sample data, filling instructions and LaTeX source. Read the instructions before collecting data from the user. To make the PDF, pass the data to `render_public_template`; to change the layout itself, edit the source and use `compile`.

输入参数template必填

render_public_template

Fill a public template and get a PDF

Fill a public template with the user's data and return a PDF link. Data must match the template's schema (see get_public_template); a missing field comes back as a list of what to ask for, and costs nothing. The designs of one document take the same data (the five resume designs, as do the packing slip and the delivery note), so switching design is the same call with a different slug, and `color` prints a design in another of its colours. Works without an API key within the daily free limit.

输入参数data必填colortemplate必填

版本历史

8
  1. v0.11.4最新Oct 29, 2026
  2. v0.11.3Oct 22, 2026
  3. v0.11.1Oct 20, 2026
  4. v0.11.0Oct 18, 2026
  5. v0.10.1Oct 18, 2026
  6. v0.9.1Oct 17, 2026
  7. v0.8.0Sep 28, 2026
  8. v0.7.2Sep 23, 2026

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分