NU

Nutrient MCP Server: Create Edit Sign Extract Documents

Create, edit, sign and extract documents with natural language using the MCP server for fast, secure document workflows.

Quick Install
npx -y @PSPDFKit/nutrient-dws-mcp-server

Overview

The Nutrient MCP Server is an implementation of the Model Context Protocol (MCP) that helps developers build document workflows driven by natural language. It connects a language model with document tooling (PDF operations, OCR, signing) so you can create, edit, sign and extract data from documents using plain-English prompts rather than wiring low-level PDF APIs yourself.

Designed for integration into backend services, the server acts as a translator between natural-language instructions and concrete document operations. Typical uses include converting prompts into filled forms, extracting structured fields from scanned documents, programmatically applying digital signatures, and generating or modifying contract text — all while keeping the document assets and signing credentials under your control.

Features

  • Create documents from templates or from scratch using natural language prompts
  • Edit document content (text replacement, field insertion, redaction) via instructions
  • Extract structured data (form fields, tables, named entities) from PDFs/OCR results
  • Apply digital signatures and prepare documents for e-sign workflows
  • Pluggable model/back-end providers (LLMs) and configurable document processors
  • REST API for easy integration with backends, server-side automation, or job queues
  • Local or cloud storage support and audit-friendly operation logs

Installation / Configuration

Prerequisites: Node.js (>= 16) or Docker, and access credentials for any integrated services (LLM provider, PSPDFKit or other PDF processor, signing backend).

Clone the repository and install dependencies:

git clone https://github.com/PSPDFKit/nutrient-dws-mcp-server.git
cd nutrient-dws-mcp-server
npm install

Create a copy of the example environment file and edit configuration values:

cp .env.example .env
# then open .env and set the variables

Example .env (adjust to your environment):

PORT=3000
MCP_MODEL=openai-gpt-4o
MODEL_API_KEY=sk-...
PSPDFKIT_SERVER_URL=https://your-pspdfkit-server
PSPDFKIT_API_KEY=pspdfkit_...
STORAGE_DIR=./storage
SIGNING_KEY_PATH=/secrets/signing-key.pem
LOG_LEVEL=info

Typical npm scripts:

# start in production
npm start

# start in development with auto-reload
npm run dev

Docker

# build
docker build -t nutrient-mcp-server .

# run (example)
docker run -d \
  -p 3000:3000 \
  -e PORT=3000 \
  -e MODEL_API_KEY=sk-... \
  -e PSPDFKIT_API_KEY=pspdfkit_... \
  -v /local/storage:/app/storage \
  nutrient-mcp-server

Configuration reference (common environment variables):

VariableDescription
PORTHTTP port to listen on
MCP_MODELIdentifier for the model or connector to use
MODEL_API_KEYAPI key for your LLM provider
PSPDFKIT_SERVER_URLOptional URL for a PSPDFKit backend
PSPDFKIT_API_KEYAPI key for PSPDFKit operations
STORAGE_DIRLocal directory or mount for uploaded documents
SIGNING_KEY_PATHPath to private key or signing credential store
LOG_LEVELLogging verbosity (error, warn, info, debug)

Available Tools / Resources

  • GitHub repository: https://github.com/PSPDFKit/nutrient-dws-mcp-server
  • Built-in API documentation: the server typically exposes an OpenAPI/Swagger spec at /openapi.json (check your running instance)
  • Example scripts: look for an examples/ or clients/ folder in the repo showing sample requests and response handling
  • Integrations: adapters for PDF processing (PSPDFKit or other), OCR modules, and signing backends (configurable)

Typical request format

The server expects an MCP-style JSON payload describing the intent, document(s), and contextual metadata. A minimal example:

curl -X POST http://localhost:3000/api/mcp \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "edit",
    "instructions": "Insert a signature field at bottom of page 2 and replace [COMPANY] with \"Acme Inc.\"",
    "documentUrl": "https://example.com/contracts/draft.pdf",
    "metadata": { "requestId": "1234" }
  }'

Common action values: create, edit, sign, extract. The server returns a job result with operation status, a link to the modified document, and structured outputs when applicable (extracted fields, audit log).

Use Cases

  • Form extraction and onboarding: Upload scanned onboarding forms and use a single prompt like “Extract name, address, email, and employer from this page” to populate your CRM with structured JSON.
  • Contract drafting and edits: Start from a short brief — “Create a one-page contractor agreement for freelance designers with payment terms and a 14-day termination clause” — and receive a PDF draft you can further refine or send for signature.
  • Bulk signing automation: Programmatically attach signature fields and apply signatures for batches of