word-plumbing
Click on "Deploy 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., "@word-plumbing Draft my DEMO-101 assignment titled 'Johdanto' and date it today"
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.
word-plumbing — draft template-faithful .docx from an agentic chat
The point of this project: you never open Word's template GUI or copy files around in OneDrive again. A local MCP server exposes the docx pipeline as tools, so any agent session (Vibe, VS Code Copilot, …) can draft a correctly formatted assignment from one plain-language message:
"Draft my assignment for DEMO-101, title 'Luentomuistiinpanojen palautus'. Content: ## Johdanto … and add this screenshot as a figure with caption and alt text. Date it today."
→ a finished .docx appears in C:\ai\data\exports\, with the template's
real styles, metadata controls filled, date stamped, figure captioned with
alt text.
Architecture
chat session (Vibe / VS Code Copilot / any MCP client)
│ MCP over stdio (client spawns the server — nothing to "start")
▼
word_mcp.py (FastMCP server, 5 tools)
│ imports the engine
▼
fill_master.py::generate() ──► stamp_date.py (date picker + header)
│
▼
C:\ai\data\models\master.docx ──► C:\ai\data\exports\<slug>.docx
(never modified) (open in Word, submit)HTTP transport is also available (WORD_MCP_TRANSPORT=streamable-http,
default 127.0.0.1:8002/mcp) for Docker/remote clients — same pattern as
the archimate-mcp wrapper.
Related MCP server: docx-mcp
MCP tools
Tool | Does |
| full pipeline from markdown-ish content text (images referenced by path; relative paths resolve against |
| same, from a content file (image paths resolve next to that file) |
| check content against the human-writing style profile without generating |
| stamp the submission date into an existing .docx (picker + header); fails loudly if no picker |
| list the style IDs a template defines |
Content syntax: ## heading · plain lines → BodyText (lines join) ·
- bullet · 1. numbered ·  → caption above +
centered image + alt text · <!-- --> comments skipped.
Setup (already done in this workspace)
uv add python-docx fastmcpin this project.Vibe:
C:\ai\.vibe\config.tomlhas a[[mcp_servers]]stdio entry (command = this venv'spython.exe, args =word_mcp.py, env setsWORD_MASTER/WORD_EXPORTS). Open a new session inC:\ai— project config loads at session start; tools appear asmcp_word_plumbing.*. (If the folder isn't trusted and tools are missing, move the block to~/.vibe\config.toml.)VS Code: open
C:\aias workspace;C:\ai\.vscode\mcp.jsonregisters the same stdio server → tools in Copilot agent mode.Verify anytime:
uv run test_word_mcp.py(spawns the server, callsdraft_assignmentover MCP, checks the output docx — 9 assertions).
CLI (same engine, no agent)
uv run fill_master.py --master C:\ai\data\models\master.docx `
--content content.md --title "My Assignment" --course DEMO-101
# name/doctype default from config.local.json; -o, --date, --skip-metadata--skip-metadata renders into any plain .docx (content appended, no
controls required).
How it works (the parts worth stealing)
Controls filled by structure: date = the
w:sdtwithw:date, bibliography = the "References" block, title = aliasOtsikko, the rest in document order. No hardcoded positions.Split runs: Word stores text as arbitrary run fragments ("T" + "ehtäväasiakirja") — filling sets the first
w:t, blanks the rest.Stale
w:dataBindingstripped: the template binds date/title controls to customXml store items with old values; Word re-syncs bound controls from the store on open and clobbers fresh values. Unbinding fixes it; the date picker still works for manual overrides.Date stamped, not live (Option B):
w:fullDate+ displayedd.M.yyyyin document and headers — a live DATE field would drift on every open.BIBLIOGRAPHY field left untouched — manage sources in Word's reference manager; F9 rebuilds the field (the "Example. 2026" text is cached output).
Styles are referenced by style ID (
Heading2,BodyText,Caption…), never by display name.
De-sloppify layer (human writing style, EN + FI)
Drafted text is checked against style_profile.json (edit the rules there):
em dash (—) is an error unless mandated/necessary (
allow_em_dash=Truefor those cases); en dash (–) only in numeric ranges like 2020–2026AI-tell phrases banned per language (
banned_phrases.enseeded from blader/humanizer patterns + berenslab/llm-excess-vocab (Kobak et al. 2025)arXiv 2412.11385 focal words;
banned_phrases.fiis our Finnish seed list). Both languages are always checked, so mixed EN/FI documents work
structure warnings: >5 sentences per paragraph, >40 words per sentence
lint_styletool checks without generating;draft_assignment*refuse on errors by default (lint=Falseto skip); CLI:--lintthe
human-writingskill (skills/human-writing/) holds the drafting rules + lint workflow; the vendoredskills/humanizer/(blader/humanizer, MIT, see its ATTRIBUTION.md) is the full ~260-pattern rewrite pass to apply when the linter flags text
Tests: uv run test_style.py (unit + bilingual + MCP-level gating),
uv run test_word_mcp.py (end-to-end draft).
Limitations / next steps
Numbered lists share Word's numbering across blocks (no auto-restart).
Metadata mode expects a template shaped like the Haaga-Helia master; adapt
classify()for others.Public portfolio copy: this repo, published at https://github.com/veenetul/word-plumbing (paths generalized, personal data removed) —
C:\ai-public\word-plumbingis the local staging copy; sync it after changes.
Available Tools
5 toolsdraft_assignmentDraft AssignmentA
Draft a template-faithful .docx from markdown-ish content text.
content syntax: '## Section' headings, plain lines = BodyText paragraphs,
'- item' bullets, '1. item' numbered, '
'
figures (caption above, alt text set), '' comments skipped.
Image paths resolve relative to WORD_EXPORTS.
date: 'YYYY-MM-DD' (default today). master/output: paths; defaults come from WORD_MASTER / WORD_EXPORTS. skip_metadata=True renders into any plain .docx (content appended, no controls needed). lint=True (default) style-checks the content first and refuses on errors; set lint=False to skip, allow_em_dash=True for mandated em dashes. Returns a human-readable summary including the output path.
Inputs: title (required), content (required), date, lint, +7 more. Returns: result
draft_assignment_fileDraft Assignment FileB
Like draft_assignment, but reads the content from a file path.
Image paths in the file resolve relative to that file's folder. lint=True (default) style-checks the file's content first.
Inputs: title (required), content_path (required), date, lint, +7 more. Returns: result
lint_styleLint StyleA
Check markdown-ish content against the human-writing style profile (style_profile.json): no em dashes unless necessary, no AI-tell phrases, short paragraphs and sentences. Returns the violations, or 'clean'.
Inputs: content (required), allow_em_dash. Returns: result
list_stylesList StylesB
List the style IDs defined in a template .docx (use these in content; the renderer looks styles up by ID).
Inputs: master. Returns: result
stamp_date_fileStamp Date FileB
Stamp a submission date into an existing .docx (date picker + header).
date: 'YYYY-MM-DD' (default today). Fails loudly if no date picker found.
Inputs: path (required), date, output. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct step: inspecting styles, linting content, drafting a document, and stamping a date into an existing file. The only overlap is draft_assignment vs draft_assignment_file, which are sibling variants (inline content vs file-sourced content) but explicitly clarify the distinction in their descriptions.
All five tools use verb-first snake_case: stamp_date_file, list_styles, lint_style, draft_assignment, draft_assignment_file. The _file suffix is used consistently to denote path-based variants.
Five tools is well-scoped for a focused Word document drafting/plumbing server. Every tool maps to a concrete pipeline stage with no filler.
The core lifecycle is covered: inspect template styles, lint content, render a .docx from inline or file content, and stamp a date. Minor gaps exist — no tool to read/extract content from an existing .docx or to update/replace content beyond date stamping — but agents can work around these.
Maintenance
Related MCP Connectors
Generate PDF, Word (.docx) and PowerPoint (.pptx) documents from Markdown over MCP.
Create Word .docx files from sections or markdown, fill templates, and read text from a .docx.
Use your own Word templates to convert Markdown → DOCX/PDF/HTML from any MCP-compatible AI.
Citation-guarded .docx/.pptx writing MCP: PubMed refs, Yjs editing, turn rollback & comments.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables creating professional Word documents from markdown or structured content with fast, customized formatting via natural language.71ISC
- FlicenseAqualityDmaintenanceMCP server for generating professionally formatted Word documents (.docx). Supports corporate templates (colors, fonts, logo), headers/footers, and Markdown conversion.4-
- FlicenseNot gradedqualityDmaintenanceProvides lightweight documentation review tools including issue detection, readability scoring, style checking, and document summarization for integration with MCP-compatible clients.-
- AlicenseAqualityCmaintenanceMCP server for Office documents — create, edit, fill templates, convert, and extract Word/Excel/PowerPoint. LaTeX-style markup, math formulas, PDF export, template loops, and document diff. stdio / SSE / Streamable HTTP with auth and rate limiting.12Apache 2.0