Skip to content

Server

NextPDF Connect

Deterministic PDF execution for AI systems—three transports, one engine.

Free · Apache-2.0NextPDF ^3.0 · RoadRunner 2024.x · symfony/yaml ^7.2 · psr/log ^3.0 · PHP 8.4+
MCP
REST
gRPC
ToolRegistry
MCP, REST, and gRPC share one tool registry.

NextPDF Connect exposes a deterministic execution surface for PDF operations—creation, analysis, signing, validation—accessible via MCP (stdio), REST API, or gRPC. All three transports share the same ToolRegistry, ToolExecutor, and application services. All operations are deterministic, and dangerous operations require human confirmation.

How it fits

Built into your workflow

One registry, every tool

A single ToolRegistry exposes 13 free NextPDF Core tools to AI systems for deterministic PDF execution. Install nextpdf/premium and the registry discovers 8 NextPDF Pro and 8 NextPDF Enterprise tools by class existence, snapping them in as a soft dependency. Every transport uses the same tool contract.

Human-in-the-loop gating

Risky operations such as signing or final output are marked Approval-Required and pause at a human-in-the-loop gate. The gate issues a confirmation challenge before the operation may proceed. Routine tools run uninterrupted; only the operations that warrant review wait for a human decision.

Redacted audit trail

Every Caution-and-above operation is recorded through a PSR-3 logger, giving you a ledger of what the AI executed. Sensitive parameters are redacted before the log entry is written. The same audit path applies across all three transports.

Get started

Install

terminal
composer require nextpdf/server

In code

How it works

MCP (stdio)—Claude Desktop / Cursor

json
{
  "mcpServers": {
    "nextpdf": {
      "command": "php",
      "args": ["vendor/bin/nextpdf-mcp"]
    }
  }
}

HTTP REST API

bash
# Start HTTP server (port 8080)
rr serve -c .rr.yaml

# Render a PDF (stateless, single request)
curl -X POST http://localhost:8080/api/v1/render \
  -H "Authorization: Bearer npk_live_k8a3b2c1_..." \
  -H "Content-Type: application/json" \
  -d '{"page_size": "A4", "operations": [
    {"type": "add_text", "content": "Hello World", "x": 10, "y": 20}
  ]}' --output document.pdf

Unlock more tools

bash
# Add Pro + Enterprise tools (extract, compare, redact, sign, forensics, compliance, etc.)
composer require nextpdf/premium

Capabilities

What you get

  • Three transports—MCP (JSON-RPC over stdio), HTTP REST (OpenAPI 3.1, port 8080), and gRPC (Protobuf v3, port 9090)
  • 13 free NextPDF Core tools, including create_pdf, add_page, add_text, add_image, add_table, set_font, preview_layout, and output_pdf
  • Soft dependency—class_exists() discovery adds 8 NextPDF Pro and 8 NextPDF Enterprise tools when nextpdf/premium is installed
  • Human-in-the-loop—risk-level gating; Approval-Required tools (output_pdf, sign_pdf) issue a confirmation challenge
  • Audit logging—Caution-level and above logged via PSR-3, with sensitive parameters redacted
  • AI Skills—auto-generates reference files for Claude, Codex, Gemini, and function-calling platforms

When to use it

Reach for NextPDF Connect when an AI agent or service needs a deterministic, risk-gated PDF execution surface. Expose it over MCP, REST, or gRPC, and add nextpdf/premium to unlock the NextPDF Pro and NextPDF Enterprise tool tiers.