DocuGenerate MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@DocuGenerate MCP ServerGenerate an invoice for Acme Corp for $5,000 due in 30 days."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
DocuGenerate MCP Server
A local Model Context Protocol server that wraps the DocuGenerate document-generation API, so Claude Desktop can generate documents (invoices, contracts, letters) from your templates — just by asking.
This is a local demo build: TypeScript, the official MCP SDK, and STDIO transport. You register it in Claude Desktop and it runs on your machine.
The productionised “official” version would instead be a remote HTTP MCP server with OAuth — this local stdio build is deliberately the demo shape.
Tools
Tool | Args | Returns |
| (optional) | Each template's |
|
| Merge fields for one template (fallback / double-check). |
|
| A hosted URL to the generated document (a link, not binary). |
Related MCP server: Zileo Docs
How it maps to the DocuGenerate API
Confirmed against the API Quick Start and
live probes of api.docugenerate.com:
Base URL:
https://api.docugenerate.com/v1Auth header:
Authorization: <API Key>— the raw key, noBearerprefix.GET /template→ list templates (each hasid,name,tags.valid= merge fields)GET /template/{id}→ one templatePOST /documentwith{ template_id, data: [ {...} ], output_format: ".pdf" }→ responds withdocument_uri(the hosted document link).
Setup
Requires Node 20+.
npm install
npm run build # compiles to dist/ via tscGet your API key from the DocuGenerate Settings page (https://app.docugenerate.com).
Before the demo: create at least one template in the DocuGenerate dashboard — for the prompts below, make an “Invoice” template with merge tags such as
Company Name,Invoice Number,Date,Due Date,Line Items, andTotal.list_templateswill report each template's exact merge fields.
Register in Claude Desktop
Edit claude_desktop_config.json:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Add this server (use the absolute path to the built dist/index.js):
{
"mcpServers": {
"docugenerate": {
"command": "node",
"args": ["/absolute/path/to/DocuGenerate-mcp/dist/index.js"],
"env": {
"DOCUGENERATE_API_KEY": "your_api_key_here"
}
}
}
}Then fully quit and reopen Claude Desktop. The docugenerate tools appear under the
🔌 / tools menu.
Demo prompts
Once registered, try these in Claude Desktop:
“List my DocuGenerate templates.”
“Generate an invoice from the Invoice template for Acme Corp — 3 line items: Design $1200, Development $3400, Hosting $200 — due in 30 days.”
“Now generate the same as a DOCX.”
Claude will call list_templates to discover the Invoice template and its fields, then
generate_document (PDF, then DOCX) and hand you back the document URLs.
Local testing (without Claude Desktop)
You can drive the server over stdio directly. Set the key and run the smoke test:
export DOCUGENERATE_API_KEY=your_api_key_here
npm run build
node dist/index.js # server waits for MCP JSON-RPC on stdin; Ctrl-C to exitA quick end-to-end generate_document smoke test (replace TEMPLATE_ID with a real id from
list_templates):
export DOCUGENERATE_API_KEY=your_api_key_here
TEMPLATE_ID=your_template_id node --input-type=module -e '
import { spawn } from "node:child_process";
const srv = spawn("node", ["dist/index.js"], { env: process.env });
let buf = "";
srv.stdout.on("data", d => { buf += d.toString();
for (const line of buf.split("\n")) { if (!line.trim()) continue;
try { const m = JSON.parse(line);
if (m.id === 2) { console.log(m.result.content[0].text); srv.kill(); process.exit(0); }
} catch {} }
});
srv.stderr.on("data", d => process.stderr.write("[srv] " + d));
const send = o => srv.stdin.write(JSON.stringify(o) + "\n");
send({ jsonrpc:"2.0", id:1, method:"initialize", params:{ protocolVersion:"2024-11-05", capabilities:{}, clientInfo:{ name:"cli", version:"0" } } });
send({ jsonrpc:"2.0", method:"notifications/initialized" });
send({ jsonrpc:"2.0", id:2, method:"tools/call", params:{ name:"generate_document",
arguments:{ template_id: process.env.TEMPLATE_ID,
data: { "Company Name": "Acme Corp", "Total": "$4,800" }, format: "pdf" } } });
setTimeout(() => { srv.kill(); process.exit(1); }, 15000);
'Error handling
Every tool returns a readable error instead of crashing. Failures surface the HTTP status and the DocuGenerate error body, with a hint for the common cases:
401 / 403 → “check that
DOCUGENERATE_API_KEYis set to a valid key…”404 → “the
template_idmay be wrong or deleted. Uselist_templates…”429 → “rate limit hit; wait a moment and try again.”
Network/DNS/TLS failures and non-JSON responses are also caught and reported.
Troubleshooting
generate_documentreturns a 500 “Cannot read properties of undefined (reading 'length')”. This is a DocuGenerate-side error that means the template file is malformed — a hand-assembled.docxmissing the standard Office parts (styles.xml,settings.xml, etc.) will upload fine but fail at render time. Fix: author the template in Microsoft Word / Google Docs (or upload it through the DocuGenerate dashboard) so it's a complete.docx, then re-upload. A normal Word-authored invoice template works.
Configuration
Env var | Required | Default |
| ✅ | — |
| — |
|
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/hasankhadra/DocuGenerate-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server