Edit PDF text with Cursor

Describe the change in plain words. Cursor calls the pdf_edit tool, the text is rewritten in place with the document's own font, the page is rendered before and after, and the edit is refused if anything else on the page moved.

A real run on the hosted sample quotation: a name, a total and an IBAN, three edits, each verified. The prompt is the one shown.

Install

One click

Add to Cursor installs the server; local files work right away. No key needed to start: 20 pages a day per IP, output watermarked. A free key (200 pages a month, no watermark on ordinary documents) lifts both.

Or by file

Put this in ~/.cursor/mcp.json (global) or .cursor/mcp.json in the project:

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

With a key:

{
  "mcpServers": {
    "pdfedit": {
      "command": "npx",
      "args": [
        "-y",
        "@niubai/pdfedit-mcp"
      ],
      "env": {
        "PDFEDIT_API_KEY": "sk_live_your_key"
      }
    }
  }
}

Hosted server instead (PDF URLs only, for a machine that cannot run npx): {"mcpServers": {"pdfedit": {"url": "https://pdfedit-mcp-remote.niubai-pdfedit-remote-worker.workers.dev/mcp"}}}

Cursor Settings → MCP shows the server and its five tools once the file is saved. Use it from Agent mode (the composer in agent mode), not from plain chat.

What to say

Replace

In ./quote.pdf change "Acme Inc." to "Acme GmbH" and make the total 249.00 USD.

One call to pdf_edit; the result is written as quote.edited.pdf next to the original, which is never touched, and the changed page comes back as a before/after picture.

Redact

Redact every IBAN and every email address in ./statement.pdf before I share it.

The bytes are removed, not covered; metadata is swept; the reply lists anywhere the same string still appears.

Batch

Use ./offer-template.pdf and ./hires.csv: one PDF per row, filling {name} and {salary}.

pdf_batch returns a job id; pdf_job hands back one finished document per row.

What comes back

  • The edited PDF, written as a new file (x.edited.pdf, then x.edited.2.pdf); the original is never overwritten.
  • One record per edit: page, what was found, what it became, which font was used, and whether the verification passed.
  • A before/after image of every changed page, shown in the conversation.
  • A refusal instead of a file when a change cannot be verified: the page is rendered before and after, and anything that moved outside the edit rolls the edit back.

Limits

  • Without a key: 20 pages a day per IP, output watermarked.
  • With a key: 200 pages a month free, no watermark on ordinary documents. Get a key with one email, then set PDFEDIT_API_KEY.
  • Right-to-left scripts are refused; scanned pages go through OCR and a replacement is drawn as pixels; relative-positioned text (charts) may be rolled back. The error table lists each case.

Other clients: Claude · VS Code. The same tools from any MCP client: GitHub, npm. No Node? The same API as an agent skill: npx skills add zp130221/pdfedit-mcp.