DocMake — Claude Code MCP server: DOCX and PDF from templates
The official DocMake MCP server lets an assistant find your templates, fill in the fields and render a finished PDF or DOCX without leaving the chat.
claude mcp add --env DOCMAKE_API_KEY=<DOCMAKE_API_KEY> --env DOCMAKE_OUTPUT_DIR=<DOCMAKE_OUTPUT_DIR> --env DOCMAKE_API_BASE=<DOCMAKE_API_BASE> --transport stdio docmake -- npx -y @docmake/mcpWhat DocMake does
Six tools bridge the AI client and the DocMake API. list_templates browses the workspace, get_template returns the field tree a template expects, render_document produces the file, and create_template plus import_docx bring new templates in. get_usage reports the plan and render quota. Templates also show up as MCP resources, and a generate-document prompt walks through a guided render.
Strict mode is on unless you turn it off. A variable with no value in data stops the render, and the assistant gets back the missing keys — so it asks you rather than handing over a half-empty document. Setting strict: false switches to each variable's fallback text. Defaults declared in the template editor never count as missing: leave them out of data and the rendered file uses the default.
You need a DocMake API key from Settings > API Keys in the dashboard; the free plan is enough. Output lands in DOCMAKE_OUTPUT_DIR and an existing file is never overwritten. There is a hosted endpoint at https://app.docmake.io/mcp/v1 that skips installation entirely, with two caveats: render_document gives back a short-lived download link, and import_docx wants the file as base64, because a remote server cannot read your disk.
What it helps with
- produce an invoice or contract from a template without filling it by hand
- find out which variables a template expects
- get a PDF or DOCX file on disk from a chat request
- turn an existing .docx into a DocMake template
- check how many renders are left this billing period
Example prompts for the agent
- Which fields does my employment contract template need? Fill them for Maria Ionescu from 1 October and save a DOCX.
- Import
~/Documents/quarterly-report.docxas a DocMake template and list the variables it found.
How to install DocMake
Platform CLI
claude mcp add --env DOCMAKE_API_KEY=<DOCMAKE_API_KEY> --env DOCMAKE_OUTPUT_DIR=<DOCMAKE_OUTPUT_DIR> --env DOCMAKE_API_BASE=<DOCMAKE_API_BASE> --transport stdio docmake -- npx -y @docmake/mcpReplace <…> with your own values
Platform CLI
codex mcp add docmake --env DOCMAKE_API_KEY=<DOCMAKE_API_KEY> --env DOCMAKE_OUTPUT_DIR=<DOCMAKE_OUTPUT_DIR> --env DOCMAKE_API_BASE=<DOCMAKE_API_BASE> -- npx -y @docmake/mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"docmake": {
"command": "npx",
"args": [
"-y",
"@docmake/mcp"
],
"env": {
"DOCMAKE_API_KEY": "<DOCMAKE_API_KEY>",
"DOCMAKE_OUTPUT_DIR": "<DOCMAKE_OUTPUT_DIR>",
"DOCMAKE_API_BASE": "<DOCMAKE_API_BASE>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"docmake": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@docmake/mcp"
],
"env": {
"DOCMAKE_API_KEY": "<DOCMAKE_API_KEY>",
"DOCMAKE_OUTPUT_DIR": "<DOCMAKE_OUTPUT_DIR>",
"DOCMAKE_API_BASE": "<DOCMAKE_API_BASE>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e DOCMAKE_API_KEY=<DOCMAKE_API_KEY> -e DOCMAKE_OUTPUT_DIR=<DOCMAKE_OUTPUT_DIR> -e DOCMAKE_API_BASE=<DOCMAKE_API_BASE> docmake npx -y @docmake/mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about DocMake
How do I install DocMake in Claude Code?
Run claude mcp add docmake --env DOCMAKE_API_KEY=dm_your_key_here -- npx -y @docmake/mcp@latest, with your own key from the DocMake dashboard.
What does DocMake do?
It gives the assistant access to your DocMake templates: search them, read their fields, fill them with data and render a PDF or DOCX locally.
What happens when render data is incomplete?
The strict default aborts the render and returns the missing variable names, so the assistant can request them from you. With strict: false the fallback text of each variable is used instead.