Skip to main content
Glama

mcp-pdf-tools

MCP server for extracting text, searching, and analyzing PDF files

npm version License: MIT TypeScript Node

Give Claude (or any MCP client) the ability to read, search, and analyze PDF documents.


What is this?

mcp-pdf-tools is a Model Context Protocol server that gives AI assistants the ability to work with PDF files. Point it at any text-based PDF and your assistant can extract content, search for specific text, pull metadata, and analyze word usage — all without leaving the conversation.

Quick Start

Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "pdf-tools": {
      "command": "npx",
      "args": ["-y", "mcp-pdf-tools"]
    }
  }
}

Claude Code

claude mcp add pdf-tools npx mcp-pdf-tools

Other MCP Clients

npx -y mcp-pdf-tools

The server communicates over stdio using the MCP protocol.

Tools

pdf_info

Get metadata and statistics about a PDF file.

Parameter

Type

Required

Description

file_path

string

Yes

Absolute path to the PDF file

Returns: Title, author, page count, text length, creator, and producer information.


pdf_extract_text

Extract all text content from a PDF file.

Parameter

Type

Required

Default

Description

file_path

string

Yes

Absolute path to the PDF file

max_chars

number

No

50000

Maximum characters to return (truncates with notice)

Returns: Full text content of the PDF, prefixed with page count.


pdf_extract_pages

Extract text from a specific page range.

Parameter

Type

Required

Description

file_path

string

Yes

Absolute path to the PDF file

start_page

number

Yes

Start page (1-indexed)

end_page

number

Yes

End page (inclusive)

Returns: Text content from the specified page range.


Search for text within a PDF file, returning matches with surrounding context.

Parameter

Type

Required

Default

Description

file_path

string

Yes

Absolute path to the PDF file

query

string

Yes

Text to search for (case-insensitive)

max_results

number

No

20

Maximum number of matches to return

Returns: List of matches with line numbers and surrounding context lines.


pdf_word_stats

Get word count and top word frequencies from a PDF.

Parameter

Type

Required

Default

Description

file_path

string

Yes

Absolute path to the PDF file

top_n

number

No

20

Number of top words to include

Returns: Total word count, page count, and a ranked list of the most frequent words (3+ characters).

Example Conversations

Summarizing a report

You: Summarize the key points in /documents/quarterly-report.pdf

Claude: (uses pdf_info to check document size, then pdf_extract_text to read content)

This is a 24-page quarterly report covering Q4 2025. The key points are...

Searching a contract

You: Does the NDA in /legal/nda-acme.pdf mention anything about a non-compete?

Claude: (uses pdf_search with query "non-compete")

Yes — I found 3 mentions of "non-compete" in the document. On line 47, there's a clause stating...

Analyzing word usage

You: What are the most discussed topics in /research/paper.pdf?

Claude: (uses pdf_word_stats to get word frequencies)

The paper is 8,400 words across 12 pages. The most frequent terms are "neural" (47 occurrences), "training" (38), and "optimization" (29), suggesting the paper focuses heavily on...

Limitations

Be aware of these current constraints:

  • Text-based PDFs only — Scanned or image-based PDFs will return empty text. No OCR support (yet).

  • Page extraction is approximate — Page boundaries are detected heuristically. Extracted page ranges may not align perfectly with the visual pages in your PDF viewer.

  • No table extraction — Tabular data in PDFs may not preserve its structure in the extracted text.

  • Full file loaded into memory — Very large PDFs may be slow to process.

  • No merge or split — This tool reads PDFs; it does not modify, merge, or split them.

Development

git clone https://github.com/seraphinederenouard/mcp-pdf-tools.git
cd mcp-pdf-tools
npm install
npm run build
npm test

License

MIT

Available Tools

5 tools
pdf_extract_pagesC

Extract text from a specific page range of a PDF

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to the PDF file
start_pageYesStart page (1-indexed)
end_pageYesEnd page (inclusive)

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the core behavior but lacks critical details: it doesn't mention output format (e.g., plain text, structured data), error handling (e.g., invalid page ranges), performance aspects (e.g., large PDFs), or side effects (e.g., file modifications). For a tool with zero annotation coverage, this is a significant gap.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place by conveying essential information without redundancy.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete for a tool with 3 parameters and behavioral complexity. It lacks details on output format, error conditions, and usage context relative to siblings. While concise, it doesn't compensate for the missing structured information, leaving gaps for an AI agent.

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%, with clear parameter descriptions in the schema (e.g., 'Absolute path to the PDF file', 'Start page (1-indexed)'). The description adds no additional semantic context beyond implying page-range usage, so it meets the baseline of 3 where the schema does the heavy lifting.

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 ('Extract text') and resource ('from a specific page range of a PDF'), making the purpose immediately understandable. It distinguishes itself from sibling tools like pdf_extract_text (which likely extracts all text) by specifying page-range extraction, though it doesn't explicitly name alternatives.

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 alternatives like pdf_extract_text or pdf_search. It mentions 'specific page range' but doesn't clarify scenarios where this is preferred over full-text extraction or search-based extraction, leaving usage context implied rather than explicit.

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

pdf_extract_textC

Extract all text content from a PDF file

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to the PDF file
max_charsNoMaximum characters to return

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Extract') but doesn't mention potential side effects (e.g., if the file is locked or modified), performance characteristics (e.g., speed for large files), error handling, or output format details. This leaves significant gaps for a tool that interacts with files.

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

Conciseness5/5

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

The description is a single, direct sentence that efficiently conveys the core functionality without unnecessary words. It's front-loaded with the key action and resource, making it easy to parse quickly, which is ideal for conciseness.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete for a tool that performs file operations. It doesn't address behavioral aspects like error cases (e.g., invalid file paths or non-PDF files), output details (e.g., text format or truncation behavior), or integration with siblings, leaving the agent with insufficient context for reliable use.

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 description doesn't add any parameter-specific information beyond what's in the input schema, which has 100% coverage with clear descriptions for both parameters. Since schema coverage is high, the baseline score is 3, as the description doesn't compensate but also doesn't detract from the well-documented schema.

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 ('Extract') and resource ('all text content from a PDF file'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like pdf_search (which might also extract text but with search filtering) or pdf_word_stats (which analyzes text), leaving room for improvement in sibling distinction.

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 alternatives. With siblings like pdf_extract_pages (which might extract specific pages) and pdf_search (which might filter text), there's no indication of when this general text extraction is preferred, nor any mention of prerequisites or constraints beyond the parameters.

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

pdf_infoA

Get metadata and statistics about a PDF file (pages, author, title, text length)

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to the PDF file

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses the tool's purpose as a read-only metadata retrieval operation, which implies non-destructive behavior, but does not add details like error handling, performance characteristics, or output format. The description is adequate but lacks rich behavioral context beyond the basic function.

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

Conciseness5/5

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

The description is a single, efficient sentence that front-loads the core purpose ('Get metadata and statistics about a PDF file') and provides specific examples in parentheses. There is no wasted verbiage, and every element contributes directly to understanding the tool's function.

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

Completeness4/5

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

Given the tool's low complexity (single parameter, no output schema, no annotations), the description is reasonably complete. It covers the purpose and key metadata types, but lacks details on output structure or error cases. For a simple read operation, this is sufficient, though not exhaustive.

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 description coverage is 100%, with the parameter 'file_path' fully documented in the schema. The description does not add any parameter-specific information beyond what the schema provides, such as file format constraints or path examples. With high schema coverage, the baseline score of 3 is appropriate.

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

Purpose5/5

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

The description clearly states the verb 'Get' and the resource 'metadata and statistics about a PDF file', with specific examples like pages, author, title, and text length. It distinguishes from sibling tools (pdf_extract_pages, pdf_extract_text, pdf_search, pdf_word_stats) by focusing on metadata retrieval rather than extraction, search, or word-level analysis.

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

Usage Guidelines3/5

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

The description implies usage for obtaining metadata and statistics from a PDF, but does not explicitly state when to use this tool versus alternatives like pdf_word_stats for word-level stats or pdf_extract_text for text content. No exclusions or prerequisites are mentioned, leaving usage context somewhat open-ended.

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

pdf_word_statsB

Get word count and top word frequencies from a PDF

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to the PDF file
top_nNoNumber of top words to return

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool's function but fails to describe key behaviors: whether it handles large files, what happens with invalid PDFs, if there are rate limits, or the format of the output (e.g., JSON structure). This leaves significant gaps for an agent to understand operational constraints.

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

Conciseness5/5

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

The description is a single, efficient sentence that front-loads the core purpose without unnecessary words. Every part earns its place by specifying the action and resource clearly, making it easy to scan and understand quickly.

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

Completeness2/5

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

Given the tool's moderate complexity (analyzing PDFs for statistics) and lack of annotations and output schema, the description is incomplete. It does not address behavioral aspects like error handling, performance, or output format, which are critical for an agent to use the tool effectively in real-world scenarios.

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 schema already fully documents both parameters (file_path and top_n). The description adds no additional meaning beyond what the schema provides, such as explaining how word frequencies are calculated or what 'top words' entails. Baseline 3 is appropriate as the schema does the heavy lifting.

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

Purpose5/5

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

The description clearly states the tool's purpose with specific verbs ('Get word count and top word frequencies') and resource ('from a PDF'), distinguishing it from sibling tools like pdf_extract_text (which extracts text) and pdf_info (which provides metadata). It precisely communicates what the tool does beyond just extracting or searching PDF content.

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 alternatives like pdf_extract_text (for raw text) or pdf_search (for specific content). It lacks any mention of prerequisites, such as needing a valid PDF file, or exclusions, leaving the agent to infer usage context from the tool name and purpose alone.

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

TDQS

A3.5/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: pdf_extract_pages extracts text from specific pages, pdf_extract_text extracts all text, pdf_info provides metadata, pdf_search finds text matches, and pdf_word_stats analyzes word frequencies. There is no overlap or ambiguity between these functions.

Naming Consistency5/5

All tools follow a consistent 'pdf_' prefix with descriptive snake_case names (e.g., pdf_extract_text, pdf_search). This pattern is uniform across all five tools, making them predictable and easy to understand.

Tool Count5/5

With 5 tools, this server is well-scoped for PDF processing, covering extraction, metadata, search, and analysis. Each tool earns its place without redundancy, and the count is appropriate for the domain.

Completeness4/5

The toolset covers core PDF operations well, including extraction, metadata, search, and word analysis. A minor gap exists in lacking tools for PDF manipulation (e.g., merging, splitting, or editing), but the provided tools support common workflows effectively.

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

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/seraphinerenard/mcp-pdf-tools'

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