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

@stacktown/file-converter-mcp

v1.0.0

Published

MCP server for high-quality file conversion with PDF-to-Markdown conversion and Universal Project Documentation Standard support

Readme

File Converter MCP

CI/CD Pipeline npm version License: MIT

A Model Context Protocol (MCP) server that aggregates various file conversion tools for quick formatting and file type transformations.

Features

Supported Conversions

  • PDF to Markdown - Convert PDF documents to markdown format
  • Image Format Conversion - Transform between common image formats (PNG, JPG, WebP, etc.)
  • Document Conversion - Convert between document formats (DOCX, TXT, HTML, etc.)
  • Spreadsheet Conversion - Transform spreadsheet formats (CSV, XLSX, JSON, etc.)
  • Code Format Conversion - Convert between code formats and syntax highlighting
  • Archive Operations - Extract and create archive files (ZIP, TAR, etc.)

Conversion Engines

  • PDF Engine: marker (recommended) and pymupdf4llm support
  • Image Engine: Sharp and ImageMagick integration
  • Document Engine: Pandoc integration for broad format support
  • Archive Engine: Built-in Node.js compression libraries

Installation

npm install -g file-converter-mcp

Dependencies

Install conversion engines based on your needs:

# PDF conversion engines
pip install marker-pdf pymupdf4llm

# Image processing (choose one)
npm install sharp
# OR
brew install imagemagick  # macOS
apt-get install imagemagick  # Ubuntu

# Document conversion
brew install pandoc  # macOS
apt-get install pandoc  # Ubuntu

# Archive tools (usually pre-installed)
# zip, unzip, tar, gzip

Usage

MCP Configuration

Add to your MCP client configuration:

{
  "mcpServers": {
    "file-converter": {
      "command": "file-converter-mcp",
      "args": []
    }
  }
}

Available Tools

PDF Conversion

  • convert_pdf_to_markdown - Convert PDF files to Markdown
  • extract_pdf_text - Extract plain text from PDF files
  • extract_pdf_images - Extract images from PDF files

Image Conversion

  • convert_image_format - Convert between image formats
  • resize_image - Resize images with quality options
  • compress_image - Reduce image file size

Document Conversion

  • convert_document - Convert between document formats using Pandoc
  • extract_document_text - Extract text from various document formats
  • convert_markdown_to_html - Convert Markdown to HTML with styling

Spreadsheet Conversion

  • convert_csv_to_json - Convert CSV data to JSON format
  • convert_json_to_csv - Convert JSON data to CSV format
  • convert_xlsx_to_csv - Extract CSV data from Excel files

Archive Operations

  • create_archive - Create ZIP or TAR archives from files/folders
  • extract_archive - Extract contents from archive files
  • list_archive_contents - List files in archive without extracting

Utility Tools

  • detect_file_type - Identify file format and encoding
  • validate_conversion - Check if conversion is supported
  • batch_convert - Convert multiple files in one operation

Examples

Basic PDF Conversion

// Convert PDF to Markdown
await client.callTool("convert_pdf_to_markdown", {
  input_path: "/path/to/document.pdf",
  output_path: "/path/to/output.md",
  options: {
    engine: "marker",
    preserve_formatting: true
  }
});

Image Format Conversion

// Convert PNG to WebP with compression
await client.callTool("convert_image_format", {
  input_path: "/path/to/image.png",
  output_path: "/path/to/image.webp",
  options: {
    quality: 80,
    format: "webp"
  }
});

Document Conversion

// Convert DOCX to Markdown using Pandoc
await client.callTool("convert_document", {
  input_path: "/path/to/document.docx",
  output_path: "/path/to/document.md",
  options: {
    format: "markdown",
    preserve_styles: false
  }
});

Batch Operations

// Convert multiple files at once
await client.callTool("batch_convert", {
  input_directory: "/path/to/input/",
  output_directory: "/path/to/output/",
  conversions: [
    { from: "pdf", to: "markdown" },
    { from: "png", to: "webp" },
    { from: "docx", to: "txt" }
  ]
});

Configuration Options

Conversion Settings

interface ConversionOptions {
  engine?: string;                    // Conversion engine to use
  quality?: number;                   // Output quality (1-100)
  preserve_formatting?: boolean;      // Maintain original formatting
  output_format?: string;             // Specific output format
  compression_level?: number;         // Compression level (0-9)
  custom_options?: Record<string, any>; // Engine-specific options
}

Supported File Types

Input Formats

  • Documents: PDF, DOCX, DOC, RTF, TXT, HTML, XML
  • Images: PNG, JPG, JPEG, WebP, GIF, BMP, TIFF, SVG
  • Spreadsheets: CSV, XLSX, XLS, JSON, TSV
  • Archives: ZIP, TAR, GZ, 7Z, RAR (extract only)
  • Code: Various programming language files

Output Formats

  • Text: Markdown, HTML, TXT, RTF
  • Images: PNG, JPG, WebP, GIF, BMP
  • Data: JSON, CSV, XML, YAML
  • Archives: ZIP, TAR, GZ

Performance Considerations

  • Memory Usage: Large files are processed in chunks to prevent memory issues
  • Processing Speed: Different engines have different speed/quality tradeoffs
  • Batch Processing: More efficient for multiple file conversions
  • Caching: Converted files can be cached to avoid re-processing

Error Handling

The server provides comprehensive error handling:

  • Input file validation and format detection
  • Graceful fallback between conversion engines
  • Detailed error messages with suggested solutions
  • Progress tracking for long-running conversions

Development

# Clone repository
git clone https://github.com/cordlesssteve/file-converter-mcp.git
cd file-converter-mcp

# Install dependencies
npm install

# Build project
npm run build

# Run development mode
npm run dev

# Run tests
npm test

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add support for new file formats or conversion engines
  4. Add tests for new functionality
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Support