MF

maitreyam/file-converter-mcp

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

7 stars 7 forks 품질 43 트렌드 15

A Python-based MCP (Model Context Protocol) server powered by FastMCP that leverages Pandoc for flexible document conversion between various formats (Markdown, DOCX, PDF, HTML, etc.

개요

A Python-based MCP (Model Context Protocol) server that provides powerful document conversion capabilities via Pandoc. This server allows AI agents (like Claude via LangChain/LangGraph) to request file conversions between various formats such as Markdown, DOCX, HTML, PDF, EPUB, and many more. * A Python library for easily creating MCP servers. * A Python wrapper around the Pandoc command-line tool. * The universal document converter. * For containerized deployment, bundling all dependencies (Python, Pandoc, LaTeX). * Exposes a single MCP tool: convert_document. * Supports a wide range of input and output formats handled by Pandoc. * Allows specifying input format (if auto-detection fails) and output format. * Supports passing extra command-line arguments to Pandoc for advanced control (e.g., Table of Contents, PDF margins, standalone files).

README

원문 README의 일부입니다. 원문 보기.

Pandoc MCP Server

A Python-based MCP (Model Context Protocol) server that provides powerful document conversion capabilities via Pandoc. This server allows AI agents (like Claude via LangChain/LangGraph) to request file conversions between various formats such as Markdown, DOCX, HTML, PDF, EPUB, and many more.

This project uses:

  • FastMCP: A Python library for easily creating MCP servers.
  • pypandoc: A Python wrapper around the Pandoc command-line tool.
  • Pandoc: The universal document converter.
  • (Optional) Docker: For containerized deployment, bundling all dependencies (Python, Pandoc, LaTeX).

Features

  • Exposes a single MCP tool: convert_document.
  • Supports a wide range of input and output formats handled by Pandoc.
  • Allows specifying input format (if auto-detection fails) and output format.
  • Supports passing extra command-line arguments to Pandoc for advanced control (e.g., Table of Contents, PDF margins, standalone files).
  • Includes Docker configuration (Dockerfile) for creating a self-contained server environment including Pandoc and necessary LaTeX components for PDF generation.
  • Designed for integration with MCP clients, particularly LangChain/LangGraph agents.

Exposed MCP Tool

convert_document

Converts a document from one format to another using Pandoc.

Arguments:

  • input_file_path (str, required): The path accessible by the server to the input document file. If running in Docker with a volume mount, this should be the path inside the container (e.g., /data/my_doc.docx).
  • output_file_path (str, required): The path accessible by the server where the converted output file should be saved. If running in Docker, this should be the path inside the container (e.g., /data/my_output.pdf). The directory will be created if it doesn’t exist within the server’s accessible filesystem.
  • to_format (str, required): The target format for the conversion (e.g., ‘markdown’, ‘docx’, ‘pdf’, ‘html’, ‘rst’, ‘epub’). See Pandoc documentation for a full list (--list-output-formats).
  • from_format (str, optional): The format of the input file. If None, pandoc will try to guess from the file extension. Specify if the extension is ambiguous or missing (e.g., ‘md’, ‘docx’, ‘html’). Defaults to None.
GitHub에서 전체 README 보기

설치

npx -y @smithery/cli install @MaitreyaM/file-converter-mcp --client claude
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →