Skip to main content
Glama

mcp-pdf-utils

PDF操作用MCPサーバー。マージ、分割、回転、透かし入れ、テキスト抽出などが可能です。

Claude Desktop、Cursor、VS Code、ChatGPT、およびMCP互換クライアントで動作します。

npm License: MIT


概要

PDF操作は開発者にとって最も一般的なタスクの一つですが、これまで優れたMCPサーバーが存在しませんでした。既存の選択肢は評価が低く、本ツールは実際に動作する実用的なソリューションです。

すべてローカルで実行されます。APIキーは不要です。クラウドサービスも使用しません。PDFがマシンから外部へ送信されることはありません。

Related MCP server: PDF MCP Server

ツール

ツール

説明

pdf_info

メタデータ、ページ数、ファイルサイズを取得

pdf_extract_text

ページからテキストコンテンツを抽出

pdf_merge

複数のPDFを一つに結合

pdf_split

PDFを個別のページファイルに分割

pdf_extract_pages

ページ範囲を指定して新しいPDFとして抽出

pdf_rotate

ページを90度、180度、または270度回転

pdf_add_watermark

テキストの透かしを追加 (例: DRAFT, CONFIDENTIAL)

pdf_delete_pages

特定のページを削除

pdf_reorder

ページの順序を並べ替え

pdf_set_metadata

タイトル、作成者、件名、キーワードを設定

pdf_create

プレーンテキストから新しいPDFを作成

クイックスタート

Claude Desktop

claude_desktop_config.json に以下を追加してください:

{
  "mcpServers": {
    "pdf-tools": {
      "command": "npx",
      "args": ["-y", "mcp-pdf-utils"]
    }
  }
}

以上です。Claude Desktopを再起動し、PDFの操作を依頼してください。

Claude Code

claude mcp add pdf-tools -- npx -y mcp-pdf-utils

Cursor

CursorのMCP設定に以下を追加してください:

{
  "mcpServers": {
    "pdf-tools": {
      "command": "npx",
      "args": ["-y", "mcp-pdf-utils"]
    }
  }
}

VS Code

VS CodeのMCP設定に以下を追加してください:

{
  "mcp": {
    "servers": {
      "pdf-tools": {
        "command": "npx",
        "args": ["-y", "mcp-pdf-utils"]
      }
    }
  }
}

使用例

接続後、AIに自然な言葉で話しかけるだけです:

  • "invoice_jan.pdfとinvoice_feb.pdfをcombined.pdfにマージして"

  • "report.pdfから3〜7ページ目を抽出して"

  • "contract.pdfにCONFIDENTIALという透かしを入れて"

  • "presentation.pdfは何ページありますか?"

  • "scan.pdfの全ページを90度回転させて"

  • "ドキュメントから5ページ目を削除して"

  • "このPDFからすべてのテキストを抽出して"

  • "ページを並べ替えて:3ページ目を最初に、次に1ページ目、その次に2ページ目にして"

開発

git clone https://github.com/zekovdev/mcp-pdf-utils.git
cd mcp-pdf-utils
npm install
npm run dev

MCP Inspectorでのテスト

npm run inspect

これにより公式のMCP Inspectorが開き、すべてのツールを視覚的にテストできます。

仕組み

このサーバーはPDF操作に pdf-lib を、テキスト抽出に pdf-parse を使用しています。どちらも外部依存関係なしでローカルで実行されるため、APIキーやネットワーク通信、クラウドサービスは一切不要です。

通信にはMCP stdioトランスポートを使用しており、AIクライアントがローカルプロセスとしてサーバーを起動し、stdin/stdout経由で対話します。

ロードマップ

  • [ ] PDF圧縮 (ファイルサイズの削減)

  • [ ] PDFからの画像抽出

  • [ ] PDFから画像への変換 (ページサムネイル)

  • [ ] ページ番号の追加

  • [ ] PDF暗号化 / パスワード保護

  • [ ] PDFフォームフィールドへの入力

  • [ ] スキャン済みPDFのOCR (Tesseract経由)

  • [ ] 画像からPDFへの変換

コントリビューション

プルリクエストを歓迎します。提出前に npm run inspect を実行して変更をテストしてください。

ライセンス

MIT

Available Tools

11 tools
pdf_add_watermarkC

Add a text watermark to all or specific pages of a PDF.

Inputs: file (required), output (required), text (required), fontSize, +3 more.

pdf_createC

Create a new PDF document from plain text content.

Inputs: output (required), text (required), title, fontSize.

pdf_delete_pagesC

Delete specific pages from a PDF.

Inputs: file (required), output (required), pages (required).

pdf_extract_pagesB

Extract a range of pages from a PDF into a new PDF file.

Inputs: file (required), output (required), startPage (required), endPage (required).

pdf_extract_textC

Extract text content from a PDF file. Optionally specify page range.

Inputs: file (required), startPage, endPage.

pdf_infoB

Get PDF metadata: page count, title, author, creator, creation date, file size.

Inputs: file (required).

pdf_mergeC

Merge multiple PDF files into a single PDF.

Inputs: files (required), output (required).

pdf_reorderB

Reorder pages of a PDF. Provide the desired page order.

Inputs: file (required), output (required), order (required).

pdf_rotateB

Rotate pages of a PDF by 90, 180, or 270 degrees.

Inputs: file (required), output (required), angle (required), pages.

pdf_set_metadataC

Set or update PDF metadata (title, author, subject, keywords, creator).

Inputs: file (required), output (required), title, author, +3 more.

pdf_splitA

Split a PDF into separate files. Extract specific pages or split into individual page files.

Inputs: file (required), outputDir (required), pages.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 11 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no significant overlap. For example, pdf_extract_pages creates a new PDF from a range, while pdf_split divides into separate files, and pdf_delete_pages removes pages without creating new files. The descriptions specify unique actions on PDFs, making misselection unlikely.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with the prefix 'pdf_' (e.g., pdf_add_watermark, pdf_extract_text). This uniform snake_case naming makes the set predictable and easy to understand, enhancing usability for agents.

    Tool Count5/5

    With 11 tools, the count is well-scoped for PDF manipulation tasks. It covers a comprehensive range of operations without being overwhelming, including creation, editing, extraction, merging, and metadata handling, which aligns perfectly with the server's purpose.

    Completeness5/5

    The tool set provides complete coverage for PDF manipulation, including CRUD-like operations (create, modify, delete pages), metadata management, and advanced features like watermarking and rotation. There are no obvious gaps; agents can perform all common PDF tasks without dead ends.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      An 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.
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      An MCP server for PDF form filling, basic editing, and OCR text extraction. It enables users to merge, rotate, annotate, and sign PDFs, while also supporting text extraction from both searchable and scanned image-based documents.
      15
      Apache 2.0
    • F
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that provides tools for reading, writing, and manipulating PDF files, including text extraction, metadata retrieval, and merging or splitting documents. It also enables users to create PDFs from plain text and convert specific pages or entire documents into images.
      1
      -
    • A
      license
      A
      quality
      B
      maintenance
      A comprehensive MCP server with 37 tools for PDF operations including reading, searching, creating, merging, splitting, watermarking, form filling, and more, built on open-source libraries.
      37
      42 npm
      2
      MIT