Word MCP Server
High-performance Model Context Protocol (MCP) server for programmatic Word (.docx) document generation and manipulation
Word MCP Server (word-mcp, PyPI: luiccian-word-mcp) is a high-performance Python server implementing the Model Context Protocol (MCP) to provide token-optimized Word document (.docx) creation, batch synthesis, and inspection capabilities for AI assistants (Claude Desktop, Claude Code, Cursor, VS Code / GitHub Copilot, Antigravity, Windsurf, Cline).
Designed from the ground up for maximum token efficiency, it replaces chatty micro-iterations with single-pass document construction, saving over 90% of model tokens and conversational turns.
Key Architectural Highlights
- Compound Mode by Default (v3.0.0): Registers 9 tools by default (
build_document,create_from_markdown,batch_add_content, plus 6 action-dispatched domain tools:word_document,word_content,word_format,word_protection,word_footnote,word_property) to reduce tool-schema context overhead by 77.5%. SetWORD_MCP_TOOLS=full(orgranular) to expose all 40 individual tools. - Single-Pass Document Builder: Create complete, publication-ready documents (headers, footers, dynamic
PAGEnumbers, margins, headings, markdown styling, styled callout boxes, tables, TOCs, images, and lists) in one single MCP call (build_document). - Markdown Direct Generation: Turn structured Markdown into styled Word documents in one pass (
create_from_markdown), including tables, nested lists, inline links, and GitHub-style alert callouts (> [!NOTE],> [!TIP],> [!IMPORTANT],> [!WARNING],> [!CAUTION]). - Visual Design Presets: Built-in typography and spacing standards (
modern,formal,academic,compact,report,apa) with optionalfont_name,font_size, andpage_sizeoverrides. - Lightweight Outline Inspection: Extract paragraph previews and table counts without dumping full body text (
get_document_outline), saving thousands of context tokens. - Batch Content Ingestion: Append multiple sections, tables, callouts, and lists to existing documents in a single atomic operation (
batch_add_content). - Protection & Security: Password encryption, editing restrictions, file integrity checks, and headless PDF export.
- Complete Tool Reference: See
docs/TOOLS.mdfor every tool signature, return shape, and parameter contract. - Zero-Install Execution: Instant launch with
uvx luiccian-word-mcp.
Quick Start with uvx (Recommended)
No manual clone or virtual environment management required. Run the server directly using Astral uv:
# Run with stdio transport (default for AI IDEs)
uvx luiccian-word-mcp
# Or run with SSE transport
uvx luiccian-word-mcp --transport sse --host 127.0.0.1 --port 8000
MCP Client Configuration
Configure your AI client by passing environment variables directly in the client's env block (no .env file is required). By default, the server starts in compound mode (9 tools); set "WORD_MCP_TOOLS": "full" in env to expose all 40 granular tools.
1. Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"word-mcp": {
"command": "uvx",
"args": ["luiccian-word-mcp"],
"env": {
"WORD_MCP_DIRS": "/path/to/your/documents"
}
}
}
}
2. Cursor (.cursor/mcp.json)
{
"mcpServers": {
"word-mcp": {
"command": "uvx",
"args": ["luiccian-word-mcp"],
"env": {
"WORD_MCP_DIRS": "${workspaceFolder}"
}
}
}
}
3. VS Code / GitHub Copilot (.vscode/mcp.json)
VS Code uses a top-level "servers" key and explicit "type": "stdio":
{
"servers": {
"word-mcp": {
"type": "stdio",
"command": "uvx",
"args": ["luiccian-word-mcp"],
"env": {
"WORD_MCP_DIRS": "${workspaceFolder}"
}
}
}
}
4. Antigravity / Windsurf (mcp_config.json)
{
"mcpServers": {
"word-mcp": {
"command": "uvx",
"args": ["luiccian-word-mcp"],
"env": {
"WORD_MCP_DIRS": "/path/to/your/documents"
}
}
}
}
5. Cline / Roo Code (cline_mcp_settings.json)
{
"mcpServers": {
"word-mcp": {
"command": "uvx",
"args": ["luiccian-word-mcp"],
"env": {
"WORD_MCP_DIRS": "/path/to/your/documents"
}
}
}
}
6. Claude Code CLI
claude mcp add word-mcp \
-e WORD_MCP_DIRS="/path/to/your/documents" \
-- uvx luiccian-word-mcp
Environment Variables
All runtime configuration is supplied via standard OS environment variables or the MCP client's env object:
| Variable | Default | Description |
|---|---|---|
WORD_MCP_DIRS |
(current directory) | Comma-separated list of allowed root directories for reading, writing, and listing .docx files. Legacy MCP_ALLOWED_DIRECTORIES remains supported as a fallback. |
WORD_MCP_TOOLS |
compound |
Tool surface mode: compound (9 tools: 3 single-pass + 6 domain dispatchers) or full (or granular, all 40 tools). Legacy WORD_MCP_TOOL_MODE remains supported as a fallback. |
WORD_MCP_LOG_LEVEL |
INFO |
Logging verbosity (DEBUG, INFO, WARNING, ERROR, CRITICAL) written strictly to stderr. |
WORD_MCP_DEV_MODE |
false |
Set to true to default logging to DEBUG and log full exception tracebacks to stderr. |
Token Optimization: Single-Pass vs. Legacy
| Metric | Legacy Micro-Calls | Word MCP Single-Pass |
|---|---|---|
| Tool Calls | 15 - 35 calls per document | 1 single call (build_document) |
| Token Usage | ~15,000 - 30,000 tokens | ~800 - 1,500 tokens (90%+ savings) |
| Disk Operations | Multiple file writes | Single in-memory assembly and write |
| Generation Time | 30 - 60 seconds | Single in-memory assembly |
Visual Design Presets
| Preset | Font Family | Body Size | Line Spacing | Margins | Best For |
|---|---|---|---|---|---|
modern (Default) |
Calibri | 11.0 pt | 1.15 | 2.5 cm | Executive summaries, business proposals, corporate reports |
formal |
Times New Roman | 12.0 pt | 1.50 | Top/Bottom 2.5 cm, Left 3.0 cm | Legal contracts, official letters, meeting minutes |
academic |
Times New Roman | 12.0 pt | 2.00 (Double) | 2.54 cm (1 inch) | University papers, research articles, theses (APA/MLA) |
compact |
Arial | 10.0 pt | 1.00 (Single) | 2.0 cm | Invoices, datasheets, internal memos |
Modular Skills Ecosystem
The repository provides 3 modular, specialized skills in skills/ for LLMs:
word-document-creator: Instructs the model to build complete documents in 1 single pass with headers, footers, pagination, tables, callouts, and presets.word-document-editor: Focuses on lightweight outline inspection, batch mutations, search and replace, and document merging.word-document-security: Handles password locking, editing restrictions, and PDF export for distribution.
Security
- Security Policy: See
SECURITY.mdfor vulnerability disclosure, protection metadata, and threat modeling. - Rules for AI Assistants: See
AGENTS.mdfor official development directives, coding standards, and token optimization rules. - Directory Isolation: Set
WORD_MCP_DIRSto restrict document operations strictly to designated folders. Path canonicalization prevents directory traversal. - Trusted Publishing: Tag-driven PyPI releases (
v*.*.*) use GitHub Actions OIDC and PEP 740 artifact attestation.
Development
# Clone the repository
git clone https://github.com/LuiccianDev/word-mcp.git
cd word-mcp
# Install dependencies with Astral uv
uv sync --all-groups
# Run server locally
uv run luiccian-word-mcp
# Run linting and type checking
uv run ruff check src tests scripts
uv run mypy src
# Run test suite
uv run pytest
License
This project is licensed under the MIT License. See the LICENSE file for details.
Word MCP Server • Maintained by LuiccianDev
Metadata
Release files for luiccian-word-mcp 3.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| luiccian_word_mcp-3.1.0.tar.gz | 60.7 kB | Without provenance | Details for luiccian_word_mcp-3.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| luiccian_word_mcp-3.1.0-py3-none-any.whl | Python 3 | none | any | Details for luiccian_word_mcp-3.1.0-py3-none-any.whl |
Total release size: 139.2 kB
Release files / luiccian_word_mcp-3.1.0.tar.gz
| Download URL | luiccian_word_mcp-3.1.0.tar.gz |
|---|---|
| Size | 60.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6fa4ce15e4a33a1b793d945016b609323876089b61c1856fcfcc608682cf1078
|
|
BLAKE2b-256 checksum How to use checksums |
6dc6e3b00ecd42aabb6ae4599a92998579d5a5271852574f3741f4f6fb56ea23
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / luiccian_word_mcp-3.1.0-py3-none-any.whl
| Download URL | luiccian_word_mcp-3.1.0-py3-none-any.whl |
|---|---|
| Size | 78.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
54f4b40798247144b2994a6605b541cfbc57f823eec36bf48e8945b107d7892b
|
|
BLAKE2b-256 checksum How to use checksums |
5ae14404bf065bcd126bfae0d839145a90c36307c9c152b7654facb9b8636ac9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for luiccian-word-mcp 3.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.