MCP PDF Reader 是一个专业的 PDF 文档处理工具,通过 Model Context Protocol (MCP) 为 AI 应用提供强大的 PDF 文本提取、搜索、OCR 识别等功能。它能够智能识别 PDF 类型,自动选择最佳处理策略,为用户提供高效便捷的文档处理体验。
Configuration
View docs{
"mcpServers": {
"3351163616-mcp_pdf_reader": {
"command": "node",
"args": [
"你的项目路径/mcp_pdf_reader/index.js"
],
"env": {
"BAIDU_OCR_API_KEY": "YOUR_API_KEY",
"BAIDU_OCR_SECRET_KEY": "YOUR_SECRET_KEY"
}
}
}
}You have a dedicated MCP server for processing PDFs powered by the Model Context Protocol. It automatically handles PDF text extraction, metadata, searches, and OCR with configurable options, delivering efficient and secure document processing for AI workflows.
You run your MCP server locally and connect your MCP client to it. The server exposes a single stdio-based entry point that you launch from Node with a command you specify in your MCP client configuration. Once running, you can request smart reading, text extraction, search, metadata, and OCR tasks for your PDF documents. If a document is too large or complex, the server can adjust processing to balance quality and costs, and it caches OCR results to avoid repeated work.
Prerequisites: you need Node.js 18 or higher and a working MCP client in your environment.
Step by step commands to set up the server locally and connect your client.
# 1. Install dependencies for the server package
npm install
# 2. Start or prepare the MCP server entry point (example path shown in configuration)
# This assumes you follow the standard project layout and place the MCP server under mcp_pdf_reader/index.js
node your_project_path/mcp_pdf_reader/index.jsYour client configuration should point to the local stdio MCP server. You can also enable optional Baidu OCR keys if you plan to use OCR features and you have a valid API key and Secret Key.
Environment variables for OCR can be supplied to the server configuration. If you are using automatic environment-based configuration, ensure your environment contains the necessary keys before starting the server.
If the server does not start, verify Node.js is installed and the entry path is correct. Check for missing dependencies and confirm your MCP client is configured to use the stdio interface. For OCR failures, ensure OCR API credentials are available and configured according to your chosen method.
Prefer the smart read tool when you are unsure whether a document is text-based or image-based. If you know the document type, you can target specific pages to optimize processing time and cost.
The server supports multiple tools, including smart reading, basic text extraction, full-document search, metadata extraction, and OCR. These tools can be invoked through the MCP client to compose complex processing pipelines for PDFs.
Smart reader that auto-detects whether a PDF is text-based or image-based and selects the optimal processing path.
Text extraction tool for text-based PDFs with options to specify page ranges and include metadata.
Full-text search tool supporting regex, case sensitivity, and whole-word matching.
Metadata extraction tool that retrieves PDF properties without reading the content.
OCR recognition tool using Baidu OCR with manual key input.
Automatic OCR tool that reads API credentials from environment variables and runs OCR.