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 images for visual inspection of layout, formatting, and figures
  • 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).

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.2.tar.gz (6.5 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.2-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mcp_pdf_vision-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c4cd641182ed9cd4f75b9211e71455837ce6a94afd5fd8b8c969073dbd50ad6e
MD5 00e71668c47ce1d76633a8b0f0be7436
BLAKE2b-256 1e6f991efa3ef1e4e61834e3d306d61431a91097feeea9259a90fba6d602ee49

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mcp_pdf_vision-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2f3fb6ff64be1923a5b8af9896a4e8c7cbdaf58772fc58b121ff3f449323c196
MD5 30b120cc930f1283ddf4b77db3c6203e
BLAKE2b-256 79574e843de51cff5a7d77ea75aac6662e75bd2d4ddc75cd0488025c35f7abea

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