NanoPDF

السجل الرسمي الإنتاجية

AI-powered PDF editing and generation MCP server using Gemini Pro.

ماذا يمكنك أن تفعل مع NanoPDF؟

  • AI-Driven Editing: Modify PDF slides using natural language prompts.
  • Smart Generation: Create new, visually consistent slides after any page.
  • Visual Previews: View specific PDF pages as high-quality images.
  • Privacy First: All versioning and temporary files are stored locally on your machine.
  • State Preservation: Uses Tesseract OCR to maintain searchable text layers in AI-generated pages.
  • Version Control: Built-in undo functionality for safe experimentation.

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

OCI package docker.io/taibennett/nano-pdf-mcp:0.1.0
Claude Code
claude mcp add nanopdf -e 'GEMINI_API_KEY=<your gemini_api_key>' -- docker run -i --rm docker.io/taibennett/nano-pdf-mcp:0.1.0
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "nanopdf": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "docker.io/taibennett/nano-pdf-mcp:0.1.0"
            ],
            "env": {
                "GEMINI_API_KEY": "<your gemini_api_key>"
            }
        }
    }
}

متغيرات البيئة

  • GEMINI_API_KEY إلزامي سري Google AI Studio API key for Gemini Pro

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. NanoPDF MCP Server
  2. 🚀 Key Features
  3. 📋 Prerequisites
  4. 🛠️ Installation & Setup
  5. 📖 Usage Guide
  6. 📂 Project Structure
  7. 🤝 Acknowledgements
  8. 📄 License

NanoPDF MCP Server

NanoPDF MCP Server is a Model Context Protocol (MCP) implementation that brings AI-powered PDF editing and generation capabilities directly to Claude Desktop. It enables users to modify existing PDF pages or generate new ones using Google's Gemini 3 Pro model, all within a privacy-focused local environment.

🚀 Key Features

  • AI-Driven Editing: Modify PDF slides using natural language prompts.
  • Smart Generation: Create new, visually consistent slides after any page.
  • Visual Previews: View specific PDF pages as high-quality images.
  • Privacy First: All versioning and temporary files are stored locally on your machine.
  • State Preservation: Uses Tesseract OCR to maintain searchable text layers in AI-generated pages.
  • Version Control: Built-in undo functionality for safe experimentation.

📋 Prerequisites

System Dependencies

The server requires poppler (for PDF rendering) and tesseract (for OCR) installed on your system.

  • macOS (Homebrew):
    brew install poppler tesseract
  • Ubuntu/Debian:
    sudo apt-get install poppler-utils tesseract-ocr
Environment Variables

A Google Gemini API key is required to power the AI features.

  • GEMINI_API_KEY: Your Google AI Studio API key.

🛠️ Installation & Setup

1. Development Environment

This project uses uv for lightning-fast Python package management.

# Navigate to the server directory
cd mcp-server

# Install dependencies
uv sync
2. Configure Claude Desktop

Add the NanoPDF server to your Claude Desktop configuration:

Path: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "nanopdf": {
      "command": "/Users/username/.local/bin/uv", # replace with your uv path
      "args": [
        "run",
        "--directory",
        "/Users/username/nano-pdf-mcp/mcp-server", # replace with your mcp-server path
        "server.py"
      ]
    }
  }
}

[!IMPORTANT] Change username to your actual macOS username. Ensure the --directory path is the absolute path to your mcp-server folder.

📖 Usage Guide

For detailed tool descriptions and workflow examples, please refer to the Usage Guide.

Core Workflow
  1. Open PDF: open_pdf(pdf_path="/path/to/document.pdf")
  2. Edit/Add: edit_pdf_page(session_id="...", page_number=1, prompt="...")

📂 Project Structure

  • mcp-server/: Core MCP server implementation.
    • server.py: Main entry point and tool definitions.
    • mcp_pdf_utils.py: PDF processing, OCR, and rendering logic.
    • mcp_ai_utils.py: Gemini Pro Vision API integration.
    • history_manager.py: Local session and version history tracker.
    • output/: Local storage for sessions and previews.
  • LICENSE: Project license (MIT).
  • USAGE.md: Detailed usage instructions and examples.

🤝 Acknowledgements

Based on the original NanoPDF project. Adapted for the Model Context Protocol.

📄 License

MIT License

الأسئلة الشائعة

ما هو NanoPDF؟

AI-powered PDF editing and generation MCP server using Gemini Pro.

كيف أثبّت NanoPDF؟

يعمل على جهازك. في Claude Code: claude mcp add nanopdf -e 'GEMINI_API_KEY=<your gemini_api_key>' -- docker run -i --rm docker.io/taibennett/nano-pdf-mcp:0.1.0. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج NanoPDF إلى مفتاح API؟

نعم. يتطلب GEMINI_API_KEY، وتضبطها في إعداداته.

هل NanoPDF مفتوح المصدر؟

شيفرته علنية على GitHub، لكن المستودع لا يعلن ترخيصًا قياسيًا.

من يصون NanoPDF؟

ينشره R09722akaBennett. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.