MCP PDF Server
📄 MCP PDF サーバー
FastMCPをベースにした PDF ファイル読み取りサーバー。
PDF テキスト抽出、OCR 認識、MCP プロトコル経由の画像抽出をサポートし、テストを簡単に行うための Web デバッガーが組み込まれています。
🚀 機能
PDFテキストを読む
PDF から通常のテキストを抽出します (ページごとに)。OCRによる読み取り
OCR を使用して、スキャンされた PDF または画像ベースの PDF からテキストを認識します。PDF画像を読む
指定された PDF ページからすべての画像を抽出します (Base64 エンコードされた出力)。
Related MCP server: PDF Reader MCP Server
📂 プロジェクト構造
mcp-pdf-server/
├── pdf_resources/ # Directory for uploaded and processed PDF files
├── txt_server.py # Main server entry point
└── README.md # Project documentation⚙️ インストール
推奨される Python バージョン: 3.9 以上
pip install pymupdf mcp注意: OCR 機能を使用するには、OCR サポートまたは外部 OCR ライブラリを備えた MuPDF ビルドが必要になる場合があります。
🔦 サーバーを起動する
次のコマンドを実行します。
python txt_server.py次のようなログが表示されます。
Serving on http://127.0.0.1:6231🌐 Webデバッグインターフェース
ブラウザを開いて次のサイトにアクセスしてください:
http://127.0.0.1:6231左パネルからツールを選択します
右側のパネルにパラメータを入力します
「実行」をクリックしてツールをテストします
コーディングは不要で、Web UI 経由で簡単にデバッグおよびテストできます。
🛠️ APIツールリスト
道具 | 説明 | 入力パラメータ | 返品 |
| PDFページから通常のテキストを抽出します |
| ページテキストのリスト |
| OCRでテキストを認識する |
| OCRで抽出したテキスト |
| PDFページから画像を抽出します |
| 画像リスト(Base64エンコード) |
📝 使用例
1 ページから 5 ページまでのテキストを抽出します。
mcp run read_pdf_text --args '{"file_path": "pdf_resources/example.pdf", "start_page": 1, "end_page": 5}'1ページでOCR認識を実行します。
mcp run read_by_ocr --args '{"file_path": "pdf_resources/example.pdf", "start_page": 1, "end_page": 1, "language": "eng"}'ページ 3 からすべての画像を抽出します。
mcp run read_pdf_images --args '{"file_path": "pdf_resources/example.pdf", "page_number": 3}'📢 注意事項
ファイルは
pdf_resources/ディレクトリ内に配置するか、絶対パスを指定する必要があります。OCR 機能を使用するには、環境内で適切な OCR サポートが必要です。
大きなファイルを処理する場合は、必要に応じてメモリとタイムアウトの設定を調整します。
📜 ライセンス
このプロジェクトは MIT ライセンスに基づいてライセンスされています。
商用利用の場合は、元の出典を明記してください。
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for detecting and redacting PII (Personally Identifiable Information) in PDF documents.
MCP server for the PDFGate API. Generate PDFs, manage documents and handle e-signatures.
Hosted MCP server: convert PDFs to clean, LLM-ready Markdown with tables, formulas and OCR.
MCP server for Api2Pdf — generate PDFs & images from HTML, URLs or office files; merge, barcodes.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn MCP server that provides comprehensive PDF processing capabilities including text extraction, image extraction, table detection, annotation extraction, metadata retrieval, page rendering, and document structure analysis.-
- FlicenseAqualityNot gradedmaintenanceA Model Context Protocol server that extracts and processes content from PDF documents, providing text extraction, metadata retrieval, page-level processing, and PDF validation capabilities.41-
- FlicenseNot gradedqualityDmaintenanceMCP server for extracting text from PDF files, supporting local files and URLs.-
- AlicenseNot gradedqualityDmaintenanceMCP server to read protected (or unprotected) PDF files, extracting text to a temp file, and handling large PDFs.250 PyPI11MIT