Generate PDF, DOCX and Excel documents, e-invoices and signed PDFs, and recognize receipts.
Official SDKs for the Dokmatiq DocGen API -- document generation, e-invoicing, Excel workbooks, receipt recognition, and PDF tools in a single API.
Dokmatiq DocGen also includes an MCP server and AI assistant skill for Codex and Claude Code to create PDFs, invoices, e-invoices, ZUGFeRD/XRechnung documents, and documents on company letterhead (Briefpapier/Firmenpapier).
| Language | Package | Install |
|---|---|---|
| TypeScript | @dokmatiq/docgen | npm install @dokmatiq/docgen |
| Python | dokmatiq-docgen | pip install dokmatiq-docgen |
| Java | com.dokmatiq:docgen-sdk | Maven / Gradle |
| PHP | dokmatiq/docgen-sdk | composer require dokmatiq/docgen-sdk |
| C# / .NET | Dokmatiq.DocGen | dotnet add package Dokmatiq.DocGen |
Also included: MCP Server for AI assistants (any MCP client — Claude Desktop, Cursor, Continue, Cline, …) and a Codex / Claude Code plugin and skill (MCP setup plus a triggering dokmatiq-docgen skill).
Use the Dokmatiq DocGen MCP server with Codex, Claude Code, Claude Desktop, Cursor, Continue, Cline, Hermes, or any other MCP-capable client.
Install the skill from this repo path:
python3 ~/.codex/skills/.system/skill-installer/scripts/install-skill-from-github.py \
--repo dokmatiq/docgen-sdks \
--path plugin/skills/dokmatiq-docgen
Then install and configure the MCP server:
python3.11 -m pip install --user dokmatiq-docgen-mcp
export DOCGEN_API_KEY="dk_live_xxxxxxxxxxxxx"
If docgen-mcp is installed into ~/.local/bin, make sure that directory is on your PATH, or configure your MCP client with the absolute command path.
/plugin marketplace add dokmatiq/claude-plugins
/plugin install docgen@dokmatiq
The legacy plugin copy in this repository is kept under plugin/ for backwards compatibility.
All SDKs provide the same capabilities with idiomatic APIs:
HTML, Markdown, and ODT templates to PDF, DOCX, or ODT -- with field substitution, images, QR codes, tables, watermarks, and stationery overlays.
Embed and extract structured invoice data in PDF invoices (EN16931). Generate, parse, validate, and transform XRechnung XML (CII and UBL).
Create styled XLSX from JSON with formulas, freeze panes, auto-filters, and cell styling. Convert between XLSX, CSV, and JSON. Fill Excel templates.
Extract structured data from receipt and invoice images:
const result = await dg.receipts.extract("receipt.jpg");
// { vendor, date, total: { gross, net, vat }, skr03Account, lineItems, confidence, ... }
const csv = await dg.receipts.exportDatev([result]);
Merge, split, rotate, extract text, read/write metadata, convert to PDF/A.
Sign PDFs with PKCS#12 certificates. Verify existing signatures.
Inspect and fill PDF form fields programmatically.
Render PDF pages as PNG images for thumbnails and previews.
Submit long-running jobs with polling or webhook callbacks.
# 1. Get an API key at https://developer.dokmatiq.com
# 2. Install your SDK of choice
npm install @dokmatiq/docgen # TypeScript
pip install dokmatiq-docgen # Python
composer require dokmatiq/docgen-sdk # PHP
dotnet add package Dokmatiq.DocGen # .NET
# Maven: com.dokmatiq:docgen-sdk # Java
import { DocGen } from "@dokmatiq/docgen";
const dg = new DocGen({ apiKey: "your-api-key" });
// Generate a PDF
const pdf = await dg.htmlToPdf("<h1>Hello World</h1>");
// Build a complex document
const doc = await dg.document()
.html("<h1>Invoice {{nr}}</h1>")
.field("nr", "RE-2026-001")
.watermark("DRAFT")
.asPdf()
.generate();
// Extract receipt data
const receipt = await dg.receipts.extract("receipt.jpg");
// Create an Excel workbook
const xlsx = await dg.excel.generate({
sheets: [{ name: "Report", columns: [...], rows: [...] }]
});
Each SDK has its own detailed README with full examples: TypeScript | Python | Java | PHP | .NET
MIT -- Copyright 2026 Dokmatiq
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
uvx dokmatiq-docgen-mcpMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-dokmatiq-docgen": {
"command": "uvx",
"args": [
"dokmatiq-docgen-mcp"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup referenceDokmatiq DocGen works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.