mcp-server-pdf

command module
v0.0.0-...-5134d04 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

mcp-server-pdf

A Model Context Protocol (MCP) server that exposes PDF operations — text extraction and metadata retrieval — to MCP-compatible clients such as Claude Desktop.

Features

  • Extract text from a PDF (all pages or a specific page)
  • Get metadata from a PDF (title, author, page count, creation date, etc.)

Requirements

  • Go 1.25.1+
  • (Optional) Nix with flakes enabled for a reproducible dev environment

Installation

go install
go install github.com/tkuramot/mcp-server-pdf@latest
Build from source
git clone https://github.com/tkuramot/mcp-server-pdf.git
cd mcp-server-pdf
go build -o mcp-server-pdf .
Using Nix
git clone https://github.com/tkuramot/mcp-server-pdf.git
cd mcp-server-pdf
nix develop
go build -o mcp-server-pdf .

Usage

The server communicates over stdio following the MCP specification. It is not intended to be run directly in a terminal; instead, register it with your MCP client.

Claude Desktop

Add the following to your claude_desktop_config.json:

{
  "mcpServers": {
    "pdf": {
      "command": "/path/to/mcp-server-pdf"
    }
  }
}

Replace /path/to/mcp-server-pdf with the absolute path to the binary.

Tools

extract_text

Extracts plain text content from a PDF file.

Parameter Type Required Description
file_path string yes Absolute or relative path to the PDF file
page number no Page number to extract (1-based). Omit or set to 0 for all pages.

Example response (all pages):

--- Page 1 ---
Lorem ipsum dolor sit amet...

--- Page 2 ---
Consectetur adipiscing elit...
get_metadata

Returns metadata embedded in a PDF file as JSON.

Parameter Type Required Description
file_path string yes Absolute or relative path to the PDF file

Example response:

{
  "title": "Annual Report 2024",
  "author": "Jane Doe",
  "subject": "Finance",
  "keywords": ["finance", "annual"],
  "creator": "Microsoft Word",
  "producer": "Adobe PDF Library",
  "creation_date": "2024-01-15T09:00:00Z",
  "modification_date": "2024-03-01T12:00:00Z",
  "page_count": 42
}

Development

# Run tests
go test ./...

# Lint
go vet ./...

With Nix:

nix develop

Dependencies

Package Purpose
mark3labs/mcp-go MCP server framework
ledongthuc/pdf PDF text extraction
pdfcpu/pdfcpu PDF metadata reading

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL