PDF to Text MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PDF to Text MCP Serverconvert report.pdf to text"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
📄 PDF to Text MCP Server
A Model Context Protocol (MCP) server for converting PDF files to text, designed for seamless integration with Cursor IDE and other MCP-compatible applications.
🚀 Quick Start
# Clone the repository
git clone https://github.com/xxx87/pdf-to-text-mcp.git
cd pdf-to-text-mcp-server
# Install dependencies
yarn install
# Build the project
yarn build
# Test the server
yarn testRelated MCP server: Mistral OCR MCP Server
✨ Features
📑 Multi-file Support - Convert one or multiple PDF files simultaneously
🔍 Text Extraction - Extract text while preserving document structure
⚡ Fast Processing - Efficient PDF parsing with
pdf-parselibrary🔧 MCP Protocol - Full Model Context Protocol compliance
🎯 Cursor Integration - Designed specifically for Cursor IDE
🛡️ TypeScript - Fully typed for better development experience
✅ Testing - Comprehensive test suite included
📋 Table of Contents
🛠️ Installation
Prerequisites
Node.js 18+
Yarn package manager
Cursor IDE (for MCP integration)
Local Installation
Clone the repository
git clone https://github.com/xxx87/pdf-to-text-mcp.git cd pdf-to-text-mcp-serverInstall dependencies
yarn installBuild the project
yarn buildVerify installation
yarn test
🎯 Usage
Running as Standalone Server
yarn startIntegration with Cursor IDE
Add to Cursor Configuration
Add the following to your Cursor MCP settings:
{ "mcpServers": { "pdf-to-text": { "command": "node", "args": ["/absolute/path/to/pdf-to-text-mcp-server/dist/index.js"], "cwd": "/absolute/path/to/pdf-to-text-mcp-server" } } }⚠️ Important: Replace
/absolute/path/to/pdf-to-text-mcp-serverwith your actual project path.Using in Cursor
Add PDFs: Drag and drop PDF files into Cursor
Convert: Use the
pdf_to_texttool for automatic conversionAnalyze: The extracted text becomes available for AI analysis
Manual MCP Usage
// Example MCP JSON-RPC request
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "pdf_to_text",
"arguments": {
"file_paths": ["document1.pdf", "document2.pdf"]
}
}
}⚙️ Configuration
Environment Variables
Variable | Description | Default |
| Environment mode |
|
| Logging level |
|
Custom Options
The server automatically handles PDF parsing with optimized settings. For custom configurations, modify the pdf-parse options in src/index.ts.
📚 API Reference
Tools
pdf_to_text
Converts PDF files to readable text format.
Parameters:
file_paths(string[]): Array of PDF file paths to convert
Returns:
{
content: [
{
type: "text",
text: string // Extracted text with file separators
}
];
}Example Response:
{
"content": [
{
"type": "text",
"text": "Successfully converted 2 PDF file(s) to text:\n\n=== document1.pdf ===\nExtracted content here...\n\n=== document2.pdf ===\nMore content here..."
}
]
}🏗️ Development
Project Structure
pdf-to-text-mcp-server/
├── src/
│ ├── index.ts # Main MCP server implementation
│ └── types/
│ └── pdf-parse.d.ts # Type definitions
├── dist/ # Compiled JavaScript output
├── test-server.js # Test utilities
├── package.json # Project configuration
├── tsconfig.json # TypeScript configuration
├── cursor-config.json # Example Cursor configuration
└── README.md # This fileAvailable Scripts
Script | Description |
| Compile TypeScript to JavaScript |
| Run the compiled server |
| Run in development mode with hot reload |
| Execute test suite |
| Run code linting |
Building from Source
# Development mode with file watching
yarn dev
# Production build
yarn build
# Run tests
yarn testDependencies
Package | Purpose | Version |
| MCP protocol implementation |
|
| PDF text extraction |
|
| Runtime type validation |
|
| TypeScript compiler |
|
🐛 Troubleshooting
Common Issues
Issue | Cause | Solution |
| Invalid file path | Verify PDF file exists and path is correct |
| Wrong file format | Ensure file has |
Empty text output | Image-based PDF | This tool only extracts text-based content |
Build errors | Missing dependencies | Run |
Debug Mode
Enable verbose logging:
NODE_ENV=development yarn startTesting
Run the comprehensive test suite:
# Run all tests
yarn test
# Test with specific PDF
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "pdf_to_text", "arguments": {"file_paths": ["your-file.pdf"]}}}' | node dist/index.js🤝 Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
Development Setup
Fork the repository
Clone your fork
Create a feature branch:
git checkout -b feature/amazing-featureMake your changes
Test thoroughly:
yarn testCommit changes:
git commit -m 'Add amazing feature'Push to branch:
git push origin feature/amazing-featureOpen a Pull Request
Code Style
Follow existing TypeScript conventions
Add tests for new features
Update documentation as needed
Ensure all tests pass
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
Model Context Protocol for the excellent MCP specification
pdf-parse for reliable PDF text extraction
Cursor IDE for MCP integration support
📞 Support
Issues: GitHub Issues
Discussions: GitHub Discussions
Documentation: Wiki
Made with ❤️ for the MCP community
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/xxx87/pdf-to-text-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server