Skip to main content

fcp-pdf

MCP server for semantic PDF operations.

What It Does

fcp-pdf lets LLMs read, edit, and generate PDF files by describing document intent -- pages, text, annotations, bookmarks, watermarks, redactions -- instead of driving a low-level PDF library call by call. It exposes 13 verbs (page, text, insert-text, annotate, bookmark, merge, split, meta, watermark, image, redact, link, plus compose) and renders them into standard .pdf files. Built on the FCP framework, powered by PyMuPDF (fitz) for serialization.

The compose verb is a small document-generation sub-DSL: it accumulates structured content (headings, paragraphs, tables, lists, callouts, cover pages, columns) into a buffer, then compose render paginates it with text reflow, page breaks, headers/footers, and auto-generated bookmarks, using one of five built-in themes (corporate, modern, minimal, executive, ocean).

Quick Example

pdf_session('new "Invoice"')

pdf([
    'page add',
    'insert-text "INVOICE" x:72 y:72 size:24 font:helv-bold',
    'insert-text "Date: 2026-01-15" x:72 y:110 size:12',
    'annotate rect on:1 x:60 y:60 w:475 h:70 color:#1a1a2e',
    'bookmark add "Invoice" page:1',
])

pdf_session('save as:./invoice.pdf')

Or generate a themed multi-page report with compose:

pdf_session('new "Q4 Report"')

pdf([
    'compose config paper:letter theme:modern footer:"Page {page} of {pages}"',
    'compose heading "Q4 Revenue Report" level:1',
    'compose paragraph "Revenue grew 38% YoY driven by **enterprise expansion**."',
    'compose table "Metric" "Q3" "Q4" "Delta"',
    'compose row "Revenue" "$1.3M" "$1.8M" "+38%"',
    'compose list "Enterprise ARR crossed $1M" "Launched APAC region"',
    'compose render',
])

pdf_session('save as:./q4_report.pdf')

Available MCP Tools

Tool Purpose
pdf(ops) Batch mutations -- pages, text, annotations, bookmarks, merges, watermarks, images, redaction, links, compose
pdf_query(q) Inspect the document -- structure (plan/status), page detail (describe), full-text search (find), toc, fonts, annots
pdf_session(action) Lifecycle -- new, open, save, checkpoint, undo, redo
pdf_help() Full reference card

Installation

Requires Python >= 3.11.

pip install fcp-pdf

MCP Client Configuration

{
  "mcpServers": {
    "pdf": {
      "command": "uv",
      "args": ["run", "python", "-m", "fcp_pdf"]
    }
  }
}

Architecture

3-layer architecture:

MCP Server (Intent Layer)
  Parses op strings, dispatches to verb handlers
        |
Semantic Model
  PdfModel wraps a fitz.Document, byte-snapshot undo/redo
        |
Serialization (PyMuPDF / fitz)
  Semantic model -> .pdf binary output

Key features:

  • Pages -- add, remove, move, rotate, copy, activate
  • Text -- extraction (plain/blocks/dict) and free-form insertion
  • Annotations -- highlight, underline, strikeout, sticky notes, shapes
  • Bookmarks -- table of contents management
  • Merge / split -- combine or extract page ranges across documents
  • Metadata -- title, author, subject, keywords, creator, producer
  • Watermarks -- rotated, opacity-controlled text overlays
  • Images -- insert, extract, list
  • Redaction -- permanently remove text from pages
  • Links -- hyperlinks and internal page links
  • Compose -- themed document layout engine with automatic pagination and bookmarks
  • Undo/redo -- full document snapshots with event sourcing

Development

uv sync --dev        # install deps
uv run pytest        # run tests
uv run fcp-pdf        # start MCP server

License

MIT

Metadata

Release files for fcp-pdf 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fcp-pdf 0.2.0
File Size Uploaded Provenance Actions
fcp_pdf-0.2.0.tar.gz 39.4 kB With provenance Details for fcp_pdf-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fcp-pdf 0.2.0
File Interpreter ABI Platform Actions
fcp_pdf-0.2.0-py3-none-any.whl Python 3 none any Details for fcp_pdf-0.2.0-py3-none-any.whl

Total release size: 81.1 kB

Release files / fcp_pdf-0.2.0.tar.gz

Download URL fcp_pdf-0.2.0.tar.gz
Size 39.4 kB
Tags Source
SHA-256 checksum
How to use checksums
26c4139f8ec729f10408bd599847ef6b56191bb25959ea77cfd1dfd01ea2731f
BLAKE2b-256 checksum
How to use checksums
bc777f5dfe5b7621dc974152bd944f0f8ae215cdad2fb4c1a7572ecc4f8b6881
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 6, 2026.

Transparency log

Release files / fcp_pdf-0.2.0-py3-none-any.whl

Download URL fcp_pdf-0.2.0-py3-none-any.whl
Size 41.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4d7338ee8cc7737d0b3ef0db4ff4ff0726d5e7d27a9ecace4d5663adaea9b903
BLAKE2b-256 checksum
How to use checksums
267bb82331df60ce5a1d24053fbda525b7b7890f8ee334acdd38d8e5df123cf2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 6, 2026.

Transparency log

Security for fcp-pdf 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fcp_pdf-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page