Skip to main content

Word MCP Server

High-performance Model Context Protocol (MCP) server for programmatic Word (.docx) document generation and manipulation

PyPI Version Python Version uv License MCP Compatible

Word MCP Server (word-mcp, PyPI: luiccian-word-mcp) is a Python server implementing the Model Context Protocol (MCP) to provide advanced, token-optimized Word document (.docx) creation and editing capabilities for AI assistants (Claude, Cursor, Copilot, 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 Highlights

  • ⚡ Single-Pass Document Builder: Create complete, publication-ready documents (headers, footers, page numbers, margins, headings, paragraphs with markdown styling, tables, lists) in 1 single MCP call (word_build_document).
  • 📝 Markdown Direct Generation: Instantly turn structured markdown text into professionally styled Word documents (word_create_from_markdown).
  • 🎨 Visual Design Presets: Built-in typography and spacing standards (modern, formal, academic, compact).
  • 🔍 Lightweight Outline Inspection: Extract heading hierarchies and document stats without dumping full body text (word_get_document_outline), saving context tokens.
  • 📦 Batch Content Ingestion: Append multiple sections, tables, and lists to existing documents in a single operation (word_batch_add_content).
  • 🔒 Protection & Security: Password protection, editing restrictions, file integrity checks, and PDF conversion.
  • 🚀 Zero-Install Execution: Instant launch with uvx luiccian-word-mcp.

No manual clone or installation required. You can run the server directly using 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

1. Claude Desktop

Add this configuration to your claude_desktop_config.json:

{
  "mcpServers": {
    "word-mcp": {
      "command": "uvx",
      "args": ["luiccian-word-mcp"],
      "env": {
        "MCP_ALLOWED_DIRECTORIES": "/path/to/your/documents"
      }
    }
  }
}

Tip (Local checkout): If running from a local clone:

{
  "mcpServers": {
    "word-mcp": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/word-mcp", "word-mcp"],
      "env": {
        "MCP_ALLOWED_DIRECTORIES": "/path/to/your/documents"
      }
    }
  }
}

2. Cursor (.cursor/mcp.json)

{
  "mcpServers": {
    "word-mcp": {
      "command": "uvx",
      "args": ["luiccian-word-mcp"],
      "env": {
        "MCP_ALLOWED_DIRECTORIES": "${workspaceFolder}"
      }
    }
  }
}

Local Development with uv

# 1. Clone repository
git clone https://github.com/LuiccianDev/word-mcp.git
cd word-mcp

# 2. Sync virtual environment and dependencies
uv sync --all-groups

# 3. Run server
uv run word-mcp

# 4. Run tests and linter
uv run pytest
uv run ruff check .

CI/CD & PyPI Trusted Publishing

The repository includes GitHub Actions workflows powered by Astral uv:

  • CI (.github/workflows/ci.yml): Runs tests & lint across Python 3.11, 3.12, and 3.13 on Ubuntu. Uses paths-ignore and concurrency cancellation to preserve GitHub Actions minutes.
  • Releases (.github/workflows/release.yml): Triggered on v* tags or manually via workflow dispatch. Builds wheel & sdist with uv build, auto-extracts release notes from CHANGELOG.md, and creates a GitHub Release.
  • PyPI Publishing (.github/workflows/publish-pypi.yml): Automated PyPI deployment using Trusted Publishing (OIDC) and PEP 740 cryptographic build provenance attestation (actions/attest-build-provenance@v2).

PyPI Trusted Publisher Configuration

To set up or verify Trusted Publishing on PyPI.org:

Setting Value
PyPI Project Name luiccian-word-mcp
Owner LuiccianDev
Repository name word-mcp
Workflow name publish-pypi.yml
Environment name pypi

Token Optimization: Single-Pass vs. Legacy

Metric Legacy Micro-Calls Word MCP Single-Pass
Tool Calls 15 – 35 calls per document 1 single call (word_build_document)
Token Usage ~15,000 – 30,000 tokens ~800 – 1,500 tokens (90%+ savings)
Disk Operations Multiple file writes Single in-memory assembly & write
Generation Time 30 – 60 seconds < 0.25 seconds

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.5cm, Left 3.0cm 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, and presets.
  • word-document-editor: Focuses on lightweight outline inspection, batch mutations, search & replace, and document merging.
  • word-document-security: Handles password locking, editing restrictions, and PDF export for distribution.

Project Structure

src/
└── word_mcp/
    ├── core/               # Word document manipulation engines
    │   ├── batch.py        # High-performance single-pass builder & markdown parser
    │   ├── document.py     # Document lifecycle & outline extraction
    │   ├── content.py      # Paragraphs, headings, and lists
    │   ├── tables.py       # Table styling & cell manipulation
    │   └── protection.py   # Password hashing & editing locks
    ├── tools/              # Exposed MCP tools (consolidated)
    │   ├── batch_tools.py  # word_build_document, word_create_from_markdown
    │   ├── document_tools.py # Lifecycle, text, outline, info, PDF
    │   ├── content_tools.py  # Paragraphs, headings, links, bookmarks
    │   ├── format_tools.py   # Styles, headers, footers, page layout
    │   └── protection_tools.py # Protect, unprotect, verify
    ├── models/             # Pydantic response models
    ├── validation/         # Input validators & parameter alias tolerance
    ├── server.py           # FastMCP server registration
    └── __main__.py         # Server entry point

Security

  • Restricted Directory Access: Set MCP_ALLOWED_DIRECTORIES to restrict file access to specific folders.
  • Path Resolution: Secure path canonicalization prevents path traversal outside allowed directories.
  • Non-destructive Defaults: Shims maintain full backward compatibility for existing scripts and configurations.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Word MCP Server • Created by LuiccianDev

Metadata

Release files for luiccian-word-mcp 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for luiccian-word-mcp 2.0.0
File Size Uploaded Provenance Actions
luiccian_word_mcp-2.0.0.tar.gz 128.7 kB Without provenance Details for luiccian_word_mcp-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for luiccian-word-mcp 2.0.0
File Interpreter ABI Platform Actions
luiccian_word_mcp-2.0.0-py3-none-any.whl Python 3 none any Details for luiccian_word_mcp-2.0.0-py3-none-any.whl

Total release size: 196.0 kB

Release files / luiccian_word_mcp-2.0.0.tar.gz

Download URL luiccian_word_mcp-2.0.0.tar.gz
Size 128.7 kB
Tags Source
SHA-256 checksum
How to use checksums
61737e3496600bf316d9e3db8fe2c01599ae3fc0643e0ffd6ee9965c01574bd5
BLAKE2b-256 checksum
How to use checksums
1d6a88add4176c012e7feaa56bb2a2a509a8378eb35717451bc4ae95b0c3cb37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","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-2.0.0-py3-none-any.whl

Download URL luiccian_word_mcp-2.0.0-py3-none-any.whl
Size 67.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc597fb59ca344a4f47afc154091f3e21dd52ca23cbb031fb91244a33e4e567f
BLAKE2b-256 checksum
How to use checksums
9d1b43138810a8270370978fdcb5850667ce87b2e04a5d8248cfd4e8fd913d7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","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 2.0.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.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page