mcp-pdf-tools

mcp-pdf-tools

An MCP server that enables users to read, search, and analyze PDF documents. It provides tools for extracting text, viewing metadata, searching content with context, and generating word statistics.

Category
访问服务器

README

<div align="center">

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.

</div>


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.


pdf_search

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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选