@modelcontextprotocol/server-pdf — PDF text extraction and viewing via MCP
Verified first-look: @modelcontextprotocol/server-pdf
Package: npx @modelcontextprotocol/[email protected] Server: PDF Server v2.0.0 Protocol: 2024-11-05 Transport: stdio (requires --stdio flag!) Tools: 9 Capabilities: tools, resources
Tool inventory
listpdfs, readpdfbytes, displaypdf, interact, submitpagedata, submitsavedata, submitviewerstate, pollpdfcommands, save_pdf
Probe results (3 runs, 100% success)
- p50 init: 4116ms
- p50 tool call: 690ms
- Protocol: 2024-11-05 conformant
Verified trace
listpdfs({}) → lists registered PDFs and notes remote HTTPS PDFs can be loaded dynamically readpdf_bytes({url: "https://example.com"}) → returns byte count and offset
Quick start
{"command": "npx", "args": ["@modelcontextprotocol/[email protected]", "--stdio", "/path/to/file.pdf"]}Notes
- MUST pass --stdio flag! Default transport is StreamableHTTP, not stdio
- Can register local files and directories as CLI args
- Supports both local file:// and remote https:// PDFs
- No credentials needed, fully self-contained
- Official @modelcontextprotocol package
Verified recipe
Install and start with a local PDF:
npx @modelcontextprotocol/[email protected] --stdio /path/to/file.pdfOr with a directory:
npx @modelcontextprotocol/[email protected] --stdio /path/to/pdf-directory/MCP config:
{"mcpServers": {"pdf": {"command": "npx", "args": ["@modelcontextprotocol/[email protected]", "--stdio"]}}}Real probe trace (2026-06-14)
Initialize:
- ServerInfo: {name: "PDF Server", version: "2.0.0"}
- Protocol: 2024-11-05
- Capabilities: tools, resources
tools/list → 9 tools
list_pdfs({}) → "Available PDFs: file:///path/to/test.pdf" (34ms) Also notes: "Any remote PDF accessible via HTTPS can also be loaded dynamically."
read_pdf_bytes({url: "https://example.com"}) → "559 bytes at 0/559" (1139ms) Fetches and parses remote PDFs on the fly.
Performance
- 3/3 runs: 100% success
- p50 init: 4116ms
- p50 tool call: 690ms (includes network fetch for remote PDFs)
Critical gotcha: --stdio flag
Without --stdio, the server starts in StreamableHTTP mode (HTTP server on a port). The stdio MCP transport is NOT the default. Source code: if (stdio) { startStdioServer(...) } else { startStreamableHTTPServer(...) }.
Additional flags
- --use-client-roots: allow client to expose local directories
- --enable-interact: enable interactive PDF features
- --debug: enable debug logging
- --writeable-uploads-root: allow upload writes