mcp-docx-template
MCP DOCX Template Server
Ein portabler MCP-Server, der eine gestaltete Microsoft Word-Vorlage klont und sie mit Inhalten aus einem anderen Dokument füllt, wobei Bilder, Layout, Schriftarten, Farben und Absatzstile erhalten bleiben.
Werkzeuge
Der Server stellt drei Werkzeuge bereit:
analyze_template— Untersucht eine.docx-Vorlage und gibt deren Absatzstruktur, Bilder, Stile und ein Inhaltsschema zurück. Schreibt außerdem einen<template>.docx.md-Deskriptor neben die Vorlage, sodass wiederholte Abfragen (z. B. durch den Promptmap_content_to_template) keine erneute Analyse benötigen.extract_content— Extrahiert bearbeitbare Textblöcke aus einem Inhalts-.docx.fill_template— Klont die Vorlage und ersetzt deren bearbeitbaren Text mithilfe einer Label-zu-Text-Zuordnung. Konvertiert das Ergebnis optional in PDF.
Related MCP server: Word MCP Server
Prompts
map_content_to_template— Gegeben einentemplate_pathundcontent_path, liest den.docx.md-Deskriptor der Vorlage (analysiert und schreibt ihn zuerst, falls er noch nicht existiert) sowie den extrahierten Inhalt und gibt eine Anweisungsnachricht zum Erstellen einescontent_mappingzurück. Der Assistent wird angewiesen, den Benutzer direkt zu fragen, wenn eine Zuordnung mehrdeutig ist, und dannfill_templateaufzurufen.
Installation
pip install .Oder, für die Entwicklung mit Tests:
pip install -e ".[dev]"Verwendung mit Claude Desktop
Fügen Sie den Server zu Ihrer Claude-Desktop-Konfiguration hinzu (claude_desktop_config.json):
{
"mcpServers": {
"docx-template": {
"command": "mcp-docx-template-server"
}
}
}Der Server verwendet den stdio-Transport. Nach der Konfiguration kann Claude analyze_template, extract_content und fill_template aufrufen.
Beispielablauf
Analysieren Sie die Vorlage:
{
"template_path": "/path/to/SSIT_Template.docx"
}Extrahieren Sie den Inhalt aus dem Quelldokument:
{
"content_path": "/path/to/NetApp_Content.docx"
}Füllen Sie die Vorlage:
{
"template_path": "/path/to/SSIT_Template.docx",
"content_mapping": {
"overview": "NetApp Cutover Dependency Mapper",
"business_challenge": "Business Challenge",
"body_1": "Long body paragraph...",
"solution_item_1": "Title\nBody text..."
},
"output_path": "/path/to/output.docx",
"convert_to_pdf": true
}Entwicklung
Tests ausführen:
pytestLizenz
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Automate enterprise-grade documents from templates, merge and 100+ conversions: PDF, Office, HTML.
Use your own Word templates to convert Markdown → DOCX/PDF/HTML from any MCP-compatible AI.
Fill PDF and Word templates, generate PDFs and Word documents, and collect e-signatures.
Convert, create and edit Word, PowerPoint, Excel and PDF documents from any AI agent.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables Word document generation from templates using Jinja2 syntax and parsing of DOCX, PDF, and Excel files to extract structured content, metadata, and text.16 npm1MIT
- FlicenseNot gradedqualityDmaintenanceEnables creation and management of Word documents from markdown content, with support for multiple templates and conversion of chat conversations to formatted Word documents.-
- AlicenseBqualityDmaintenanceEnables comprehensive management of Microsoft Word documents with 30+ tools for reading, writing, formatting, template merging, image extraction, equation extraction, and style application.241MIT
- AlicenseBqualityCmaintenanceEnables creating professional Word documents from markdown or structured content with fast, customized formatting via natural language.71ISC