Skip to main content

MCP server for PDF visual inspection and arXiv source download

Project description

mcp-pdf-vision

An MCP (Model Context Protocol) server for PDF visual inspection and arXiv source download. It allows LLMs to "see" PDF pages as images and retrieve arXiv paper sources.

Features

  • get_pdf_metadata — Get basic PDF information (page count, page size)
  • inspect_pdf_visually — Render PDF pages as inline image items; payloads are base64-encoded JPEGs for visual inspection
  • save_pdf_pages_locally — Render PDF pages into .mcp-pdf-vision/ inside the caller workspace and return the saved image paths
  • download_arxiv_source — Download and extract arXiv paper TeX source by URL or ID

Prerequisites

  • Python >= 3.10
  • Poppler (required by pdf2image)
# macOS
brew install poppler

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

# Windows (via conda)
conda install -c conda-forge poppler

Installation

# Using uv (recommended)
uv pip install mcp-pdf-vision

# Using pip
pip install mcp-pdf-vision

Release

Local publish

# Bump version in pyproject.toml first
rm -rf dist build *.egg-info
python -m pip install -U build twine
python -m build
twine check dist/*
twine upload dist/*

GitHub Actions publish

This repository includes .github/workflows/publish.yml for PyPI Trusted Publishing.

  1. In PyPI, add this GitHub repository as a trusted publisher for mcp-pdf-vision.
  2. Bump version in pyproject.toml.
  3. Push a tag like v0.1.1.
  4. GitHub Actions will build and publish the package automatically.

Usage

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "pdf-vision": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/pdf-vision", "mcp-pdf-vision"]
    }
  }
}

MCP Inspector (for testing)

npx @modelcontextprotocol/inspector uv run mcp-pdf-vision

Direct execution

uv run mcp-pdf-vision

Note: The server uses stdio transport. Running it directly in a terminal will show a JSON parsing error — this is expected. Use an MCP client or the Inspector to interact with it.

Environment Variables

Variable Description
MCP_OUTPUT_DIR Override output directory when the client does not expose usable MCP roots
MCP_DEBUG_IMAGE_DIR Override debug image directory when the client does not expose usable MCP roots
MCP_SAVE_DEBUG_IMAGES Set to 1 to export debug images of rendered PDF pages

download_arxiv_source and debug image export now prefer the client-provided MCP roots (roots/list), so files are written into the caller workspace instead of the server process directory. If the client does not expose roots, the server falls back to MCP_OUTPUT_DIR / MCP_DEBUG_IMAGE_DIR, then PWD / process cwd (useful for stdio clients that launch the server in the active workspace).

Visual Inspection Modes

  • inspect_pdf_visually returns inline MCP image content items. Each item contains a base64-encoded JPEG payload, so the client can inspect the page without creating files.
  • save_pdf_pages_locally writes PNG files directly into <workspace>/.mcp-pdf-vision/ with names like page-1-20260318T123456789012Z.png, then returns the absolute paths for downstream tools or local image viewing.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_pdf_vision-0.1.3.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_pdf_vision-0.1.3-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file mcp_pdf_vision-0.1.3.tar.gz.

File metadata

  • Download URL: mcp_pdf_vision-0.1.3.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.11

File hashes

Hashes for mcp_pdf_vision-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5d8e81f9e30ca790317f654bb24db772226a2833e5c27537f23a26ceb57de23e
MD5 1b8094b821bf44148426828d94c753ca
BLAKE2b-256 7a6b6c6af63af2ea14c45cd88bfc13cf0fde89232ff4945ed73776cc6c848258

See more details on using hashes here.

File details

Details for the file mcp_pdf_vision-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_pdf_vision-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0b5baa2e9948543a84894ee81a9c42b415a6483ae316229764605e197233668a
MD5 f783126baf3835d283b9c295d63d2594
BLAKE2b-256 622af6a0a22f8fa33e4abe6bb5a78cf0b6cf1e51bb90d7ba293535620ab5dba0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page