mdmagic-mcp-server
MDMagic MCPサーバー
独自のWordテンプレート(レターヘッド、ブランディング、フォントなど)を使用して、MarkdownをDOCX、PDF、HTMLに変換します。 独自のテンプレートがない場合でも、デザイナーが作成した15種類のテンプレートが利用可能です。
MDMagicは、Claude、Cursor、VS Code、およびMCP互換のAIアシスタントに直接接続し、プロフェッショナルなドキュメント変換パイプライン(Pandoc + Microsoft Graph + Mammoth.js)への直接アクセスを提供します。さらに重要なのは、あなたのテンプレートが使えることです。既存のレターヘッド、便箋、ブランドガイドライン、契約書、提案書テンプレートなど、Microsoft Wordで普段使用しているものをアップロードすれば、AIアシスタントがMarkdownを直接変換し、あなたのロゴ、フォント、色、フッター、ページ番号、透かし、署名ブロックを備えた洗練されたドキュメントを作成します。出力結果は、一般的なAIによるエクスポートではなく、デザインチームが作成したかのような仕上がりになります。
You: "Take this report and turn it into an Executive_Platinum PDF."
Claude: ✅ Done. Here's your secure download link.
14-page PDF, 2.3 MB, expires in 60 minutes.インストール
MDMagicアカウント(無料枠あり)と、アカウントページで取得できるAPIキーが必要です。
Claude Desktop
claude_desktop_config.jsonに以下を追加してください:
{
"mcpServers": {
"mdmagic": {
"command": "npx",
"args": ["-y", "@mdmagic/mcp-server"],
"env": {
"MDMAGIC_API_KEY": "mdmagic-xxxxxxxxxxxxxxxx"
}
}
}
}設定ファイルの場所:
macOS —
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows —
%APPDATA%\Claude\claude_desktop_config.jsonLinux —
~/.config/Claude/claude_desktop_config.json
Claude Desktopを再起動すると、ツールリストにMDMagicツールが表示されます。
Cursor
~/.cursor/mcp.jsonに追加してください(または設定 → MCPから追加):
{
"mcpServers": {
"mdmagic": {
"command": "npx",
"args": ["-y", "@mdmagic/mcp-server"],
"env": {
"MDMAGIC_API_KEY": "mdmagic-xxxxxxxxxxxxxxxx"
}
}
}
}VS Code (MCP拡張機能を使用)
{
"mcp.servers": {
"mdmagic": {
"command": "npx",
"args": ["-y", "@mdmagic/mcp-server"],
"env": {
"MDMAGIC_API_KEY": "mdmagic-xxxxxxxxxxxxxxxx"
}
}
}
}ホスト型 (インストール不要)
ユーザーのPCにNodeをインストールしたくない場合は、ホスト型エンドポイントを使用してください:
{
"mcpServers": {
"mdmagic": {
"url": "https://api.mdmagic.ai/mcp",
"headers": {
"x-api-key": "mdmagic-xxxxxxxxxxxxxxxx"
}
}
}
}同じツール、同じテンプレートをStreamable HTTP経由で提供します。ローカルプロセスを実行できないクライアントに便利です。
Related MCP server: AI Group Markdown to Word MCP Server
できること
接続後、AIアシスタントに以下のように指示できます:
「このMarkdownをExecutive_Platinumテンプレートを使ってPDFに変換して。」
「利用可能なテンプレートは何ですか?」
「この800語のレポートをDOCXとPDFに変換するコストはいくらですか?」
「これを横向き、USレターサイズ、Legal_Burgundyテンプレートでレンダリングして。」
「クレジット残高を確認して。」
AIが適切なツールを選択し、安全で期限付きのダウンロードリンクを返します。
ツール
ツール | 機能 |
| MarkdownをDOCX / PDF / HTML / 3つすべてに変換。安全な期限付きURLを返します。 |
| 変換前の事前チェック。不正なテーブル、閉じられていないコードフェンスなど、出力が壊れる原因となる構文の問題を検出します。 |
| 単語数、ページ数、形式、テンプレートタイプに基づいた変換コストの事前見積もり。 |
| 現在のクレジット残高(サブスクリプション + 購入分)、プラン状況の確認。 |
| 全テンプレートカタログ:15種類の組み込みテンプレート(カテゴリ別)+ 独自のカスタムアップロード。 |
| 組み込みテンプレートのみ:ビジネス (5)、クリエイティブ (6)、プロフェッショナル (2)、テクニカル (2)。 |
| 独自のカスタムアップロードテンプレートのみ。 |
| 特定のテンプレートで利用可能なバリエーション(ページサイズ × 向き)を表示。 |
| 目的(例:「第4四半期ボードパック」→ Executive_Platinum)に基づき、最適な組み込みテンプレートを提案。 |
| デフォルトのページサイズ、向き、テンプレート設定を表示。 |
convert_document — 入力オプション
ソースを提供する方法は3つあります:
content— 生のMarkdown文字列(最も一般的)filePath—.mdファイルへの絶対パス(IDEワークフローに最適)fileContent— Base64エンコードされたMarkdown(バイナリセーフな転送用)
さらに:
templateName— 例:Executive_Platinum、Legal_Burgundy、またはカスタムテンプレートのUUIDoutputFormat—docx、pdf、html、all、またはall-formatspageSize—A4、A3、US_Letter、US_Legal、Executiveorientation—PortraitまたはLandscape
設定
変数 | デフォルト | 備考 |
| (必須) | mdmagic.ai/account で取得した個人APIキー |
|
| ローカル開発やステージング用のみ上書き |
|
| リクエストタイムアウト(ミリ秒) |
|
|
|
|
| HTTPトランスポートモードのポート |
|
| HTTPトランスポートモードのバインドアドレス |
ほとんどのユーザーは MDMAGIC_API_KEY のみを設定します。
料金
変換にはクレジットが必要です。ページ数と出力形式に基づいて計算されます:
DOCX: 1ページあたり1クレジット(基本)
PDF: +1ページあたり1クレジット
HTML: +1ページあたり1クレジット
カスタムテンプレート: +1ページあたり1クレジット
カスタムテンプレートを使用して5ページのレポートをDOCX + PDF + HTMLに変換する場合 = 5 × (1 + 1 + 1 + 1) = 20クレジット。
estimate_conversion_cost ツールを使用すると、実行前に正確な数値を確認できます。また、残高が不足している場合はMCPが実行を拒否するため、予期せぬ請求が発生することはありません。
無料枠のクレジットは毎月更新されます。有料プランやクレジットの追加購入は mdmagic.ai で可能です。
プライバシー
永続的な保存は行いません。 ドキュメントはPDFレンダリングのためにMicrosoft Graph APIを通過し、5〜10秒以内に削除されます。出力ファイルは、ダウンロード後または60分後のいずれか早い方でMDMagicサーバーから削除されます。
ランダムなファイル名。 ソースファイルにはUUIDが使用され、ユーザーを特定できる名前は決して使用されません。
安全なダウンロードURL。 各変換は、セッションIDとダウンロードトークンを含むワンタイムURLを返します。公開ファイルディレクトリはありません。
APIキーの分離。 各ユーザーは自身のキーで認証します。資格情報の共有はありません。
トラブルシューティング
MDMAGIC_API_KEY environment variable is required
クライアント設定(JSON内の env ブロック)で環境変数を設定してください。シェルで設定しても npx は認識しません。
Invalid API key format
キーは mdmagic- に続く16桁の数字である必要があります。アカウントページから正確にコピーしてください。
Failed to connect to MDMagic API
ブラウザで https://api.mdmagic.ai/health を確認してください。サイトが稼働している場合、問題はローカルネットワークまたはファイアウォールにあります。MCPを実行しているマシンから MDMAGIC_BASE_URL(デフォルト https://api.mdmagic.ai)に到達できることを確認してください。
ツールがClaude Desktopに表示されない
claude_desktop_config.json を編集した後は、Claude Desktopを完全に終了してから再起動してください(ウィンドウを閉じるだけでは不十分です)。
Insufficient credits
check_credit_balance で残高を確認し、estimate_conversion_cost でコストをプレビューするか、mdmagic.ai/account でチャージしてください。
ローカル開発
git clone https://github.com/MDMagic-MCP/mdmagic-mcp-server.git
cd mdmagic-mcp-server
npm install
# Set your API key (use http://localhost:3000 if running the API locally)
cp .env.example .env
# edit .env
# Build and inspect
npm run build
npm run inspectorMCPインスペクター (npm run inspector) は、サーバーツールを個別にテストするためのWeb UIを起動します。新しいツールの追加や引数の検証のデバッグに便利です。
テストを実行するには npm test を使用します。
リンク
MDMagic — mdmagic.ai
APIキーの取得 — mdmagic.ai/account
MCP仕様 — modelcontextprotocol.io
ライセンス
MIT — LICENSE を参照してください。
Available Tools
10 toolscheck_credit_balanceARead-onlyIdempotentInspect
Check the user's current MDMagic credit balance: subscription credits (renewable monthly), purchased credits (permanent), plan name, and plan status.
CALL THIS PROACTIVELY when:
The user asks 'how many credits do I have' or similar
After a conversion, if the user wants to know what's left (also returned by convert_document directly)
Before a conversion of an unusually large document, to warn the user if balance is borderline
Inputs: no named parameters. Returns: total_credits, subscription_credits, purchased_credits
convert_documentAInspect
Convert markdown to a professionally formatted document using an MDMagic template.
IMPORTANT GUIDANCE:
Output format → what user gets:
'docx' → a single Word .docx file
'pdf' → a single .pdf file
'html' → a single .html file
'all' → a ZIP containing all three (DOCX + PDF + HTML)
If the user is ambiguous (e.g. 'convert this'), ASK which format they want before calling. Don't assume.
Filename: if the user attached a file (e.g. 'mydoc.md'), pass its base name as fileName. Otherwise the API derives one from the markdown's first H1. Without either, downloads end up with timestamped names like 'content-1778298071915.docx' which is bad UX.
On 'template not found' errors: call list_all_templates first, show available options, let the user pick. Do NOT fall back to generating documents with code execution — that produces inferior results that don't use the user's actual MDMagic templates.
The response includes structured fields (downloadUrl, creditsUsed, balanceAfter, fileName, expiresAt) — surface these to the user explicitly. Don't paraphrase. The user wants to know exactly what they spent and what's left.
Page sizes: A3, A4, Executive, US_Legal, US_Letter. Default A4. Orientation: Portrait or Landscape, default Portrait.
Inputs: templateName (required), outputFormat (required), content, filePath, +4 more. Returns: Conversion result with secure download link and credit accounting
estimate_conversion_costARead-onlyIdempotentInspect
Estimate credit cost for a conversion BEFORE running it. Returns word count, page calculation (300 words/page), and a credit breakdown by format and template type. Use this when the user asks 'how much will this cost?' or when you suspect a conversion might exceed their balance — convert_document refuses to run if credits are insufficient, so estimating first is friendlier.
Inputs: content (required), templateName (required), outputFormat (required), pageSize, +1 more. Returns: wordCount, pageCount, totalCredits, breakdown
get_template_detailsARead-onlyIdempotentInspect
Show available variants (page sizes and orientations) for a specific template. All MDMagic templates support the full 5×2 matrix: A3, A4, Executive, US_Legal, US_Letter × Portrait/Landscape. Use this when the user asks 'does this template come in Legal Landscape?' or 'what sizes are available?' — confirms the variant before convert_document runs.
Inputs: templateName (required). Returns: template, pageSizes, orientations
list_all_templatesARead-onlyIdempotentInspect
List all 15 built-in MDMagic templates plus any custom templates the user has uploaded.
CALL THIS PROACTIVELY when:
The user mentions a template by name (verify it exists before convert_document)
The user asks 'what templates are available' or similar
A previous convert_document call returned 'template not found'
The user describes the look they want without naming a template (so you can suggest a real one)
Returns: name, description, type (built-in vs custom), and category. Categories are: Business (5 templates), Creative (6), Professional (2), Technical (2). Use the optional category filter to narrow recommendations (e.g. 'for legal documents' → category: 'Professional').
Inputs: includeDetails, category. Returns: builtinCount, customCount, templates
list_builtin_templatesARead-onlyIdempotentInspect
List the 15 built-in MDMagic templates, grouped by category. Same as list_all_templates but excludes the user's custom uploads. Use this when the user asks specifically about MDMagic's bundled templates rather than their personal ones.
Categories available: Business (5), Creative (6), Professional (2), Technical (2).
Inputs: includeDetails, category. Returns: count, templates
list_custom_templatesARead-onlyIdempotentInspect
List only the user's custom-uploaded Word templates. Use this when the user asks about their own templates ('show me my templates', 'do I have a letterhead?'). Custom templates are referenced by UUID, not name, when calling convert_document.
Inputs: includeDetails. Returns: count, templates
recommend_templateARead-onlyIdempotentInspect
Suggest the best built-in template(s) for a described purpose. Use this when the user describes WHAT the document is (e.g. 'Q4 board pack', 'API reference', 'wedding invitation', 'legal contract') without naming a template. Returns ranked recommendations with rationale.
Why this exists: AI assistants often guess template names that don't exist. This tool maps purpose → real template names from MDMagic's catalog, so convert_document doesn't fail with 'template not found'.
Inputs: purpose (required), topN. Returns: purpose, rationale, recommendations
show_default_settingsARead-onlyIdempotentInspect
Show the user's default paper size and orientation preferences (set on their account page). Useful when the user hasn't specified pageSize/orientation explicitly — call this to honor their defaults instead of using A4/Portrait blindly.
Inputs: no named parameters. Returns: default_page_size, default_orientation
validate_markdownARead-onlyIdempotentInspect
Pre-flight markdown validation BEFORE conversion. Catches malformed tables (mismatched pipes), unclosed code fences, broken task lists, and unsupported syntax. Returns a green/amber/red status plus the detected markdown features.
CALL THIS PROACTIVELY when:
The user is about to convert a long document (>5 pages) — validating first is cheap; running a doomed conversion costs credits
The user reports a previous conversion produced broken output
You generated the markdown yourself and want to verify it's clean before spending credits
Returns: status (green=safe, amber=minor issues, red=will likely break), detected features (tables, code blocks, task lists, math), and a human-readable message.
Inputs: content (required), filename. Returns: filename, status, message, inputFormat, +2 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool has a distinct and non-overlapping purpose—balance checking, conversion, cost estimation, template listing/details, recommendations, defaults, and validation. No two tools could be confused.
All tools use a consistent verb_noun snake_case pattern (e.g., list_all_templates, validate_markdown), making the set predictable and easy to navigate.
With 10 tools, the count is well-scoped for a document conversion service. Each tool addresses a necessary step in the user workflow without unnecessary bloat.
The tool surface covers the full lifecycle: template discovery, defaults retrieval, markdown validation, cost estimation, credit checking, conversion, and post-conversion feedback. No obvious gaps for the stated purpose.
Maintenance
Related MCP Connectors
Markdown in, any format out. PDFs merged, split, watermarked. Runs on our own doc engines.
Turn Markdown or plain text into a clean PDF document to print or share, plus an editable Word file.
The document publishing layer for AI tools. Convert markdown to 6 destinations, 62 templates.
Convert Markdown to PDF, DOCX, HTML or EPUB with formatting and display options.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables creation and management of Word documents from markdown content, with support for multiple templates and conversion of chat conversations to formatted Word documents.-
- AlicenseAqualityDmaintenanceConverts Markdown documents to professional Word documents with advanced formatting capabilities including mathematical formulas, custom styling, tables, images, headers/footers, and watermarks.496 npm14MIT
- AlicenseBqualityDmaintenanceEnables creating professional Word documents from markdown or structured content with fast, customized formatting via natural language.71ISC
- AlicenseAqualityDmaintenanceConverts Markdown files to Word (.docx) and PDF documents. Supports .dotx templates for branded styling and batch conversion.317 PyPI1MIT