Skip to main content
Glama
PSPDFKit

Nutrient PDF MCP Server

Official
by PSPDFKit

Nutrient PDF MCP Server

A powerful Model Context Protocol server for LLM-driven PDF document analysis and exploration

Which MCP Server Should I Use?

Server

Best for

Deployment

Core capabilities

Nutrient DWS MCP Server

Cloud document workflows

Nutrient-hosted API (API key)

Convert, OCR, redact, sign, extract, watermark, automation

Nutrient Document Engine MCP Server

Self-hosted document workflows

On-prem/private cloud

Document processing with deployment control and data residency

Nutrient PDF MCP Server

Low-level PDF inspection/debugging

Local Python runtime

Object-tree exploration, indirect-object resolution, structural analysis

You are in the PDF MCP Server repo. Choose this when you need low-level PDF object-tree inspection/debugging rather than end-to-end workflow automation.

A Model Context Protocol (MCP) server for investigating PDF object trees with lazy loading support. This tool allows LLMs to efficiently explore PDF document structure without overwhelming token limits.

Related MCP server: PDF Splitter MCP Server

Features

  • Lazy Loading: Explore PDF structure without loading entire object trees

  • Path Navigation: Navigate through PDF objects using dot notation (e.g., Pages.Kids.0)

  • Selective Resolution: Resolve specific indirect objects on demand

  • Token Efficient: Massive reduction in response sizes compared to full tree dumps

  • Type Safe: Comprehensive type hints and error handling

Installation

Optional asdf setup

You'll need python and nodejs installed on your machine. You can optionally use asdf.

Finally install required tools with:

git clone https://github.com/PSPDFKit/nutrient-pdf-mcp-server.git
cd nutrient-pdf-mcp-server
asdf install

# Install pipx for Python
python -m pip install --user pipx

Proceed with the rest of the installation after that.

Quick Start

git clone https://github.com/PSPDFKit/nutrient-pdf-mcp-server.git
cd nutrient-pdf-mcp-server
make install-dev  # Sets up development environment

For Claude Code CLI

Recommended: Build and Install

pip install build
make build
pipx install dist/nutrient_pdf_mcp-1.0.0-py3-none-any.whl
claude mcp add nutrient-pdf-mcp nutrient-pdf-mcp

If using asdf, you might need to configure pipx with the following before running:

export PIPX_DEFAULT_PYTHON=$(asdf which python)
pipx install dist/nutrient_pdf_mcp-1.0.0-py3-none-any.whl

Development Mode

make install-dev
claude mcp add nutrient-pdf-mcp "$(pwd)/venv/bin/python" -m pdf_mcp.server

Manual Configuration

{
  "mcpServers": {
    "nutrient-pdf-mcp": {
      "command": "python",
      "args": ["-m", "pdf_mcp.server"]
    }
  }
}

Available Tools

get_pdf_object_tree

Nutrient PDF MCP Server - Get JSON representation of PDF object tree with lazy loading.

Parameters:

  • pdf_path (required): Path to the PDF file

  • object_id (optional): Specific object ID to retrieve (e.g., '1 0')

  • path (optional): Object path to navigate (e.g., 'Pages.Kids.0')

  • mode (optional): Parsing mode - 'lazy' (default) or 'full'

Examples:

{
  "pdf_path": "document.pdf",
  "mode": "lazy"
}
{
  "pdf_path": "document.pdf",
  "path": "Pages.Kids.0",
  "mode": "lazy"
}

resolve_indirect_object

Nutrient PDF MCP Server - Resolve a specific indirect object by its object and generation numbers.

Parameters:

  • pdf_path (required): Path to the PDF file

  • objnum (required): PDF object number (e.g., 3)

  • gennum (optional): PDF generation number (defaults to 0)

  • depth (optional): Resolution depth - 'shallow' (default) or 'deep'

Examples:

{
  "pdf_path": "document.pdf",
  "objnum": 3,
  "gennum": 0,
  "depth": "shallow"
}

Command Line Usage

# Run the server
make serve

# Or run with debug logging
make serve-debug

Architecture

Core Components

  • parser.py: Main PDF parsing logic with lazy loading support

  • server.py: MCP server implementation

  • types.py: Type definitions for PDF objects and responses

  • exceptions.py: Custom exception classes

Response Types

All PDF objects are serialized into a consistent JSON format:

{
  "type": "dict",
  "value": {
    "/Type": { "type": "name", "value": "/Pages" },
    "/Kids": {
      "type": "array",
      "value": [{ "type": "indirect_ref", "objnum": 2, "gennum": 0 }]
    }
  }
}

Token Efficiency

The lazy loading system provides massive token savings:

  • Lazy mode: ~5-50 lines (minimal tokens)

  • Shallow resolution: ~50-100 lines (reasonable tokens)

  • Deep resolution: 500+ lines (use sparingly)

Examples

Exploring PDF Structure

  1. Get overview: get_pdf_object_tree(path="document.pdf", mode="lazy")

  2. Navigate to pages: get_pdf_object_tree(path="document.pdf", path="Pages", mode="lazy")

  3. Resolve specific page: resolve_indirect_object(objnum=3, gennum=0, depth="shallow")

  4. Deep dive when needed: resolve_indirect_object(objnum=3, gennum=0, depth="deep")

Path Navigation Examples

  • "Pages" - Navigate to Pages object

  • "Pages.Kids" - Get Kids array from Pages

  • "Pages.Kids.0" - Get first page

  • "Pages.Kids.0.MediaBox.2" - Get width from MediaBox array

Development

Quick Start

# Set up development environment
make install-dev

# Run all quality checks (format, lint, typecheck, test)
make quality

# Or run individual commands
make test          # Run tests
make format        # Format code
make lint          # Run linter
make typecheck     # Type checking

Project Structure

nutrient-pdf-mcp-server/
├── pdf_mcp/
│   ├── __init__.py
│   ├── server.py          # MCP server
│   ├── parser.py          # PDF parsing logic
│   ├── types.py           # Type definitions
│   └── exceptions.py      # Custom exceptions
├── tests/                 # Test suite
├── res/                   # Sample PDFs
├── pyproject.toml         # Project configuration
└── README.md

Publishing to PyPI

# Build the package
make build

# Upload to test PyPI first
twine upload --repository testpypi dist/*

# Upload to production PyPI
twine upload dist/*

After publishing, users can install with:

pipx install nutrient-pdf-mcp
# or
pip install --user nutrient-pdf-mcp

Contributing

  1. Fork the repository

  2. Create a feature branch

  3. Make your changes with tests

  4. Ensure code quality checks pass

  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Available Tools

2 tools
get_pdf_object_treeB

Nutrient PDF MCP Server - Get JSON representation of PDF object tree with lazy loading

ParametersJSON Schema
NameRequiredDescriptionDefault
pdf_pathYesPath to the PDF file
object_idNoOptional: specific object ID to retrieve (e.g., '1 0')
pathNoOptional: object path to navigate (e.g., 'Pages.Kids.0')
modeNoParsing mode: 'lazy' (default) or 'full'lazy

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description mentions lazy loading, which is a key behavioral trait. However, with no annotations provided, the description carries the full burden. It does not state whether the tool is read-only, what happens if the PDF is malformed, or provide any concurrency or rate limit information. The lazy loading mention is a minimal but useful disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence with no wasted words. It front-loads the key purpose ('Get JSON representation of PDF object tree') and includes the server context. It is appropriately short for a simple tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the medium complexity (4 parameters, one sibling tool) and no output schema, the description is minimally complete. It covers the basic purpose and lazy loading but lacks return value expectations, error handling hints, or usage scenarios. The sibling tool is not explained, leaving the agent to guess when to use each.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description does not add any meaning beyond what the schema already provides; it simply restates the overall purpose. The schema descriptions for each parameter are clear and complete, so the description's lack of additional parameter context is acceptable.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Get JSON representation of PDF object tree' which is a clear verb and resource. It distinguishes from the sibling tool 'resolve_indirect_object' implicitly by focusing on the full tree rather than indirect object resolution. The mention of lazy loading adds specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus its sibling 'resolve_indirect_object'. There is no mention of prerequisites, limitations, or alternative tools for different use cases. The description does not help the agent decide between this and related tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

resolve_indirect_objectC

Nutrient PDF MCP Server - Resolve a specific indirect object by its ID

ParametersJSON Schema
NameRequiredDescriptionDefault
pdf_pathYesPath to the PDF file
objnumYesPDF object number
gennumNoPDF generation number (optional, defaults to 0)
depthNoResolution depth: 'shallow' (default, only direct properties) or 'deep' (resolve all nested objects)shallow

TDQS

C2.6/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description should disclose behavioral traits such as whether the tool is read-only, has side effects, or requires specific permissions. It simply states 'resolve', which is vague, and fails to mention any limitations or consequences, making it insufficient for safe usage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence without unnecessary details, but it includes the preamble 'Nutrient PDF MCP Server -', which adds slight noise. It is concise overall, but could be more direct by removing the prefix.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is extremely brief and does not explain what an indirect object is, how resolution works, the expected output, or any error handling. Given the lack of annotations and output schema, this is far from complete enough for an agent to use the tool confidently.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already describes all parameters with 100% coverage, so the description adds no additional semantic value beyond the schema. The baseline of 3 is appropriate as the description does not clarify the meaning of parameters like 'depth' or how to use them effectively.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (resolve) and the resource (indirect object by its ID), making it easy to understand the tool's purpose. However, it does not explicitly differentiate from the sibling tool 'get_pdf_object_tree', which might also involve object retrieval, but the focus on a specific object by ID is implied.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus the sibling 'get_pdf_object_tree'. There is no mention of context, prerequisites, or when not to use it, leaving the agent without decision support.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

B3.2/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: one retrieves the entire object tree structure, the other resolves a specific indirect object by ID. There is no overlap or ambiguity between them.

Naming Consistency5/5

Both tools follow a consistent verb_noun pattern with underscore: 'get_pdf_object_tree' and 'resolve_indirect_object'. The naming is uniform and predictable.

Tool Count3/5

With only 2 tools, the surface is minimal but appropriate for the narrow domain of PDF object tree inspection. It's borderline, but each tool serves a specific, complementary purpose.

Completeness3/5

For the stated purpose of exploring a PDF object tree, the tools provide tree retrieval and resolution of indirect objects. However, missing operations like filtering objects by type or searching objects limit completeness for more advanced use cases.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables LLMs to chat with long PDFs using a reasoning-based, tree-structured document index that navigates content like a human would, without requiring vector databases or hitting context limits.
    371
    382
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides random access to PDF contents with selective page extraction, text search, outline navigation, image extraction, and page rendering capabilities. Reduces token usage by allowing targeted content extraction instead of processing entire documents.
    4
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables reading, searching, and metadata extraction from PDF files without loading the entire content into the context window. It provides efficient tools for text cleaning, page-specific extraction, and context-aware search results.
    3
    58
    1
    MIT
  • F
    license
    A
    quality
    C
    maintenance
    Enables AI agents to efficiently process large local and online PDFs through selective extraction of text, images, and metadata. It provides tools for content search and document outline navigation to optimize context window usage.
    7
    14

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PSPDFKit/nutrient-pdf-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server