Dokmatiq DocGen

io.github.dokmatiq由 GitHub 账号 dokmatiq 发布v0.1.3更新于 Oct 24, 2026

Generate PDF, DOCX and Excel documents, e-invoices and signed PDFs, and recognize receipts.

概览

AI 生成的概览

让助手生成 PDF、DOCX 和 Excel 文档、电子发票与签名 PDF,并从收据中提取数据。

可以做什么
将 Dokmatiq DocGen API 封装为文档生成工具:从 HTML 或 Markdown 生成 PDF、按模板生成文档、组合多段文档、创建发票、生成 Excel 工作簿及 CSV 转换。还支持 PDF 合并、文本提取、元数据读取、PDF/A 转换、旋转、表单查看与填写,以及使用 PKCS#12 证书进行数字签名。电子发票工具可校验和解析 ZUGFeRD 与 XRechnung,收据工具可从图片中提取供应商、金额、增值税和明细,并导出 DATEV 或 Excel。
适用场景
适合需要助手产出成品业务文档的场景:发票、报销单、带公司信头的文件、填写 PDF 表单、签名或归档 PDF,以及结构化 Excel 输出。也适用于德国电子发票合规处理,以及把收据照片转成记账数据。
运行要求
以 Python 包(dokmatiq-docgen-mcp)通过 stdio 在本地运行,需要 Python 3.11 或更高版本。必须在 DOCGEN_API_KEY 环境变量中提供 Dokmatiq API 密钥;可用 DOCGEN_BASE_URL 覆盖默认 API 地址。需要访问 Dokmatiq API 的网络连接。
安装前请注意
该服务器会把文档内容和上传文件发送到 Dokmatiq API,应视为第三方服务。它需要密钥 DOCGEN_API_KEY,建议通过环境变量设置,而不要直接写进 JSON 配置。相关工具可以上传和删除模板、用证书签名 PDF、提交收据图片进行识别,因此对修改已存模板或传输敏感文档的操作需谨慎。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Dokmatiq DocGen,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Dokmatiq DocGen MCP Server

MCP (Model Context Protocol) server that exposes the Dokmatiq DocGen document generation API as tools for AI assistants like Codex, Claude Code, Claude Desktop, Cursor, Continue, Cline, and Hermes.

Use it to generate PDFs, DOCX/ODT documents, Excel workbooks, invoices, e-invoices (ZUGFeRD/XRechnung/Factur-X), receipt exports, signed PDFs, PDF forms, and documents on company letterhead (Briefpapier/Firmenpapier).

Setup

Prerequisites

  • Python 3.11+
  • DocGen API key

Installation

bash
python3.11 -m pip install --user dokmatiq-docgen-mcp

The package requires Python 3.11 or newer. On macOS, the system or Xcode-provided python3 can be too old; use Homebrew Python, pyenv, uv, or another Python 3.11+ runtime if pip cannot find a compatible package.

pip install --user commonly installs the docgen-mcp command into ~/.local/bin. If your MCP client cannot find docgen-mcp, add ~/.local/bin to PATH or use the absolute command path in your MCP config.

Or install from source:

bash
cd mcppip install -e .

Running tests

From the repository root, use the checked-in lockfile to install the MCP server and run its stdio/client smoke tests:

bash
uv run --project mcp python -m unittest discover -s mcp/tests -v

Configuration

Set your API key as an environment variable:

bash
export DOCGEN_API_KEY=dk_live_xxx

Optionally override the base URL:

bash
export DOCGEN_BASE_URL=https://custom.api.endpoint.com

Usage with Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

json
{  "mcpServers": {    "docgen": {      "command": "/Users/you/.local/bin/docgen-mcp",      "env": {        "DOCGEN_API_KEY": "dk_live_xxx"      }    }  }}

Or using uvx:

json
{  "mcpServers": {    "docgen": {      "command": "uvx",      "args": ["dokmatiq-docgen-mcp"],      "env": {        "DOCGEN_API_KEY": "dk_live_xxx"      }    }  }}

Usage with Claude Code

bash
claude mcp add docgen -- docgen-mcp

Set the API key in your environment or .env file.

Usage with Codex

Install the companion skill:

bash
python3 ~/.codex/skills/.system/skill-installer/scripts/install-skill-from-github.py \  --repo dokmatiq/docgen-sdks \  --path plugin/skills/dokmatiq-docgen

Then configure an MCP server named docgen using either docgen-mcp, an absolute path such as /Users/you/.local/bin/docgen-mcp, or uvx dokmatiq-docgen-mcp. Make sure DOCGEN_API_KEY is available to the server process.

Usage with Hermes

Add the MCP server to your Hermes config (~/.hermes/config.yaml):

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

ToolDescription
generate_pdf_from_htmlConvert HTML to PDF
generate_pdf_from_markdownConvert Markdown to PDF
generate_documentGenerate with template, fields, watermark, output format
compose_documentCompose multi-part document from sections
create_invoiceCreate ZUGFeRD-compliant invoice PDF

PDF Tools

ToolDescription
merge_pdfsMerge multiple PDFs into one
extract_text_from_pdfExtract all text content
get_pdf_metadataGet title, author, page count
convert_to_pdfaConvert to PDF/A archival format
rotate_pdfRotate pages

PDF Forms

ToolDescription
inspect_pdf_formList form fields with types and values
fill_pdf_formFill form fields

Digital Signatures

ToolDescription
sign_pdfDigitally sign with PKCS#12 certificate
verify_pdf_signaturesVerify existing signatures
list_certificatesList uploaded certificates

Templates & Fonts

ToolDescription
list_templatesList uploaded templates
upload_templateUpload ODT/DOCX template
delete_templateDelete a template
list_fontsList uploaded fonts

Preview

ToolDescription
preview_pdf_pageRender page as PNG image
get_pdf_page_countGet total page count

Excel Workbooks

ToolDescription
generate_excelGenerate styled XLSX from structured JSON (sheets, columns, formulas, styling, freeze panes)
csv_to_excelConvert CSV to formatted Excel with auto-filter and styled headers
excel_to_csvExtract Excel sheet data as CSV
excel_to_jsonExtract Excel sheet data as structured JSON with typed values
fill_excel_templateFill Excel template with values at named cells and ranges
inspect_excelInspect workbook metadata (sheet names, row/column counts, named ranges)

E-Invoicing

ToolDescription
validate_zugferdValidate ZUGFeRD compliance
extract_zugferdExtract invoice data from ZUGFeRD PDF
validate_xrechnungValidate XRechnung XML
parse_xrechnungParse XRechnung into structured data
detect_xrechnungDetect XRechnung format

Receipt Recognition (AI-Powered)

ToolDescription
extract_receiptExtract structured data from receipt image (vendor, totals, VAT, line items, SKR03/04 account)
extract_receipt_asyncSubmit receipt for async extraction with optional webhook
get_receipt_jobCheck async extraction job status
get_receipt_job_resultGet extraction result of completed job
list_receipt_jobsList all async receipt jobs
receipt_to_documentExtract receipt and generate expense report (PDF/DOCX/ODT)
export_receipts_csvExport receipts as DATEV-compatible CSV
export_receipts_xlsxExport 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

来源:mcp/README.md,提交 5d90266

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

2
  1. v0.1.3最新Sep 26, 2026
  2. v0.1.2Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分