
MDMagic MCP Server
@MDMagic-MCP
About MDMagic MCP Server
Convert Markdown to DOCX, PDF, and HTML using your own Word templates — your letterhead, your branding, your fonts. Plus 15 designer-built templates for when you don't have your own.
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mdmagic": {
"command": "npx",
"args": [
"-y",
"@mdmagic/mcp-server"
],
"env": {
"MDMAGIC_API_KEY": "mdmagic-xxxxxxxxxxxxxxxx"
}
}
}
}Tools
10Convert markdown to a professionally formatted document using an MDMagic template. IMPORTANT GUIDANCE: 1. 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) 2. If the user is ambiguous (e.g. 'convert this'), ASK which format they want before calling. Don't assume. 3. 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. 4. 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. 5. 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. 6. Page sizes: A3, A4, Executive, US_Legal, US_Letter. Default A4. Orientation: Portrait or Landscape, default Portrait. 7. CRITICAL — newlines in `content`: markdown is line-sensitive. Headings (#, ##), tables (| ... |), lists (-, 1.), and code fences (```) ONLY work when each starts on its own line. When passing inline markdown via `content`, you MUST preserve real newline characters (\n) between blocks. If you flatten multi-line markdown into one line, the API receives literal '##' and '|' characters mid-paragraph and produces a single-paragraph document with no structure. Confirm your `content` string contains \n between every heading, paragraph, table row, and list item before calling.
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').
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).
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.
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.
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
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.
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.
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.
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'.
Overview
What is MDMagic MCP Server?
MDMagic MCP Server converts Markdown to DOCX, PDF, and HTML using your own Word templates — preserving your letterhead, branding, and fonts — or one of 15 built-in designer templates. It integrates with MCP-compatible AI assistants like Claude, Cursor, and VS Code.
How to use MDMagic MCP Server?
Install via npm with an API key from your MDMagic account, then configure it in your client's MCP settings (e.g., claude_desktop_config.json). Once connected, you can ask the AI to convert Markdown using commands like "Convert this markdown to a PDF using the Executive_Platinum template."
Key features of MDMagic MCP Server
- Markdown to DOCX, PDF, and HTML conversion
- Custom Word template support (letterhead, branding, fonts)
- 15 built-in designer templates across multiple categories
- Pre-flight validation and cost estimation tools
- Secure, expiring download URLs for output files
Use cases of MDMagic MCP Server
- Generate branded reports, proposals, or contracts from AI chat
- Convert meeting notes or documentation into polished PDFs or DOCX
- Use templates for consistent formatting across team outputs
- Integrate document generation directly into IDE workflows (Cursor, VS Code)
FAQ from MDMagic MCP Server
How do I get an API key?
Sign up for a free MDMagic account at mdmagic.ai/account, then copy your API key from the account page.
What output formats are supported?
DOCX, PDF, HTML, or all three formats in a single conversion.
How is the pricing structured?
Conversions cost credits based on page count and output format. DOCX costs 1 credit per page, with additional credits for PDF (+1), HTML (+1), and custom templates (+1). The estimate_conversion_cost tool shows exact costs before conversion.
Where are my documents stored?
Documents pass through Microsoft Graph API for PDF rendering and are deleted within 5–10 seconds. Output files are deleted from MDMagic servers after download or after 60 minutes, whichever comes first. Source files use UUIDs and are never stored permanently.
What transports are supported?
The MCP server supports stdio (default) and http (Streamable HTTP) transports. It can also run as a hosted endpoint with no local installation required.
Frequently asked questions
How do I get an API key?
Sign up for a free MDMagic account at mdmagic.ai/account, then copy your API key from the account page.
What output formats are supported?
DOCX, PDF, HTML, or all three formats in a single conversion.
How is the pricing structured?
Conversions cost credits based on page count and output format. DOCX costs 1 credit per page, with additional credits for PDF (+1), HTML (+1), and custom templates (+1). The `estimate_conversion_cost` tool shows exact costs before conversion.
Where are my documents stored?
Documents pass through Microsoft Graph API for PDF rendering and are deleted within 5–10 seconds. Output files are deleted from MDMagic servers after download or after 60 minutes, whichever comes first. Source files use UUIDs and are never stored permanently.
What transports are supported?
The MCP server supports `stdio` (default) and `http` (Streamable HTTP) transports. It can also run as a hosted endpoint with no local installation required.
Basic information
More Files & Storage MCP servers
Rust MCP Filesystem
rust-mcp-stackBlazing-fast, asynchronous MCP server for seamless filesystem operations.
mcp-rquest
xxxbrianA MCP server providing realistic browser-like HTTP request capabilities with accurate TLS/JA3/JA4 fingerprints for bypassing anti-bot measures. It also supports converting PDF and HTML documents to Markdown for easier processing by LLMs.
md-pdf-mcp (Markdown to PDF MCP Server)
seanivoreMarkdown To PDF Conversion MCP
S3 MCP Server
samuraikunMCP server to integrate AWS S3 and LLM
mcp-v8: V8 JavaScript MCP Server
r33drichardsMCP server that exposes a V8 JavaScript runtime as a tool for AI agents like Claude and Cursor. Supports persistent heap snapshots via S3 or local filesystem, and is ready for integration with modern AI development environments.
Comments