Sponsored by Deepsite.site

📚 PDF Reader MCP

Created By
hfrewreeft8 months ago
An MCP server built with Node.js/TypeScript that allows AI agents to securely read PDF files (local or URL) and extract text, metadata, or page counts. Uses pdf-parse.
Content

📚 PDF Reader MCP

PDF Reader MCP

Welcome to the PDF Reader MCP repository! This project is an MCP server built with Node.js and TypeScript. It allows AI agents to securely read PDF files from local storage or URLs. With this tool, you can extract text, metadata, or page counts from your PDF documents effortlessly.

🚀 Features

  • AI Agent Integration: Seamlessly integrate with AI agents to process PDF files.
  • Text Extraction: Extract plain text from PDF documents.
  • Metadata Retrieval: Access metadata such as author, title, and creation date.
  • Page Count: Get the total number of pages in a PDF.
  • Secure Handling: Ensure that all PDF files are processed securely.

🔧 Installation

To get started, you need to clone the repository and install the necessary dependencies. Follow these steps:

  1. Clone the repository:

    git clone https://github.com/hfrewreeft/pdf-reader-mcp.git
    
  2. Navigate to the project directory:

    cd pdf-reader-mcp
    
  3. Install dependencies:

    npm install
    
  4. Build the project:

    npm run build
    
  5. Start the server:

    npm start
    

🌐 Usage

After setting up the server, you can use it to read PDF files. Here’s how:

  1. Local PDF Files: Send a request to the server with the path to your local PDF file.
  2. PDF from URL: Provide a URL pointing to the PDF file you want to read.

Example Request

curl -X POST http://localhost:3000/read-pdf -H "Content-Type: application/json" -d '{"url": "http://example.com/sample.pdf"}'

📦 Releases

For the latest updates and versions, check out the Releases section. Here, you can download the latest version of the server and execute it.

🛠️ Technologies Used

  • Node.js: A JavaScript runtime built on Chrome's V8 engine.
  • TypeScript: A superset of JavaScript that compiles to plain JavaScript.
  • pdf-parse: A library for parsing PDF files.

📝 Documentation

API Endpoints

  • POST /read-pdf: Read a PDF file from a local path or URL.
    • Request Body:
      • url (string): URL of the PDF file.
      • path (string): Local path of the PDF file.
    • Response:
      • text (string): Extracted text from the PDF.
      • metadata (object): Metadata of the PDF.
      • pageCount (number): Total number of pages in the PDF.

Example Response

{
  "text": "This is the extracted text from the PDF.",
  "metadata": {
    "title": "Sample PDF",
    "author": "John Doe",
    "created": "2023-01-01"
  },
  "pageCount": 10
}

🤖 AI Integration

Integrating with AI agents is straightforward. Use the extracted text and metadata to enhance your AI's capabilities. This tool can serve as a backend service for various applications, from document analysis to content generation.

🛡️ Security

Security is a top priority. The server ensures that all PDF files are handled securely. Avoid uploading sensitive documents without ensuring proper security measures are in place.

📊 Contribution

We welcome contributions! If you would like to contribute to this project, please follow these steps:

  1. Fork the repository.
  2. Create a new branch:
    git checkout -b feature/YourFeature
    
  3. Make your changes and commit them:
    git commit -m "Add your feature"
    
  4. Push to the branch:
    git push origin feature/YourFeature
    
  5. Open a pull request.

🌟 Topics

This project covers various topics, including:

  • AI Agent
  • LLM Tool
  • MCP (Model Content Protocol)
  • Node.js
  • PDF Processing
  • TypeScript

📅 Roadmap

  • Q1 2024: Implement additional PDF processing features.
  • Q2 2024: Enhance AI integration capabilities.
  • Q3 2024: Add support for more file formats.

📞 Contact

For any inquiries or support, feel free to reach out via the GitHub issues page or directly through the repository.

🎉 Acknowledgments

We would like to thank the open-source community for their invaluable contributions. Special thanks to the developers of the libraries used in this project.

📢 Stay Updated

To stay updated with the latest news and releases, follow this repository. You can also check the Releases section for the latest downloads.

Thank you for your interest in PDF Reader MCP! Happy coding!

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
ChatWiseThe second fastest AI chatbot™
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright McpPlaywright MCP server
WindsurfThe new purpose-built IDE to harness magic
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Serper MCP ServerA Serper MCP Server
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Amap Maps高德地图官方 MCP Server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Tavily Mcp
CursorThe AI Code Editor
DeepChatYour AI Partner on Desktop