This PDF Reader MCP server provides tools for extracting text from PDF files, whether stored locally or accessible via URL. It handles various PDF formats and delivers standardized JSON output for seamless integration with your applications.
To set up the PDF Reader MCP server:
git clone https://github.com/trafflux/pdf-reader-mcp.git
cd pdf-reader-mcp
docker build -t mcp/pdf-reader .
To run the server with access to local PDF files:
docker run -i --rm -v /path/to/pdfs:/pdfs mcp/pdf-reader
Replace /path/to/pdfs
with the actual path to your PDF files directory.
If you only need to process PDFs from URLs:
docker run -i --rm mcp/pdf-reader
Add this configuration to your MCP settings:
{
"mcpServers": {
"pdf-reader": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"/path/to/pdfs:/pdfs",
"mcp/pdf-reader"
],
"disabled": false,
"autoApprove": []
}
}
}
For URL-only PDF processing:
{
"mcpServers": {
"pdf-reader": {
"command": "docker",
"args": ["run", "-i", "--rm", "mcp/pdf-reader"],
"disabled": false,
"autoApprove": []
}
}
}
Use the read_local_pdf
tool to extract text from local PDF files:
Input:
{
"path": "/pdfs/document.pdf"
}
Output:
{
"success": true,
"data": {
"text": "Extracted content..."
}
}
Use the read_pdf_url
tool to extract text from PDF files available online:
Input:
{
"url": "https://example.com/document.pdf"
}
Output:
{
"success": true,
"data": {
"text": "Extracted content..."
}
}
The server provides clear error messages for various scenarios:
Error responses follow this format:
{
"success": false,
"error": "Detailed error message"
}
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.