Content
# MCP PDF Server
MCP PDF Server is a Model Context Protocol (MCP) based server that efficiently manages PDF files.
This project was created by an embedded developer to make development work more convenient by allowing AI coding tools like Cursor to directly read and summarize PDF datasheet documents or provide Q&A. In other words, the main purpose is to enable AI to quickly grasp the contents of PDF datasheets and provide the necessary information.
This project consists of two main components:
- **manager_server**: A FastAPI-based web page that allows users to upload or download PDF files through a web UI, view and manage file lists. It also provides a RESTful API for interconnection with external systems.
- **mcp_server**: Based on the PDF files managed by manager_server, it provides file name search and text extraction functions. The extracted text can be linked to external systems (e.g., Cursor) through the MCP protocol.
Key Features:
- PDF text extraction (supporting local files and URLs)
- PDF search based on file names
- PDF list inquiry and management
- Web upload/download support for PDF files
- RESTful API and web service provision
- Connection to external systems (Curator, Cursor, etc.) through MCP protocol
It can be easily linked to external systems through RESTful API and web UI, and 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 URLs accessible PDFs
- Providing a list of PDF files under `/app/datasheets`
- PDF search function by file name
- Stable text extraction and exception handling based on PyPDF2
- Standardized MCP tool based on FastMCP
## Running with Docker
1. **Building Image**
```bash
docker build -t mcp-pdf-server:1.0.0 .
```
2. **Running 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 in 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 on Local (Python)
1. **Installing Dependencies**
```bash
pip install -r requirements.txt
```
2. **Running 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**
Extracts text by inputting the local PDF file path.
- **read_url_pdf**
Extracts text by inputting the URL of the PDF file.
- **server_pdf_list**
Returns a list of all PDF files under `/app/datasheets`.
- **server_pdf_search**
Searches for a PDF file on the server by inputting the file name and extracts the text of the PDF.
## Path Guide
- PDF data must be located in 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 in `/app/mcp_server` (inside the container).
## License
Apache License 2.0
Author: Dev91
Connection Info
You Might Also Like
markitdown
Python tool for converting files and office documents to Markdown.
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.
mempalace
The highest-scoring AI memory system ever benchmarked. And it's free.
mempalace
The highest-scoring AI memory system ever benchmarked. And it's free.