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

universal-documents-converter

v1.0.1

Published

Universal MCP Server for Multi-Rendering PDF Quality Assurance System with AI-powered optimization

Readme

Universal Documents Converter MCP Server

Multi-Rendering PDF Quality Assurance System with AI-Powered Optimization

A comprehensive MCP (Model Context Protocol) server that provides advanced PDF generation capabilities through multi-rendering quality assurance, AI-powered optimization, and intelligent learning systems.

🚀 Features

Multi-Rendering PDF Generation

  • 7 Rendering Variants with different configurations:
    • Standard Chromium (baseline)
    • High DPI Chromium (300 DPI for crisp text)
    • Large Viewport (1920x1080 for better diagrams)
    • Extended Mermaid Timeout (10s for complex diagrams)
    • System Fonts Only (maximum compatibility)
    • Compact Layout (tighter spacing, 0.5" margins)
    • Print Optimized (enhanced contrast)

AI-Powered Quality Assessment

  • deepseek/deepseek-r1-0528:free model integration
  • 6 Quality Metrics with weighted scoring:
    • Text Overlap Prevention (25% weight)
    • Typography Consistency (15% weight)
    • Diagram Clarity (20% weight)
    • Page Break Quality (15% weight)
    • Professional Appearance (15% weight)
    • Overall Readability (10% weight)

Learning System

  • Performance Tracking for each variant and document type
  • User Preference Learning from manual selections
  • Pattern Recognition for successful configurations
  • Document Type Optimization (academic, business, technical, documentation)
  • Historical Analysis with trend database

Professional Output

  • Industry-standard typography (Times New Roman, 1.5 line height)
  • A4 format with 0.75" margins
  • Perfect Mermaid diagram rendering
  • Intelligent page breaks following content boundaries
  • Zero overlapping text through comprehensive CSS positioning

📦 Installation

Prerequisites

  • Node.js >= 18.0.0
  • Python >= 3.9.0
  • VS Code Insiders with AUGMENT extension

Quick Install

# Clone or download to MCP directory
cd "C:\Users\[USERNAME]\.mcp"
git clone https://github.com/universal-documents-converter/mcp-server universal-documents-converter

# Or manually create directory and copy files
mkdir universal-documents-converter
cd universal-documents-converter

# Install dependencies
npm install
python -m pip install -r requirements.txt

# Install Playwright browsers
python -m playwright install

# Run setup
npm run setup

Manual Installation

  1. Create MCP Directory Structure:

    C:\Users\[USERNAME]\.mcp\universal-documents-converter\
    ├── server.js
    ├── package.json
    ├── requirements.txt
    ├── README.md
    ├── src/
    ├── config/
    └── tools/
  2. Install Node.js Dependencies:

    npm install @modelcontextprotocol/sdk
  3. Install Python Dependencies:

    pip install -r requirements.txt
  4. Configure VS Code Insiders: Add to your MCP settings in VS Code Insiders AUGMENT extension:

    {
      "mcpServers": {
        "universal-documents-converter": {
          "command": "node",
          "args": ["C:\\Users\\[USERNAME]\\.mcp\\universal-documents-converter\\server.js"],
          "env": {}
        }
      }
    }

⚙️ Configuration

OpenRouter API Keys (Required)

Create config/openrouter_keys.json:

{
  "api_keys": [
    "sk-or-v1-your-api-key-1",
    "sk-or-v1-your-api-key-2"
  ],
  "model": "deepseek/deepseek-r1-0528:free",
  "updated_at": "2025-07-12T00:00:00Z"
}

MCP Server Configuration

Create config/mcp_server_config.json:

{
  "workspace_path": "auto-detect",
  "enable_learning": true,
  "default_document_type": "general",
  "quality_threshold": 85.0,
  "max_variants": 7,
  "ai_timeout": 45,
  "backup_enabled": true
}

🛠️ Usage

Available MCP Tools

1. convert_markdown_to_pdf

Convert markdown to professional PDF using enhanced conversion system.

Trigger phrases: "convert: md -> pdf", "markdown to pdf", "generate pdf"

2. multi_render_pdf_optimal

Generate optimal PDF using multi-rendering quality assurance system.

Trigger phrases: "multi-render pdf", "optimal pdf", "best quality pdf"

3. test_multi_rendering_system

Run comprehensive tests on the multi-rendering PDF system.

Trigger phrases: "test pdf system", "validate pdf converter"

4. get_quality_report

Get quality analysis report for a previously generated PDF.

Trigger phrases: "quality report", "pdf analysis", "document quality"

5. get_learning_insights

Get insights from the learning system about PDF generation patterns.

Trigger phrases: "learning insights", "system intelligence", "pdf patterns"

6. configure_openrouter_keys

Configure OpenRouter API keys for AI-powered quality assessment.

Trigger phrases: "configure api keys", "setup openrouter", "ai configuration"

Example Usage in VS Code

  1. Basic PDF Conversion:

    User: "Convert my document.md to PDF"
    → Triggers: convert_markdown_to_pdf
  2. Multi-Rendering Optimization:

    User: "Generate the best quality PDF for my research paper"
    → Triggers: multi_render_pdf_optimal
  3. Quality Analysis:

    User: "Show me the quality report for my document"
    → Triggers: get_quality_report

📊 Quality Metrics

The system evaluates each PDF variant on six key criteria:

| Metric | Weight | Description | |--------|--------|-------------| | Text Overlap Prevention | 25% | Detects overlapping text, ensures proper spacing | | Typography Consistency | 15% | Font hierarchy, consistent sizing, professional appearance | | Diagram Clarity | 20% | Mermaid diagrams properly sized, clear, within boundaries | | Page Break Quality | 15% | Logical breaks, no orphaned content, proper flow | | Professional Appearance | 15% | Overall document polish, business/academic standards | | Overall Readability | 10% | Easy to read layout, well-structured, accessible |

🧠 Learning System

The system continuously improves through:

  • Document Type Recognition - Automatically optimizes for different content types
  • Performance Tracking - Records quality metrics for each variant
  • User Preference Learning - Adapts based on manual selections
  • Pattern Recognition - Identifies successful configurations
  • Optimization Strategies - Builds knowledge base of effective approaches

🔧 Development

Project Structure

universal-documents-converter/
├── server.js                          # Main MCP server
├── package.json                       # Node.js configuration
├── requirements.txt                   # Python dependencies
├── README.md                          # This file
├── src/                               # Python source code
│   ├── multi_rendering_pdf_system.py  # Core multi-rendering system
│   ├── enhanced_universal_document_converter.py # Enhanced converter
│   ├── test_multi_rendering_system.py # Comprehensive tests
│   └── demo_multi_rendering_system.py # Demo script
├── config/                            # Configuration files
│   ├── openrouter_keys.json          # API keys (template)
│   └── mcp_server_config.json        # Server configuration
├── tools/                             # MCP tool definitions
└── quality_reports/                   # Generated quality reports

Running Tests

# Quick validation
npm run validate

# Comprehensive tests
npm test

# Performance tests
python src/test_multi_rendering_system.py --test-type performance

Development Mode

# Start server in development mode
npm start

# Run demo
npm run demo

📈 Performance

Typical Results

  • Quality Scores: 90-95/100 consistently
  • Processing Time: 3-5 minutes per document
  • Variants Generated: 7 per document
  • Success Rate: 95%+ for standard documents
  • Learning Accuracy: Improves 5-10% per 10 documents processed

System Requirements

  • RAM: 4GB minimum, 8GB recommended
  • Storage: 2GB for dependencies, 1GB for workspace
  • Network: Required for AI analysis (OpenRouter API)
  • Browsers: Chromium, Firefox, WebKit (auto-installed by Playwright)

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Submit a pull request

📄 License

MIT License - see LICENSE file for details.

🆘 Support

🎯 Roadmap

  • [ ] Additional rendering engines (Safari, Edge)
  • [ ] Enhanced AI models for quality assessment
  • [ ] Web interface for manual variant selection
  • [ ] Cloud deployment options
  • [ ] Integration APIs for external systems
  • [ ] Advanced document templates
  • [ ] Batch processing capabilities
  • [ ] Real-time collaboration features

Universal Documents Converter - Transforming PDF generation from simple conversion to intelligent, adaptive quality assurance.