Skip to main content

word-mcp-codemode-live

Windows-first Code Mode MCP server for editing Microsoft Word documents. It exposes a compact discovery and execution interface over file-based DOCX tools and live Word automation instead of loading the entire tool catalog into an agent context.

This project is currently beta software.

Install

Python 3.10 or newer is required. Run the published package in an isolated environment with uvx:

{
  "mcpServers": {
    "word": {
      "command": "uvx",
      "args": ["word-mcp-codemode-live"],
      "env": {
        "MCP_AUTHOR": "Your Name",
        "MCP_AUTHOR_INITIALS": "YN"
      }
    }
  }
}

To install the command permanently:

uv tool install word-mcp-codemode-live
word-mcp-codemode-live

Live editing requires Microsoft Word on Windows. pywin32 drives Word, and PyMuPDF renders Word's PDF output into page images for visual verification.

Modes

  • Code Mode is the default. Clients see search, get_schema, execute, and the two image-producing workflow tools (word_live_edit_batch and word_live_capture_pages). The rest of the catalog is discovered on demand.
  • MCP_TOOL_MODE=full exposes the complete catalog for development and diagnostics.
  • Closed-file tools are limited to create, copy, list, body-only metadata, and PDF export. Editing uses Word's native object model.
  • Windows live tools automate an open Word instance through COM.
  • word_live_list_footnotes_endnotes and word_live_edit_footnotes_endnotes inspect and mutate genuine Word footnotes and endnotes through Word itself.
  • word_live_get_headers_footers inspects every section and primary/first/even story. word_live_edit_headers_footers edits one story at a time with page fields, linkage, Arabic/Roman/letter numbering, restart values, alignment, and font styling.
  • word_live_edit_batch groups multiple edits into one Undo action, verifies factual text/page assertions, saves once, and can return rendered affected pages. Rollback occurs only when Word confirms the batch is its latest Undo entry.
  • word_live_capture_pages returns page images rendered by Word itself.

Reviewed scope

The full development catalog currently contains 78 reviewed tools. The main live families cover text and paragraph formatting, lists, tables, comments, tracked revisions, images, equations, native notes, page layout, section breaks, headers/footers/page numbering, bookmarks, watermarks, Undo, opening, saving, safe close, verified rename/move operations, and rendered-page verification.

The server now includes native Word fields, tables of contents, hyperlinks, cross-reference discovery/insertion, explicit page-break insertion, native heading numbering, Modern Comment resolve/reopen, custom style management, outline and highlight inspection, note configuration, objective layout inspection, field unlinking, native file insertion, persisted semantic snapshots and diffing, and validated Word UI navigation. Misleading or lossy inherited tools remain absent.

Transports

The server supports two transports:

  • stdio is the default and the normal choice for a local MCP client.
  • http is opt-in for clients that need a network endpoint.

HTTP binds to loopback by default. This server can read and modify local files and open Word documents, so do not expose it to an untrusted network without an authentication boundary.

Configuration

Variable Default Purpose
MCP_AUTHOR Author Author for comments and tracked changes
MCP_AUTHOR_INITIALS empty Comment author initials
MCP_TOOL_MODE code code for Code Mode or full for the raw catalog
MCP_TRANSPORT stdio stdio or http
MCP_HOST 127.0.0.1 HTTP bind address
MCP_PORT 8000 HTTP bind port
MCP_PATH /mcp HTTP endpoint path

Development

git clone https://github.com/chikingsley/word-mcp-codemode-live.git
cd word-mcp-codemode-live
uv sync

uv run ruff check .
uv run ruff format --check .
uv run ty check
uv run vulture
uv run pytest
uv build --no-sources
uv run python .github/ci/verify_built_wheel.py

Run the complete Microsoft Word integration suite on a Windows machine with Word installed:

uv run python tests/integration/word_live_suite.py

This exhaustive live-Word test uses disposable documents in a private Word instance. By default, its Markdown and JSON results are written to the system temporary directory, not the repository.

Pull requests and pushes to main run the same checks on Windows, including an isolated install of the built wheel. PyPI publication runs only for a v* tag that exactly matches the version in pyproject.toml, using PyPI Trusted Publishing rather than a stored API token. Configure the pypi GitHub environment and the repository's pending Trusted Publisher on PyPI before the first release. Then bump and tag the release:

uv version --bump patch
git add pyproject.toml uv.lock
git commit -m "release: bump version"
git push origin main
git tag "v$(uv version --short)"
git push origin "v$(uv version --short)"

Source lives under src/word_mcp_codemode_live/. Tool implementations are grouped by domain in flat modules under tools/, lower-level Word and OOXML operations live in core/, and each tool carries its FastMCP metadata beside its implementation. FastMCP's filesystem provider discovers the tool modules used by Code Mode.

Acknowledgments

Forked from ykarapazar/word-mcp-live, which was built from GongRzhe/Office-Word-MCP-Server.

License

MIT. See LICENSE.

Metadata

Release files for word-mcp-codemode-live 0.1.2

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

Source distribution (sdist)

Source distribution for word-mcp-codemode-live 0.1.2
File Size Uploaded Provenance
word_mcp_codemode_live-0.1.2.tar.gz 102.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for word-mcp-codemode-live 0.1.2
File Interpreter ABI Platform
word_mcp_codemode_live-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 230.5 kB

Release files / word_mcp_codemode_live-0.1.2.tar.gz

Download URL word_mcp_codemode_live-0.1.2.tar.gz
Size 102.1 kB
Tags Source
SHA-256 checksum
How to use checksums
442524eb9adbd869635465e89075c8cf412be56be1899cc1aa2d5f0309693da2
BLAKE2b-256 checksum
How to use checksums
4e21665733003b842765eaa9ac6f8f4d6cdca93840ad1f739496883e4af90dc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.

Transparency log

Release files / word_mcp_codemode_live-0.1.2-py3-none-any.whl

Download URL word_mcp_codemode_live-0.1.2-py3-none-any.whl
Size 128.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23be3a08c9432fe23e1277cc86fbfe90947ee7c774c63c1cae55371191f47db7
BLAKE2b-256 checksum
How to use checksums
ef14d65c257c50e8adb91db33bac68c97aaf58baca21d59fe15b8c29b44c633a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.

Transparency log

Security for word-mcp-codemode-live 0.1.2

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for word_mcp_codemode_live-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.

Transparency log

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.

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