Skip to main content
Glama

markdown2pdf-mcp

by 2b3pro

Markdown2PDF MCP サーバー (markdown2pdf-mcp)

Markdown文書をPDFファイルに変換するためのMCPサーバーです。このサーバーは、構文のハイライトとカスタムスタイルをサポートし、MarkdownコンテンツからPDFを生成するためのシンプルかつ効率的な方法を提供します。また、1ページ目に透かしを入れることも可能です。

Alan Shaw のmarkdown-pdfに触発されました。

特徴

  • 1つのコマンドでMarkdownをPDFに変換する
  • コードブロックの構文強調表示
  • PDF出力のカスタムCSSスタイル
  • 標準的なMarkdownフォーマットのサポート
  • Chrome のレンダリング エンジンを使用した最新の PDF 生成
  • 最新のWeb機能とフォントの優れたサポート
  • 信頼性の高いリソースの読み込みとレンダリング

制限事項

次のマークダウン要素はサポートされていません。

  • LaTeXの数式(例: $x^2$または$$\sum_{i=1}^n x_i$$
  • 複雑な数式や科学的記法

サポートされている次のマークダウン要素に従ってください。

  • ヘッダー(全レベル)
  • テキストの書式設定(太字、斜体、取り消し線)
  • リスト(順序付きと順序なし)
  • 構文強調表示付きのコードブロック
  • テーブル
  • 引用ブロック
  • リンク
  • 画像(ローカルファイルと外部 URL の両方)
  • タスクリスト

インストール

# Clone the repository git clone https://github.com/2b3pro/markdown2pdf-mcp.git # Navigate to the project directory cd markdown2pdf-mcp # Install dependencies npm install # Build the project npm run build

使用法

サーバーの起動

npm start

MCPツールの使用

サーバーは、次のパラメータを持つ単一のツールcreate_pdf_from_markdownを提供します。

{ // Required parameters markdown: string; // Markdown content to convert // Optional parameters with defaults outputFilename?: string; // Filename for the PDF (e.g., "output.pdf") paperFormat?: string; // 'letter' (default), 'a4', 'a3', 'a5', 'legal', 'tabloid' paperOrientation?: string; // 'portrait' (default), 'landscape' paperBorder?: string; // '2cm' (default), accepts decimal values with CSS units (e.g., '1.5cm', '2.5mm', '0.5in', '10.5px') watermark?: string; // Optional watermark text (max 15 characters, uppercase) }

オプション付きの例:

await use_mcp_tool({ server_name: "markdown2pdf", tool_name: "create_pdf_from_markdown", arguments: { markdown: "# Hello World\n\nThis is a test document.", outputFilename: "output.pdf", paperFormat: "a4", paperOrientation: "landscape", paperBorder: "1.5cm", watermark: "DRAFT", }, });

最小限の使用例:

await use_mcp_tool({ server_name: "markdown2pdf", tool_name: "create_pdf_from_markdown", arguments: { markdown: "# Hello World\n\nThis is a test document.", outputFilename: "output.pdf", }, });

構成

出力ディレクトリ

ClineやClaudeなど、MCPを使用するアプリでは、MCP設定ファイルで出力ディレクトリを設定できます。設定されていない場合は、ファイルは$HOMEに保存されます。

{ "mcpServers": { "markdown2pdf": { "command": "node", "args": ["path/to/markdown2pdf-mcp/build/index.js"], "env": { "M2P_OUTPUT_DIR": "/path/to/output/directory" } } } }

ツールは、増分番号を追加することでファイル名の競合を自動的に処理します (例: output.pdf、output-1.pdf、output-2.pdf)。

依存関係

Chromeバージョン

このパッケージは、すべてのインストールで一貫したPDF生成を実現するために、Chrome v131.0.6778.204を使用しています。このバージョンは、 npm install実行すると自動的にインストールされます。

  • tmp - 一時ファイルの処理

発達

# Build the project npm run build # Start the server npm start

ライセンス

マサチューセッツ工科大学

貢献

  1. リポジトリをフォークする
  2. 機能ブランチを作成します( git checkout -b feature/amazing-feature
  3. 変更をコミットします ( git commit -m 'Add some amazing feature' )
  4. ブランチにプッシュする ( git push origin feature/amazing-feature )
  5. プルリクエストを開く

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

Markdown ドキュメントを PDF ファイルに変換するための MCP サーバー。

  1. 特徴
    1. 制限事項
      1. インストール
        1. 使用法
          1. サーバーの起動
          2. MCPツールの使用
        2. 構成
          1. 出力ディレクトリ
        3. 依存関係
          1. Chromeバージョン
            1. 発達
              1. ライセンス
                1. 貢献

                  Related MCP Servers

                  • A
                    security
                    A
                    license
                    A
                    quality
                    MCP server for seamless document format conversion using Pandoc, supporting Markdown, HTML, PDF, DOCX (.docx), csv and more.
                    Last updated -
                    1
                    212
                    Python
                    MIT License
                    • Apple
                  • A
                    security
                    A
                    license
                    A
                    quality
                    MCP server for collecting code from files and directories into a single markdown document.
                    Last updated -
                    2
                    4
                    Python
                    MIT License
                  • A
                    security
                    A
                    license
                    A
                    quality
                    Converts various file formats to Markdown using the MarkItDown utility and can be integrated with MCP clients for seamless document processing and conversion.
                    Last updated -
                    26
                    Python
                    MIT License
                  • -
                    security
                    A
                    license
                    -
                    quality
                    An MCP server that provides multiple file conversion tools for AI agents, supporting various document and image format conversions including DOCX to PDF, PDF to DOCX, image conversions, Excel to CSV, HTML to PDF, and Markdown to PDF.
                    Last updated -
                    3
                    Python
                    MIT License
                    • Linux
                    • Apple

                  View all related MCP servers

                  MCP directory API

                  We provide all the information about MCP servers via our MCP API.

                  curl -X GET 'https://glama.ai/api/mcp/v1/servers/2b3pro/markdown2pdf-mcp'

                  If you have feedback or need assistance with the MCP directory API, please join our Discord server