Pandoc Document Conversion

A Model Context Protocol server for document format conversion using pandoc.

Overview

A Model Context Protocol server for document format conversion using Pandoc. This server provides tools to transform content between different document formats while preserving formatting and structure.

Please note that mcp-pandoc is currently in early development. PDF support is under development, and the functionality and available tools are subject to change and expansion as we continue to improve the server.

Tools

  1. convert-contents
    • Transforms content between supported formats
    • Inputs:
      • contents (string): Source content to convert (required if input_file not provided)
      • input_file (string): Complete path to input file (required if contents not provided)
      • input_format (string): Source format of the content (defaults to markdown)
      • output_format (string): Target format (defaults to markdown)
      • output_file (string): Complete path for output file (required for pdf, docx, rst, latex, epub formats)
    • Supported input/output formats:
      • markdown
      • html
      • pdf
      • docx
      • rst
      • latex
      • epub
      • txt
    • Note: For advanced formats (pdf, docx, rst, latex, epub), an output_file path is required

Supported Formats

Currently supported formats:

Basic formats (direct conversion):

  • Plain text (.txt)
  • Markdown (.md)
  • HTML (.html)

Advanced formats (requires complete file paths):

  • PDF (.pdf) - requires TeX Live installation
  • DOCX (.docx)
  • RST (.rst)
  • LaTeX (.tex)
  • EPUB (.epub)

⚠️ Important Notes

Critical Requirements

  1. PDF Conversion Prerequisites

    • TeX Live must be installed before attempting PDF conversion
  2. File Path Requirements

    • When saving or converting files, you MUST provide complete file paths including filename and extension

Common Issues and Solutions

  1. PDF Conversion Fails

    • Error: "xelatex not found"
    • Solution: Install TeX Live first
  2. File Conversion Fails

    • Error: "Invalid file path"
    • Solution: Provide complete path including filename and extension
  3. Format Conversion Fails

    • Error: "Unsupported format"
    • Solution: Use only supported formats:
      • Basic: txt, html, markdown
      • Advanced: pdf, docx, rst, latex, epub

Quickstart

Configuration Example

Contributing

We welcome contributions to enhance mcp-pandoc! Here's how you can get involved:

  1. Report Issues: Found a bug or have a feature request? Open an issue on our GitHub Issues page.
  2. Submit Pull Requests: Improve the codebase or add features by creating a pull request.

Installation

Install Command

Integrate this tool for Claude Desktop.

Report Bug

Server Statistics

UsageUsed 546 times last month
LicenseMIT
LocalNo
Published12/19/2024