Content
# PDF Reader MCP Server
An MCP server for reading PDF files and extracting text content.
## Installation
```bash
cd /path/to/pdfreaderMCP
pip install -r requirements.txt
```
## MCP Configuration
Add the following to your `~/.cursor/mcp.json` or `/root/.cursor/mcp.json`:
```json
{
"mcpServers": {
"pdf-reader": {
"command": "python3",
"args": [
"/absolute/path/to/server.py"
]
}
}
}
```
**Note:** Replace `/absolute/path/to/server.py` with the actual path to your `server.py` file.
## Available Tools
### 1. read_pdf
Reads a PDF file and extracts text content.
**Parameters:**
- `file_path` (required): Path to the PDF file to read
- `page_range` (optional): Page range to read
- `"all"`: All pages (default)
- `"1-5"`: Pages 1 to 5
- `"1,3,5"`: Pages 1, 3, and 5 only
- `"1-3,7,10-12"`: Mixed range
**Example:**
```python
# Read all pages
read_pdf(file_path="/path/to/document.pdf")
# Read specific pages
read_pdf(file_path="/path/to/document.pdf", page_range="1-10")
```
### 2. get_pdf_info
Retrieves PDF metadata information.
**Parameters:**
- `file_path` (required): Path to the PDF file
**Example:**
```python
get_pdf_info(file_path="/path/to/document.pdf")
```
## Features
- ✅ PDF text extraction
- ✅ Page range specification
- ✅ PDF metadata retrieval (title, author, dates, etc.)
- ✅ Unicode support (Korean, Chinese, Japanese, etc.)
## Dependencies
- `mcp>=1.0.0`: Model Context Protocol server library
- `pymupdf>=1.24.0`: PDF processing library (PyMuPDF)
## Troubleshooting
### ImportError: mcp package not found
```bash
pip install mcp
```
### ImportError: fitz (PyMuPDF) not found
```bash
pip install pymupdf
```
## Restart Cursor
After configuration changes, restart Cursor to activate the new MCP server.
## License
MIT License - Free to use, modify, and distribute.
See the [LICENSE](LICENSE) file for details.