Skip to main content
Glama

mcp-pandoc: 문서 변환 MCP 서버

공식적으로 모델 컨텍스트 프로토콜 서버 오픈 소스 프로젝트에 포함되었습니다. 🎉

개요

pandoc을 사용하여 문서 형식을 변환하는 모델 컨텍스트 프로토콜 서버입니다. 이 서버는 서식과 구조를 유지하면서 서로 다른 문서 형식 간에 콘텐츠를 변환하는 도구를 제공합니다.

mcp-pandoc은 현재 초기 개발 단계에 있습니다. PDF 지원은 개발 중이며, 서버 개선을 위해 기능 및 사용 가능한 도구가 변경 및 확장될 수 있습니다.

출처: 이 프로젝트에서는 문서 변환을 위해 Pandoc Python 패키지를 사용하여 이 프로젝트의 기반을 형성했습니다.

Related MCP server: md2pdf-mcp

데모

mcp-pandoc - v1: MCP 서버를 사용한 Claude의 원활한 문서 형식 변환

🎥 YouTube에서 시청하세요

더 많은 내용이 나올 예정입니다...

도구

  1. convert-contents

    • 지원되는 형식 간에 콘텐츠를 변환합니다.

    • 입력:

      • contents (문자열): 변환할 소스 콘텐츠(input_file이 제공되지 않은 경우 필수)

      • input_file (문자열): 입력 파일의 전체 경로(내용이 제공되지 않은 경우 필수)

      • input_format (문자열): 콘텐츠의 소스 형식(기본값은 마크다운)

      • output_format (문자열): 대상 형식(기본값은 마크다운)

      • output_file (문자열): 출력 파일의 전체 경로(pdf, docx, rst, latex, epub 형식에 필요)

    • 지원되는 입출력 형식:

      • 가격 인하

      • HTML

      • PDF

      • docx

      • 첫 번째

      • 유액

      • 이펍

      • 텍스트

    • 참고: 고급 형식(pdf, docx, rst, latex, epub)의 경우 output_file 경로가 필요합니다.

지원되는 형식

현재 지원되는 형식:

기본 형식(직접 변환):

  • 일반 텍스트(.txt)

  • 마크다운(.md)

  • HTML(.html)

고급 형식(전체 파일 경로 필요):

  • PDF(.pdf) - TeX Live 설치가 필요합니다.

  • DOCX(.docx)

  • RST(.rst)

  • LaTeX(.tex)

  • EPUB(.epub)

참고: 고급 형식의 경우:

  1. 파일 이름과 확장자를 포함한 전체 파일 경로가 필요합니다.

  2. PDF 변환에는 TeX Live 설치가 필요합니다 (중요 요구 사항 섹션 참조 -> macOS의 경우: brew install texlive )

  3. 출력 경로가 지정되지 않은 경우:

    • 기본 형식: 변환된 콘텐츠를 채팅에 표시합니다.

    • 고급 형식: 시스템 임시 디렉토리(Unix 시스템의 경우 /tmp/)에 저장할 수 있습니다.

사용법 및 구성

게시된 것을 사용하려면

지엑스피1

⚠️ 중요 참고 사항

중요 요구 사항

  1. PDF 변환 전제 조건

    • PDF 변환을 시도하기 전에 TeX Live를 설치해야 합니다.

    • 설치 명령어:

      # Ubuntu/Debian
      sudo apt-get install texlive-xetex
      
      # macOS
      brew install texlive
      
      # Windows
      # Install MiKTeX or TeX Live from:
      # https://miktex.org/ or https://tug.org/texlive/
  2. 파일 경로 요구 사항

    • 파일을 저장하거나 변환할 때 파일 이름과 확장자를 포함한 전체 파일 경로를 제공해야 합니다.

    • 이 도구는 자동으로 파일 이름이나 확장자를 생성하지 않습니다.

예시

✅ 올바른 사용법:

# Converting content to PDF
"Convert this text to PDF and save as /path/to/document.pdf"

# Converting between file formats
"Convert /path/to/input.md to PDF and save as /path/to/output.pdf"

❌ 잘못된 사용:

# Missing filename and extension
"Save this as PDF in /documents/"

# Missing complete path
"Convert this to PDF"

# Missing extension
"Save as /documents/story"

일반적인 문제 및 솔루션

  1. PDF 변환 실패

    • 오류: "xelatex를 찾을 수 없습니다"

    • 해결 방법: 먼저 TeX Live를 설치하세요(위의 설치 명령 참조)

  2. 파일 변환 실패

    • 오류: "잘못된 파일 경로"

    • 해결 방법: 파일 이름과 확장자를 포함한 전체 경로를 제공하세요.

    • 예: /path/to/document.pdf 대신 /path/to/

  3. 형식 변환 실패

    • 오류: "지원되지 않는 형식입니다"

    • 해결 방법: 지원되는 형식만 사용하세요.

      • 기본: txt, html, markdown

      • 고급: pdf, docx, rst, latex, epub

빠른 시작

설치하다

옵션 1: claude_desktop_config.json 구성 파일을 통해 수동으로 설치

  • MacOS의 경우: open ~/Library/Application\ Support/Claude/claude_desktop_config.json

  • Windows의 경우: %APPDATA%/Claude/claude_desktop_config.json

ℹ️ 로컬로 복제한 프로젝트 경로로 바꾸세요

"mcpServers": {
  "mcp-pandoc": {
    "command": "uv",
    "args": [
      "--directory",
      "<DIRECTORY>/mcp-pandoc",
      "run",
      "mcp-pandoc"
    ]
  }
}
"mcpServers": {
  "mcp-pandoc": {
    "command": "uvx",
    "args": [
      "mcp-pandoc"
    ]
  }
}

옵션 2: Smithery를 통해 게시된 서버 구성을 자동으로 설치하려면

Smithery를 통해 Claude Desktop용으로 게시된 mcp-pandoc pypi를 자동으로 설치하려면 다음 bash 명령을 실행하세요.

npx -y @smithery/cli install mcp-pandoc --client claude

참고 : 로컬로 구성된 mcp-pandoc을 사용하려면 위의 "개발/미공개 서버 구성" 단계를 따르세요.

개발

건축 및 출판

배포를 위해 패키지를 준비하려면:

  1. 종속성 동기화 및 잠금 파일 업데이트:

uv sync
  1. 패키지 배포 빌드:

uv build

이렇게 하면 dist/ 디렉토리에 소스와 휠 배포판이 생성됩니다.

  1. PyPI에 게시:

uv publish

참고: 환경 변수나 명령 플래그를 통해 PyPI 자격 증명을 설정해야 합니다.

  • 토큰: --token 또는 UV_PUBLISH_TOKEN

  • 또는 사용자 이름/비밀번호: --username / UV_PUBLISH_USERNAME 및 --password / UV_PUBLISH_PASSWORD

디버깅

MCP 서버는 stdio를 통해 실행되므로 디버깅이 어려울 수 있습니다. 최상의 디버깅 환경을 위해서는 MCP Inspector 사용을 강력히 권장합니다.

다음 명령을 사용하여 npm 통해 MCP Inspector를 시작할 수 있습니다.

npx @modelcontextprotocol/inspector uv --directory /Users/vivekvells/Desktop/code/ai/mcp-pandoc run mcp-pandoc

Inspector를 실행하면 브라우저에서 접근하여 디버깅을 시작할 수 있는 URL이 표시됩니다.


기여하다

mcp-pandoc 개선을 위한 여러분의 참여를 환영합니다! 참여 방법은 다음과 같습니다.

  1. 문제 보고 : 버그를 발견하셨거나 기능 요청이 있으신가요? GitHub 문제 페이지에서 문제를 등록해 주세요.

  2. 풀 리퀘스트 제출 : 풀 리퀘스트를 생성하여 코드베이스를 개선하거나 기능을 추가합니다.


Available Tools

1 tool
convert-contentsA

Converts content between different formats. Transforms input content from any supported format into the specified output format.

🚨 CRITICAL REQUIREMENTS - PLEASE READ:

  1. PDF Conversion:

    • You MUST install TeX Live BEFORE attempting PDF conversion:

    • Ubuntu/Debian: sudo apt-get install texlive-xetex

    • macOS: brew install texlive

    • Windows: Install MiKTeX or TeX Live from https://miktex.org/ or https://tug.org/texlive/

    • PDF conversion will FAIL without this installation

  2. File Paths - EXPLICIT REQUIREMENTS:

    • When asked to save or convert to a file, you MUST provide:

      • Complete directory path

      • Filename

      • File extension

    • Example request: 'Write a story and save as PDF'

    • You MUST specify: '/path/to/story.pdf' or 'C:\Documents\story.pdf'

    • The tool will NOT automatically generate filenames or extensions

  3. File Location After Conversion:

    • After successful conversion, the tool will display the exact path where the file is saved

    • Look for message: 'Content successfully converted and saved to: [file_path]'

    • You can find your converted file at the specified location

    • If no path is specified, files may be saved in system temp directory (/tmp/ on Unix systems)

    • For better control, always provide explicit output file paths

Supported formats:

  • Basic (returned inline): txt, html, markdown, ipynb

  • Advanced (REQUIRE complete file paths): pdf, docx, rst, latex, epub, odt, pptx

  • pptx is WRITE-ONLY: it can be produced, but not used as an input format ✅ CORRECT Usage Examples:

  1. 'Convert this text to HTML' (basic conversion)

    • Tool will show converted content

  2. 'Save this text as PDF at /documents/story.pdf'

    • Correct: specifies path + filename + extension

    • Tool will show: 'Content successfully converted and saved to: /documents/story.pdf'

❌ INCORRECT Usage Examples:

  1. 'Save this as PDF in /documents/'

    • Missing filename and extension

  2. 'Convert to PDF'

    • Missing complete file path

When requesting conversion, ALWAYS specify:

  1. The content or input file

  2. The desired output format

  3. For advanced formats: complete output path + filename + extension Example: 'Convert this markdown to PDF and save as /path/to/output.pdf'

🎨 DOCX, ODT & PPTX STYLING: 4. Custom Styling with Reference Documents:

  • Use reference_doc parameter to apply professional styling to DOCX, ODT and PPTX output

  • The reference document MUST match the output format: .docx for docx, .odt for odt, .pptx for pptx

  • Create custom templates with your branding, fonts, and formatting

  • Perfect for corporate reports, academic papers, and professional documents

  • Example: 'Convert this report to DOCX using /templates/corporate-style.docx as reference and save as /reports/Q4-report.docx'

🎯 PANDOC FILTERS (NEW FEATURE): 5. Pandoc Filter Support:

  • Use filters parameter to apply custom Pandoc filters during conversion

  • Filters are Python scripts that modify document content during processing

  • Perfect for Mermaid diagram conversion, custom styling, and content transformation

  • Example: 'Convert this markdown with mermaid diagrams to DOCX using filters=["./filters/mermaid-to-png-vibrant.py"] and save as /reports/diagram-report.docx'

📋 Creating Reference Documents:

  • Generate template: pandoc -o template.docx --print-default-data-file reference.docx

  • Customize in Word/LibreOffice: fonts, colors, headers, margins

  • Use for consistent branding across all documents

📋 Filter Requirements:

  • Filters must be executable Python scripts

  • Use absolute paths or paths relative to current working directory

  • Filters are applied in the order specified

  • Common filters: mermaid conversion, color processing, table formatting

📄 Defaults File Support (NEW FEATURE): 7. Pandoc Defaults File Support:

  • Use defaults_file parameter to specify a YAML configuration file

  • Similar to using pandoc -d option in the command line

  • Allows setting multiple options in a single file

  • Options in the defaults file can include filters, reference-doc, and other Pandoc options

  • Example: 'Convert this markdown to DOCX using defaults_file="/path/to/defaults.yaml" and save as /reports/report.docx'

Note: After conversion, always check the success message for the exact file location.

ParametersJSON Schema
NameRequiredDescriptionDefault
filtersNoList of Pandoc filter paths to apply during conversion. Filters are applied in the order specified.
contentsNoThe content to be converted (required if input_file not provided)
input_fileNoComplete path to input file including filename and extension (e.g., '/path/to/input.md')
output_fileNoComplete path where to save the output including filename and extension (required for pdf, docx, rst, latex, epub, odt, pptx formats)
input_formatNoSource format of the content (defaults to markdown)markdown
defaults_fileNoPath to a Pandoc defaults file (YAML) containing conversion options. Similar to using pandoc -d option.
output_formatNoDesired output format (defaults to markdown). Note pptx is write-only: it can be produced but not read.markdown
reference_docNoPath to a reference document to use for styling. Supported for docx, odt and pptx output. The file must match the output format: a .docx reference for docx output, .odt for odt, .pptx for pptx.

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It does well by explaining that PDF conversion requires TeX Live, that filenames won't be auto-generated, that files may be saved to temp directory if no path is given, and that pptx is write-only. It also mentions the success message that reveals the saved location. The only minor gap is not explicitly stating whether operations are reversible or if any destructive actions occur, but for a conversion tool, this is less critical.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is excessively long and repetitive. Key information about file paths is repeated multiple times (e.g., in the critical requirements, incorrect usage examples, and the final note). The use of emojis, many sections, and multiple examples makes it hard to scan quickly. While it is front-loaded with the main purpose, the sheer volume undermines conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is highly complete given the tool's complexity. It covers all major usage scenarios, including basic conversions, advanced format path requirements, styling with reference documents, Pandoc filters, and defaults files. It even explains output location and success messages, which is valuable since there is no output schema. The description leaves little room for user confusion about how to proceed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although the schema already provides descriptions for all 8 parameters, the tool description significantly enriches parameter understanding. It explains the purpose and usage of `reference_doc`, `filters`, `defaults_file`, and clarifies the importance of `output_file` for advanced formats. For example, it gives a specific example for using filters with Mermaid diagrams and explains that reference documents must match output format. This adds substantial value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence clearly states the tool's function: 'Converts content between different formats.' This is a specific verb+resource description that distinguishes it from potential alternative tools. The rest of the description reinforces this with supported formats and examples. However, the purpose is somewhat diluted by the extensive additional requirements and feature explanations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit, actionable guidance on when and how to use the tool, including correct and incorrect usage examples, requirements for PDF conversion, and file path specifications. It clearly delineates basic vs. advanced formats and instructs users to always specify content, output format, and complete file paths for advanced formats. This goes beyond mere context to offer concrete usage rules.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 1 tool updatev0.11.1
    • Changedconvert-contents4 fields changed
      • changedInput schema / properties / output_file / description
        Previous value: -"Complete path where to save the output including filename and extension (required for pdf, docx, rst, latex, epub formats)"New value: +"Complete path where to save the output including filename and extension (required for pdf, docx, rst, latex, epub, odt, pptx formats)"
      • changedInput schema / properties / output_format / description
        Previous value: -"Desired output format (defaults to markdown)"New value: +"Desired output format (defaults to markdown). Note pptx is write-only: it can be produced but not read."
      • changedInput schema / properties / output_format / enum
        Previous value: -[
        -  "markdown",
        -  "html",
        -  "pdf",
        -  "docx",
        -  "rst",
        -  "latex",
        -  "epub",
        -  "txt",
        -  "ipynb",
        -  "odt"
        -]New value: +[
        +  "markdown",
        +  "html",
        +  "pdf",
        +  "docx",
        +  "rst",
        +  "latex",
        +  "epub",
        +  "txt",
        +  "ipynb",
        +  "odt",
        +  "pptx"
        +]
      • changedInput schema / properties / reference_doc / description
        Previous value: -"Path to a reference document to use for styling (supported for docx output format)"New value: +"Path to a reference document to use for styling. Supported for docx, odt and pptx output. The file must match the output format: a .docx reference for docx output, .odt for odt, .pptx for pptx."
  2. 1 tool updatev0.8.1
    • Changedconvert-contents3 fields changed
      • addedInput schema / additionalProperties
        Added value: +false
      • removedInput schema / allOf
        Removed value: -[
        -  {
        -    "if": {
        -      "properties": {
        -        "output_format": {
        -          "enum": [
        -            "pdf",
        -            "docx",
        -            "rst",
        -            "latex",
        -            "epub"
        -          ]
        -        }
        -      }
        -    },
        -    "then": {
        -      "required": [
        -        "output_file"
        -      ]
        -    }
        -  }
        -]
      • removedInput schema / oneOf
        Removed value: -[
        -  {
        -    "required": [
        -      "contents"
        -    ]
        -  },
        -  {
        -    "required": [
        -      "input_file"
        -    ]
        -  }
        -]
  3. 1 tool updatev1.0.0
    • First observedconvert-contents

TDQS

A4.4/5.0

Scored across 1 tool

Disambiguation5/5

There is only one tool, so there is no possibility of an agent mistaking it for another. Its purpose is clearly defined as content conversion, with no overlapping tools.

Naming Consistency5/5

Although there is only one tool, the name 'convert-contents' follows a clear verb_noun convention and is semantically appropriate. With no other tools, there are no naming conflicts or mixed conventions.

Tool Count3/5

A single tool for Pandoc conversion feels minimal, though it can cover many conversions through its parameters. It is on the thin side of the acceptable range for a focused converter server.

Completeness5/5

The tool supports conversion across a wide range of formats, including inline returns and file outputs, plus advanced options like reference documents, filters, and defaults files. For a conversion-only server, this covers the domain thoroughly with no obvious operational gaps.

Maintenance

ActivitySlowing
ResponsivenessWithin a week

Related MCP Connectors

Related MCP Servers