Use your own Word templates to convert Markdown β DOCX/PDF/HTML from any MCP-compatible AI.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
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.
MDMagic plugs straight into Claude, Cursor, VS Code, and any MCP-compatible AI assistant β giving them direct access to a professional document conversion pipeline (Pandoc + Microsoft Graph + Mammoth.js) and, more importantly, your templates. Upload your existing letterhead, stationery, brand guidelines, contract shells, or proposal templates β anything you already use in Microsoft Word β and your AI assistant can convert any Markdown directly into a polished document carrying your logo, fonts, colours, footers, page numbers, watermarks, and signature blocks. The output looks like it came from your design team, not from a generic AI export.
You need an MDMagic account (free tier available) and your API key from your account page.
Add this to your claude_desktop_config.json:
Config file location:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.jsonRestart Claude Desktop. The MDMagic tools will appear in the tool list.
Add to ~/.cursor/mcp.json (or via Settings β MCP):
Don't want Node on the user's machine? Use the hosted endpoint:
Same tools, same templates, served over Streamable HTTP. Useful for clients that don't run local processes.
Once connected, ask your AI assistant things like:
The AI picks the right tool and returns a secure, time-limited download link.
| Tool | What it does |
|---|---|
convert_document | Convert Markdown β DOCX / PDF / HTML / all three. Returns a secure expiring URL. |
validate_markdown | Pre-flight check before conversion. Catches malformed tables, unclosed code fences, and other syntax issues that would produce broken output. |
estimate_conversion_cost | Pre-flight cost estimate based on word count, page count, format, and template type. |
check_credit_balance | Current credit balance (subscription + purchased pools), plan status. |
list_all_templates | Full template catalog: 15 built-in templates (grouped by category) + your custom uploads. |
list_builtin_templates | Only the built-in templates: Business (5), Creative (6), Professional (2), Technical (2). |
list_custom_templates | Only your custom uploaded templates. |
get_template_details | Show available variants (page sizes Γ orientations) for a specific template. |
recommend_template | Suggest the best built-in template for a described purpose ("Q4 board pack" β Executive_Platinum). |
show_default_settings | Your default page size, orientation, and template preferences. |
convert_document β input optionsThree ways to provide the source:
content β raw markdown string (most common)filePath β absolute path to a .md file (great for IDE workflows)fileContent β base64-encoded markdown (for binary-safe transports)Plus:
templateName β e.g. Executive_Platinum, Legal_Burgundy, or a custom template UUIDoutputFormat β docx, pdf, html, all, or all-formatspageSize β A4, A3, US_Letter, US_Legal, Executiveorientation β Portrait or Landscape| Variable | Default | Notes |
|---|---|---|
MDMAGIC_API_KEY | (required) | Your personal API key from mdmagic.ai/account |
MDMAGIC_BASE_URL | https://api.mdmagic.ai | Override only for local dev or staging |
REQUEST_TIMEOUT | 30000 | Request timeout in ms |
MCP_TRANSPORT | stdio | stdio (default) or http for self-hosted Streamable HTTP |
MCP_HTTP_PORT | 3001 | Port for HTTP transport mode |
MCP_HTTP_HOST | 127.0.0.1 | Bind address for HTTP transport mode |
Most users will only ever set MDMAGIC_API_KEY.
Conversions cost credits, calculated from page count and output format:
A 5-page report converted to DOCX + PDF + HTML using a custom template = 5 Γ (1 + 1 + 1 + 1) = 20 credits.
The estimate_conversion_cost tool returns exact numbers before you spend anything. The MCP also refuses to run if your balance is too low β no surprise bills.
Free-tier credits renew monthly. Paid plans and credit top-ups available at mdmagic.ai.
MDMAGIC_API_KEY environment variable is required
Set the env var in your client config (the env block in the JSON). Don't put it in a shell β npx won't see it.
Invalid API key format
Keys must match mdmagic- followed by exactly 16 digits. Copy it cleanly from your account page.
Failed to connect to MDMagic API
Check https://api.mdmagic.ai/health in a browser. If it's up, the issue is local network or firewall. Confirm MDMAGIC_BASE_URL (default https://api.mdmagic.ai) is reachable from the machine running the MCP.
Tools don't appear in Claude Desktop
Fully quit and relaunch Claude Desktop after editing claude_desktop_config.json β a window close isn't enough.
Insufficient credits
Use check_credit_balance to confirm balance, estimate_conversion_cost to preview costs, or top up at mdmagic.ai/account.
The MCP Inspector (npm run inspector) launches a web UI for poking the server tool-by-tool β useful when adding new tools or debugging argument validation.
Run tests with npm test.
MIT β see LICENSE.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/mdmagic-mcp-server)<a href="https://allmcps.com/mcp/mdmagic-mcp-server"><img src="https://allmcps.com/api/badge/mdmagic-mcp-server?style=directory" alt="Mdmagic Mcp Server on AllMCPs" /></a>