The PDF Reader MCP Server by Sylphlab allows you to extract text, metadata, and page information from PDF files, providing a secure way for AI agents to access PDF content within your project context.
Install the package in your project:
pnpm add @sylphlab/pdf-reader-mcp
# Or use npm install or yarn add
Configure your MCP host settings in mcp_settings.json
:
{
"mcpServers": {
"pdf-reader-mcp": {
"command": "npx",
"args": ["@sylphlab/pdf-reader-mcp"],
"name": "PDF Reader (npx)"
}
}
}
Pull the Docker image:
docker pull sylphlab/pdf-reader-mcp:latest
Configure your MCP host to use the Docker container:
{
"mcpServers": {
"pdf-reader-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"/path/to/your/project:/app",
"sylphlab/pdf-reader-mcp:latest"
],
"name": "PDF Reader (Docker)"
}
}
}
Once the server is running and properly configured, you can send MCP requests to extract information from PDF files.
Here's a basic example that retrieves metadata and text from page 2 of a PDF:
{
"tool_name": "read_pdf",
"arguments": {
"sources": [
{
"path": "./documents/my_report.pdf",
"pages": [2]
}
],
"include_metadata": true,
"include_page_count": false,
"include_full_text": false
}
}
The server will respond with structured JSON data:
{
"results": [
{
"source": "./documents/my_report.pdf",
"success": true,
"data": {
"page_texts": [
{ "page": 2, "text": "Text content from page 2..." }
],
"info": { /* PDF information */ },
"metadata": { /* PDF metadata */ }
}
}
]
}
The PDF Reader supports these main configuration options:
You can process multiple PDFs in a single request:
{
"tool_name": "read_pdf",
"arguments": {
"sources": [
{ "path": "./docs/report1.pdf" },
{ "path": "https://example.com/public-document.pdf", "pages": [1,2,3] }
],
"include_metadata": true
}
}
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.