Dokmatiq DocGen
OfficialDokmatiq DocGen is a comprehensive document generation and processing MCP server with the following capabilities:
Document Generation
Convert HTML or Markdown to PDF
Generate documents using templates (ODT/DOCX) with field replacements and watermarks
Compose multi-part documents from multiple sections
Create ZUGFeRD-compliant invoice PDFs with embedded e-invoicing XML
PDF Tools
Merge multiple PDFs, extract text, retrieve metadata, convert to PDF/A, rotate pages
Inspect and fill (and optionally flatten) PDF form fields
Digitally sign PDFs with PKCS#12 certificates, verify signatures, list certificates
Render PDF pages as PNG images and get total page count
Templates & Fonts
List, upload, and delete document templates (ODT/DOCX); list custom fonts
Excel Workbooks
Generate styled XLSX from structured JSON (sheets, formulas, styling, freeze panes)
Convert CSV to formatted Excel with auto-filter and styled headers
Extract Excel data as CSV or structured JSON
Fill Excel templates at named cells/ranges; inspect workbook metadata
E-Invoicing
Validate and extract data from ZUGFeRD/Factur-X PDFs
Validate, parse, and detect XRechnung XML invoices
AI-Powered Receipt Recognition
Extract structured data (vendor, totals, VAT, line items, SKR03/04 accounts) from receipt images or PDFs, synchronously or asynchronously
Track async job status and retrieve results
Generate expense report documents (PDF/DOCX/ODT) from receipts
Export receipt data as DATEV-compatible CSV or Excel workbook
Enables exporting receipt data in DATEV-compatible CSV format for seamless integration with German accounting software.
Dokmatiq DocGen MCP Server
MCP (Model Context Protocol) server that exposes the Dokmatiq DocGen document generation API as tools for AI assistants like Claude.
Setup
Prerequisites
Python 3.11+
DocGen API key
Installation
pip install dokmatiq-docgen-mcpOr install from source:
cd mcp
pip install -e .Configuration
Set your API key as an environment variable:
export DOCGEN_API_KEY=dk_live_xxxOptionally override the base URL:
export DOCGEN_BASE_URL=https://custom.api.endpoint.comUsage with Claude Desktop
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"docgen": {
"command": "docgen-mcp",
"env": {
"DOCGEN_API_KEY": "dk_live_xxx"
}
}
}
}Or using uvx:
{
"mcpServers": {
"docgen": {
"command": "uvx",
"args": ["dokmatiq-docgen-mcp"],
"env": {
"DOCGEN_API_KEY": "dk_live_xxx"
}
}
}
}Usage with Claude Code
claude mcp add docgen -- docgen-mcpSet the API key in your environment or .env file.
Usage with Hermes
Add the MCP server to your Hermes config (~/.hermes/config.yaml):
mcp_servers:
docgen:
command: "uvx"
args: ["dokmatiq-docgen-mcp"]
env:
DOCGEN_API_KEY: "dk_live_xxx"Replace dk_live_xxx with your Dokmatiq API key.
Environment Variables in MCP Configs
Do not use shell placeholders such as ${DOCGEN_API_KEY} inside JSON MCP config files unless your specific client documents that it expands them. Many MCP clients pass that value literally to the server, which causes authentication to fail.
Available Tools
Document Generation
Tool | Description |
| Convert HTML to PDF |
| Convert Markdown to PDF |
| Generate with template, fields, watermark, output format |
| Compose multi-part document from sections |
| Create ZUGFeRD-compliant invoice PDF |
PDF Tools
Tool | Description |
| Merge multiple PDFs into one |
| Extract all text content |
| Get title, author, page count |
| Convert to PDF/A archival format |
| Rotate pages |
PDF Forms
Tool | Description |
| List form fields with types and values |
| Fill form fields |
Digital Signatures
Tool | Description |
| Digitally sign with PKCS#12 certificate |
| Verify existing signatures |
| List uploaded certificates |
Templates & Fonts
Tool | Description |
| List uploaded templates |
| Upload ODT/DOCX template |
| Delete a template |
| List uploaded fonts |
Preview
Tool | Description |
| Render page as PNG image |
| Get total page count |
Excel Workbooks
Tool | Description |
| Generate styled XLSX from structured JSON (sheets, columns, formulas, styling, freeze panes) |
| Convert CSV to formatted Excel with auto-filter and styled headers |
| Extract Excel sheet data as CSV |
| Extract Excel sheet data as structured JSON with typed values |
| Fill Excel template with values at named cells and ranges |
| Inspect workbook metadata (sheet names, row/column counts, named ranges) |
E-Invoicing
Tool | Description |
| Validate ZUGFeRD compliance |
| Extract invoice data from ZUGFeRD PDF |
| Validate XRechnung XML |
| Parse XRechnung into structured data |
| Detect XRechnung format |
Receipt Recognition (AI-Powered)
Tool | Description |
| Extract structured data from receipt image (vendor, totals, VAT, line items, SKR03/04 account) |
| Submit receipt for async extraction with optional webhook |
| Check async extraction job status |
| Get extraction result of completed job |
| List all async receipt jobs |
| Extract receipt and generate expense report (PDF/DOCX/ODT) |
| Export receipts as DATEV-compatible CSV |
| Export receipts as Excel workbook |
Example Prompts
Once connected, you can ask Claude:
"Generate a PDF from this HTML:
<h1>Hello World</h1>""Create an invoice for ACME GmbH to Kunde AG for 8 hours of consulting at 120€/hour"
"Merge these two PDFs together"
"Extract the text from this PDF"
"Fill the form fields name=Max and date=12.04.2026 in this PDF"
"Extract the data from this receipt image -- I need vendor, total, and VAT breakdown"
"Analyze these receipts and export them as a DATEV CSV"
"Turn this receipt photo into an expense report PDF"
License
MIT
Latest Blog Posts
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/dokmatiq/docgen-sdks'
If you have feedback or need assistance with the MCP directory API, please join our Discord server