npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gai-mcp-pdf2png

v1.0.0

Published

MCP Server for converting PDF to PNG images page-by-page (memory efficient for large PDFs)

Downloads

13

Readme

gai-mcp-pdf2png

MCP (Model Context Protocol) Server for converting PDF files to PNG images.

Key Feature: Processes pages one at a time, making it memory-efficient for large PDFs.

Installation

npm install -g gai-mcp-pdf2png

Or run directly with npx:

npx gai-mcp-pdf2png

Usage with Claude Code

Add to your Claude Code MCP configuration (~/.claude/claude_desktop_config.json):

{
    "mcpServers": {
        "pdf2png": {
            "command": "npx",
            "args": ["gai-mcp-pdf2png"]
        }
    }
}

Available Tools

convert_pdf_to_png

Convert PDF pages to individual PNG images.

Parameters:

  • pdfPath (required): Absolute path to the PDF file
  • viewportScale (optional): Scale factor for output quality (default: 2.0)
  • startPage (optional): First page to convert (1-indexed)
  • endPage (optional): Last page to convert

Returns:

  • Output directory path (/tmp/{guid})
  • List of generated PNG files
  • Page count and conversion statistics

Example:

{
    "pdfPath": "/path/to/document.pdf",
    "viewportScale": 2.0,
    "startPage": 1,
    "endPage": 10
}

get_page_count

Get the total number of pages in a PDF without converting it.

Parameters:

  • pdfPath (required): Absolute path to the PDF file

Returns:

  • Page count

get_image

Retrieve a converted PNG image as base64 data.

Parameters:

  • imgPath (required): Absolute path to the image (must be in /tmp)

Returns:

  • Base64-encoded image data

ping

Health check endpoint.

Returns:

  • "pong"

Why Page-by-Page?

Traditional PDF converters load the entire document into memory before converting. For large PDFs (100+ pages), this can cause:

  • Out of memory errors
  • Slow processing
  • System instability

This MCP server processes one page at a time:

  1. Gets total page count (lightweight operation)
  2. Converts each page individually
  3. Writes to disk immediately
  4. Releases memory before next page

Output

PNG files are saved to /tmp/{guid}/ with naming convention:

  • page-001.png
  • page-002.png
  • etc.

Logs

Server logs are written to /tmp/gai-mcp-pdf2png.log for debugging.

License

MIT