Content
MCP PDF Server is a Model Context Protocol (MCP) based server that efficiently manages PDF files.
This project was created by me, an embedded developer, to allow AI coding tools like Cursor to directly read and summarize PDF datasheet documents, or to facilitate development tasks through Q&A. In other words, the main purpose is to support AI in quickly grasping the content of PDF datasheets and providing the necessary information immediately.
This project consists of two main components:
- **manager_server**: A web page based on FastAPI that allows users to upload or download PDF files through a web UI and provides functionality to view and manage the file list. It also offers a RESTful API for integration with external systems.
- **mcp_server**: Based on the PDF files managed by manager_server, it provides file name search and text extraction functionalities. The extracted text can be integrated with external systems (e.g., Cursor) via the MCP protocol.
Key features:
- PDF text extraction (supports local files and URLs)
- File name based PDF search
- PDF list viewing and management
- Support for web upload/download of PDF files
- Provision of RESTful API and web services
- Integration with external systems (Curator, Cursor, etc.) via MCP protocol
The RESTful API and web UI allow for easy integration with external systems, and it can be easily deployed and operated in both Docker and local environments. It is suitable for automated management and search of various PDF documents such as datasheets, papers, and contracts.
## Key Features
- Text extraction from local PDF files and PDFs accessible via URL
- Provides a list of PDF files under `/app/datasheets`
- Provides PDF search functionality based on file names
- Reliable text extraction and exception handling based on PyPDF2
- Standardized MCP tools based on FastMCP
## Running with Docker
1. **Build the image**
```bash
docker build -t mcp-pdf-server:1.0.0 .
```
2. **Run the container**
```bash
docker run -d \
-v /host/path/data:/app/datasheets \
-p 5050:5050 \
-p 5080:5080 \
--name mcp-pdf-server \
mcp-pdf-server:1.0.0
```
- Place PDF files in `/host/path/data` to access them inside the container at `/app/datasheets`.
- Ports 5050 and 5080 are used.
3. **Using docker-compose**
```bash
# Modify /path/to/your/datasheets in docker-compose.yml to the actual PDF folder path.
docker-compose up -d --build
```
## Running Directly in Local (Python)
1. **Install dependencies**
```bash
pip install -r requirements.txt
```
2. **Run the server**
```bash
python mcp_server/mcp_pdf_server.py
# or
uvicorn manager_server.main:app --host 0.0.0.0 --port 5080
```
## MCP Tool (API) Description
- **read_local_pdf**
Accepts the local PDF file path and extracts text.
- **read_url_pdf**
Accepts the URL of the PDF file and extracts text.
- **server_pdf_list**
Returns a list of all PDF files under `/app/datasheets`.
- **server_pdf_search**
Accepts a file name, searches for the PDF file on the server, and extracts the text of that PDF.
## Path Guidance
- PDF data must be located at the `/app/datasheets` path (inside the Docker container).
- When using Docker, mount the host's PDF folder to `/app/datasheets`.
- The source code is located at `/app/mcp_server` (inside the container).
## License
Apache License 2.0
Author: Dev91
You Might Also Like
MarkItDown MCP
markitdown-mcp is a lightweight MCP server for converting various URIs to Markdown.
Github
GitHub MCP Server connects AI tools to GitHub for code management and automation.

apisix
Apache APISIX is an API Gateway for managing APIs and microservices.
tradingview-mcp
TradingView MCP Server offers real-time market analysis for crypto and stocks.
play-store-mcp
MCP server for managing and deploying Android apps via Google Play Console.
claude_code-multi-AI-MCP
Connect Claude Code to multiple AIs like Gemini and ChatGPT for enhanced assistance.