pdf-spread-viewer

pdf-spread-viewer

A simple MCP server that converts PDF double-page spreads into single images with black borders, simulating book binding/gutter for reviewing book layouts.

Category
Visit Server

README

PDF Spread Viewer MCP Server

A simple MCP (Model Context Protocol) server that converts PDF double-page spreads into single images with black borders, perfect for reviewing book layouts.

Features

  • Convert two consecutive PDF pages into one side-by-side image
  • Add black borders to simulate book binding/gutter
  • High-quality output (200 DPI)
  • Simple stdio-based MCP server (no web server needed)
  • Returns images directly in MCP responses

Installation

Prerequisites

Make sure you have Python 3.7+ and poppler installed:

# macOS
brew install poppler

# Ubuntu/Debian
sudo apt-get install poppler-utils

# Windows
# Download from: https://github.com/oschwartz10612/poppler-windows/releases

Install Python Dependencies

cd ~/projects/pdf-spread-viewer
pip install -r requirements.txt

Or manually:

pip install pdf2image Pillow

Usage

As MCP Server in Cursor

Add to your Cursor MCP configuration:

{
  "mcpServers": {
    "pdf-spread-viewer": {
      "command": "python3",
      "args": ["/Users/rmi/projects/pdf-spread-viewer/server.py"]
    }
  }
}

Then restart Cursor and use the get_spread tool:

Show me pages 14-15 of embers_final.pdf as a double-page spread

Standalone Script

You can also use it as a standalone script:

python3 server.py

Then send JSON-RPC requests via stdin:

{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {}}
{"jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": {}}
{"jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": {"name": "get_spread", "arguments": {"pdf_path": "~/projects/books/dragon-fly/embers_final.pdf", "left_page": 14, "right_page": 15}}}

Tool Parameters

get_spread

Converts two PDF pages into a single side-by-side image.

Parameters:

  • pdf_path (string, required): Path to PDF file (supports ~ for home directory)
  • left_page (integer, required): Left page number (1-based)
  • right_page (integer, required): Right page number (1-based)
  • border_width (integer, optional): Border width in pixels (default: 2)

Returns:

  • PNG image showing both pages side-by-side with black borders

Example Output

The tool creates images that look like this:

┌──────────────────────────────────────────────┐
│  ┌──────────┐ │ ┌──────────┐                │
│  │ Page 14  │ │ │ Page 15  │                │
│  │  (text)  │ │ │  (image) │                │
│  └──────────┘ │ └──────────┘                │
└──────────────────────────────────────────────┘
     Left page      Right page

The black border in the center simulates the book's gutter/binding.

License

MIT License - feel free to use and modify!

Contributing

This is an open-source project. PRs welcome!

Repository: https://github.com/yourusername/pdf-spread-viewer (update with actual URL)

Troubleshooting

Error: "pdf2image not found"

pip install pdf2image Pillow

Error: "poppler not found"

brew install poppler  # macOS

Error: "PDF file not found"

  • Use absolute paths or ~ for home directory
  • Check file exists with ls -la path/to/file.pdf

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured