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 🙏

© 2025 – Pkg Stats / Ryan Hefner

marker-mcp

v1.0.0

Published

MCP server for Marker PDF document conversion service

Downloads

7

Readme

Marker MCP Server (Node.js)

A Node.js MCP (Model Context Protocol) server wrapper for Marker, enabling AI assistants like Claude to directly convert documents, extract tables, and perform OCR.

🚀 Quick Start with NPX

The easiest way to use Marker MCP server is with NPX (no installation required):

# Run directly with NPX
npx marker-mcp start

# Or with a remote Marker server
npx marker-mcp start --url http://your-marker-server:8000

# Generate Claude Desktop config
npx marker-mcp install-config --local

📦 Installation Methods

1. NPX (Recommended)

No installation needed - run directly:

npx @marker-pdf/mcp-server start

2. Global Installation

npm install -g marker-mcp
marker-mcp start

3. Local Installation

npm install marker-mcp
npx marker-mcp start

4. Docker

# Quick start with Docker
docker run -p 3000:3000 marker-mcp

# Or use Docker Compose
git clone https://github.com/VikParuchuri/marker.git
cd marker/node-mcp
docker-compose up

🔧 Configuration

Environment Variables

# Marker server URL (default: http://localhost:8000)
export MARKER_URL=http://your-marker-server:8000

# GPU configuration (optional)
export CUDA_VISIBLE_DEVICES=0
export TORCH_DEVICE=cuda

# LLM configuration for enhanced processing (optional)
export OLLAMA_BASE_URL=http://localhost:11434
export OLLAMA_MODEL=mistral:7b-instruct
export GOOGLE_API_KEY=your_api_key_here

Claude Desktop Integration

Option 1: Auto-generate config

npx marker-mcp install-config --local

Option 2: Manual config

Add to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%/Claude/claude_desktop_config.json Linux: ~/.config/claude/claude_desktop_config.json

{
  "mcpServers": {
    "marker-pdf": {
      "command": "npx",
      "args": ["marker-mcp", "start", "--local"],
      "env": {
        "CUDA_VISIBLE_DEVICES": "0",
        "TORCH_DEVICE": "cuda"
      }
    }
  }
}

For remote Marker server:

{
  "mcpServers": {
    "marker-pdf": {
      "command": "npx", 
      "args": ["marker-mcp", "start"],
      "env": {
        "MARKER_URL": "http://your-marker-server:8000"
      }
    }
  }
}

🛠️ Available Tools

Once configured, Claude can use these tools:

1. convert_document

Convert documents (PDF, DOCX, PPTX, etc.) to markdown, JSON, or HTML.

Usage: "Convert this PDF to markdown" or "Convert this document to JSON format"

2. extract_tables

Extract tables from documents in various formats.

Usage: "Extract all tables from this PDF as markdown"

3. ocr_document

Perform OCR on scanned documents or images.

Usage: "OCR this scanned document" or "Extract text from this image"

4. start_marker_server

Start a local Marker server (if not running remotely).

Usage: "Start the local Marker server on port 8000"

5. check_marker_status

Check if the Marker server is running and healthy.

Usage: "Check if Marker is running"

🐳 Docker Deployment

Quick Start

# Run with basic setup
docker run -p 3000:3000 -p 8000:8000 marker-mcp

# Run with GPU support
docker run --gpus all -p 3000:3000 -p 8000:8000 marker-mcp

Docker Compose (Production)

git clone https://github.com/VikParuchuri/marker.git
cd marker/node-mcp

# Start basic services
docker-compose up

# Start with LLM support (Ollama)
docker-compose --profile with-llm up

# Production setup with nginx
docker-compose --profile production up

Environment Variables for Docker

Create a .env file:

CUDA_VISIBLE_DEVICES=0
TORCH_DEVICE=cuda
OLLAMA_BASE_URL=http://ollama:11434
OLLAMA_MODEL=mistral:7b-instruct
GOOGLE_API_KEY=your_api_key_here

📋 Command Line Usage

# Start MCP server
marker-mcp start

# Start with local Marker server
marker-mcp start --local --port 8000

# Start with remote Marker server  
marker-mcp start --url http://remote-server:8000

# Run in Docker
marker-mcp docker --port 3000

# Generate Claude config
marker-mcp install-config --remote http://your-server:8000

🔍 Usage Examples

After configuring Claude Desktop, you can ask Claude:

  • "Convert this PDF to markdown" - Converts document to markdown format
  • "Extract tables from this document as JSON" - Extracts structured table data
  • "OCR this scanned document" - Extracts text from images/scans
  • "Convert this PowerPoint to HTML" - Converts presentations
  • "Process only pages 1-5 of this PDF with OCR" - Selective processing

🚀 Remote Deployment Options

1. Cloud Server

Deploy on any cloud provider (AWS, GCP, Azure, etc.):

# On your server
git clone https://github.com/VikParuchuri/marker.git
cd marker/node-mcp
npm install
npm start

2. Docker on Cloud

docker run -d --name marker-mcp -p 80:3000 marker-mcp

3. Kubernetes

apiVersion: apps/v1
kind: Deployment
metadata:
  name: marker-mcp
spec:
  replicas: 1
  selector:
    matchLabels:
      app: marker-mcp
  template:
    metadata:
      labels:
        app: marker-mcp
    spec:
      containers:
      - name: marker-mcp
        image: marker-mcp
        ports:
        - containerPort: 3000

⚡ Performance & GPU Support

For optimal performance:

  1. GPU Support: Set TORCH_DEVICE=cuda and CUDA_VISIBLE_DEVICES=0
  2. Memory: Ensure sufficient RAM (8GB+ recommended)
  3. Storage: Fast SSD storage for model caching
  4. Network: Good bandwidth for downloading models on first run

🛠️ Development

# Clone and install
git clone https://github.com/VikParuchuri/marker.git
cd marker/node-mcp
npm install

# Run in development mode
npm run dev

# Build Docker image
npm run docker:build

# Run tests
npm test

📚 API Reference

The MCP server communicates with Claude through the Model Context Protocol. All tools support:

  • File paths: Local file system paths
  • URLs: Download files from URLs
  • Base64 data: Direct base64 encoded file content

🐛 Troubleshooting

Common Issues

  1. "Marker server is not running"

    • Use marker-mcp start --local to start local server
    • Or set correct MARKER_URL for remote server
  2. "CUDA out of memory"

    • Set TORCH_DEVICE=cpu to use CPU instead
    • Reduce concurrent processing
  3. "Permission denied"

    • Check file permissions
    • Run with appropriate user permissions
  4. Models not downloading

    • Ensure internet connection
    • Check disk space (models require several GB)

Debug Mode

DEBUG=* marker-mcp start

📄 License

GPL-3.0-or-later - Same as Marker

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

📞 Support