Server
NextPDF Connect
Deterministic PDF execution for AI systems — three transports, one engine.
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 Core tools to AI systems for deterministic PDF execution. Install nextpdf/premium and the registry discovers 8 Pro and 8 Enterprise tools by class existence, snapping them in as a soft dependency. Tools stay identical no matter which transport calls them.
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 in the log so the trail stays reviewable without exposing secrets. The same audit path applies across all three transports.
Get started
Install
composer require nextpdf/serverIn code
How it works
MCP (stdio) — Claude Desktop / Cursor
{
"mcpServers": {
"nextpdf": {
"command": "php",
"args": ["vendor/bin/nextpdf-mcp"]
}
}
}HTTP REST API
# 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.pdfUnlock more tools
# Add Pro + Enterprise tools (extract, compare, redact, sign, forensics, compliance, etc.)
composer require nextpdf/premiumCapabilities
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 Core tools, including create_pdf, add_page, add_text, add_image, add_table, set_font, preview_layout, and output_pdf
- Soft dependency — install nextpdf/premium to add 8 Pro + 8 Enterprise tools via class_exists() discovery, no code changes
- 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 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 Pro and Enterprise tool tiers.