# Word AI [Health: Active]

**Category:** 🏢 Workplace & Productivity  
**Repository:** https://github.com/flyfish-dev/word-ai  
**GitHub Stars:** 10  
**npm Downloads (last month):** 53  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/word-ai

## Description
Structure-preserving Word DOCX editing MCP server and Office.js bridge for AI agents.

## Tools
Capabilities this server exposes over MCP:

- **docx_health_check** — Read-only. Conservative stability report: duplicate tags, complex content controls, fields, tracked changes, comments, table previews and recommended safety policy.
- **docx_inspect** — Read-only. Inspect counts, anchors and optional visible text.
- **docx_package_manifest** — Read-only. DOCX ZIP manifest with part sizes and optional SHA-256 hashes.
- **docx_list_parts** — Read-only. List all package parts with sizes and hashes.
- **docx_part_hashes** — Read-only. Compact DOCX part-hash map for before/after invariance checks.
- **docx_structural_fingerprint** — Read-only. Strong structure fingerprint: package parts, content-control hashes, paragraph hashes, table hashes, outline and health report.
- **docx_map** — Read-only. Codex-friendly map: health, headings, anchors, paragraph chunks, table summaries and hashes.
- **docx_get_outline** — Read-only. Heading outline with section paragraph ranges for large-document chunking.
- **docx_outline** — Read-only alias for docx_get_outline; kept for Codex prompt ergonomics.
- **docx_list_headings** — Read-only. Heading-only view with previews and hashes.
- **docx_read_heading_section** — Read-only. Read one heading section by heading anchor_id or exact heading text.
- **docx_list_anchors** — Read-only. List stable editing anchors: content controls, headings, bookmarks and paraId paragraphs.
- **docx_read_anchor** — Read-only. Read text behind an anchor_id from docx_list_anchors.
- **docx_search_text** — Read-only. Search visible paragraph text; returns paraId, paragraph index, scope and hashes.
- **docx_list_paragraphs** — Read-only. Paragraph inventory with style, paraId, heading level, scope, preview, hash and complexity.
- **docx_read_paragraph** — Read-only. Read one paragraph by paragraph_index or paraId and return hash/complexity.
- **docx_list_content_controls** — Read-only. List content controls with tag, alias, id, preview, text hash and complexity.
- **docx_read_content_control** — Read-only. Read content-control text by w:tag. Preferred primitive for safe edits.
- **docx_extract_plain_text** — Read-only. Extract visible body text for coarse review; never use to regenerate DOCX.
- **docx_export_plain_text** — Write-sidecar only. Export visible body text to .txt; does not modify DOCX.
- **docx_list_tables** — Read-only. List table dimensions, scope tags, complexity and preview rows.
- **docx_read_table** — Read-only. Read a table matrix by table_index and optional content-control scope_tag.
- **docx_read_table_cell** — Read-only. Read a single table cell and return hash for write preconditions.
- **docx_export_table_csv** — Write-sidecar only. Export table to CSV; does not modify DOCX. Uses default sidecar naming when out_path is omitted.
- **docx_table_to_csv** — Write-sidecar only. Export table to CSV using default naming when out_path is omitted.
- **docx_list_styles** — Read-only. List Word styles from styles.xml for style-aware generation.
- **docx_list_numbering** — Read-only. Inspect numbering.xml numId/abstractNum mappings.
- **docx_list_sections** — Read-only. Inspect section properties, margins, page size and header/footer refs.
- **docx_list_fields** — Read-only. List field instructions such as TOC, REF, PAGEREF and SEQ.
- **docx_list_images** — Read-only. List drawing/pict objects with relationship IDs and alt metadata.
- **docx_list_hyperlinks** — Read-only. List hyperlinks with relationship targets, preview and hashes.
- **docx_list_comments** — Read-only. Extract comments.xml previews, author/date/id and hashes.
- **docx_extract_comments** — Read-only. Extract full comment metadata and text.
- **docx_list_bookmarks** — Read-only. List bookmarks and paths for cross-reference preservation.
- **docx_list_headers_footers** — Read-only. Inspect header/footer parts and visible text without modifying them.
- **docx_list_notes** — Read-only. Inspect footnotes/endnotes when present.
- **docx_list_revisions** — Read-only. List tracked-change nodes with previews and hashes.
- **docx_assess_patchset** — Read-only. Resolve PatchSet targets and report risks, touched objects and precondition gaps. Defaults to the .NET Open XML backend when available.
- **docx_plan_patchset** — Read-only. Alias-grade PatchSet planning assessment. Defaults to the .NET Open XML backend when available.
- **docx_preflight_patchset** — Write-temp. Dry-run PatchSet to a temporary copy, validate, and remove output unless keep_output=true. Defaults to the .NET Open XML backend when available.
- **docx_dry_run_patchset** — Write-temp. Same as preflight; useful for explicit Codex dry-run stage. Defaults to the .NET Open XML backend when available.
- **docx_write_index** — Write-sidecar only. Write .wordai index JSON; does not modify DOCX.
- **docx_backup** — Write-sidecar only. Create timestamped backup; does not modify original DOCX.
- **docx_restore_backup** — Write. Restore a backup to target_path.
- **docx_rollback** — Write. Restore from backup and optionally back up replaced file first.
- **docx_apply_patchset** — Write. Apply constrained PatchSet to a new DOCX plus audit JSON; validation gates final commit. Defaults to the .NET Open XML backend when available.
- **docx_validate** — Read-only. Validate structural invariants. Supply touched_* for intentional edits. Defaults to the .NET Open XML backend when available.
- **docx_compare_structure** — Read-only. Same validation report phrased as structural comparison. Defaults to the .NET Open XML backend when available.
- **docx_text_diff** — Read-only. Unified visible-text diff for human review after validation.
- **word_session_list** — Read-only. List active Office.js taskpane sessions registered by an open Word document.
- **word_session_snapshot** — Read-only. Return the latest content-control snapshot for an open Word session. If session_id is omitted, uses the most recently active session.
- **word_session_refresh** — Read-only. Ask the Office.js taskpane to refresh its open-document content-control snapshot.
- **word_session_read_content_control** — Read-only. Ask the Office.js taskpane to read content-control text from the currently open Word document by tag.
- **word_session_preview_patchset** — Read-only. Ask the Office.js taskpane to validate and preview a PatchSet against the currently open Word document without modifying it.
- **word_session_apply_patchset** — Write. Apply a supported content-control PatchSet to the currently open Word document through Office.js, with hash preconditions, audit, and rollback PatchSet.
- **word_session_wrap_selection** — Write. Ask the Office.js taskpane to wrap the current Word selection in a content control with a stable tag/title.
- **word_session_rollback** — Write. Roll back a previous word_session_apply_patchset command by applying its generated rollback PatchSet to the open Word document.
- **word_session_command_status** — Read-only. Return the current status/result/error for a queued Office.js session command.
- **officecli_view_html** — Optional OfficeCLI auxiliary read. Render a DOCX to a bounded HTML snapshot for visual evidence. Does not modify the DOCX.
- **officecli_view_screenshot** — Optional OfficeCLI auxiliary sidecar export. Render a DOCX screenshot/PNG to output_path. Does not modify the DOCX.
- **officecli_view_issues** — Optional OfficeCLI auxiliary read. Run view issues with JSON output for formatting/content/structure evidence.
- **officecli_query** — Optional OfficeCLI auxiliary read. Run CSS-like query with --json. Use only for inspection, never mutation.
- **officecli_validate** — Optional OfficeCLI auxiliary read. Validate the DOCX with OfficeCLI --json as extra evidence after Word AI validation.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "word-ai": {
    "command": "npx",
    "args": ["-y","word-ai-mcp"],
    "env": {
      "WORD_AI_ENGINE": "",
      "WORD_AI_DOTNET_EXE": "",
      "WORD_AI_DOTNET_DLL": "",
      "WORD_AI_DOTNET_RID": "",
      "WORD_AI_DOTNET_NATIVE_DIR": "",
      "WORD_AI_NPM_USE_SOURCE_BOOTSTRAP": ""
    }
  }
}
```

**Requires environment variables:** `WORD_AI_ENGINE`, `WORD_AI_DOTNET_EXE`, `WORD_AI_DOTNET_DLL`, `WORD_AI_DOTNET_RID`, `WORD_AI_DOTNET_NATIVE_DIR`, `WORD_AI_NPM_USE_SOURCE_BOOTSTRAP` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What the Word AI MCP server does

The Word AI MCP server lets MCP clients inspect and modify Microsoft Word DOCX documents without converting them through Markdown or rebuilding the entire package. It treats the original DOCX as the source of truth and applies targeted PatchSet operations instead. This approach is intended for workflows where edits must preserve styles, numbering, tables, images, fields, comments, revisions, headers, footers, and document relationships.

The server exposes tools for document inspection, anchors, headings, paragraphs, tables, fields, images, comments, revisions, PatchSet planning, dry runs, application, validation, rollback, and diffs. It also includes live Word session tools for interacting with an open document through Office.js. Optional read-only OfficeCLI evidence is supported.

## How it works

The Word AI MCP server separates agent planning from document mutation. An agent generates a constrained PatchSet, and the local runtime assesses the proposed changes before producing a candidate DOCX. Writes can use source and expected-content hashes, including `source_sha256`, `expected_old_sha256`, and `expected_old_text`, to prevent stale or unintended edits.

Offline transactions use the .NET 8 Open XML SDK backend when an executable, packaged native backend, or Release DLL is available. The runtime can fall back to a Python OOXML implementation when the engine is set to automatic mode and .NET is unavailable. The resulting output can include the edited DOCX, audit data, and a diff. Validation checks package parts and supported document structures, including content controls, tables, fields, comments, images, revisions, and protected body blocks.

For live editing, the Office.js taskpane connects to a localhost bridge secured with a local token. It registers the open Word document as a session, polls commands queued by the MCP runtime, executes supported operations, and returns audit or rollback information. Content-control tags provide stable anchors for governed edits.

## Setup and configuration

Installation options include the MCP Registry, MCPB release packages, standalone platform bundles, npm, or a source checkout. Standalone bundles are available for Linux, macOS, and Windows architectures listed by the project. A source installation can install the Python facade, build the Office.js taskpane, build the .NET backend when the .NET 8 SDK is available, and configure the agent skill.

The `word-ai mcp` command can run the local server with a document root and allowed additional roots. The `doctor` command provides a readiness check. Full Office.js sessions require the local source workflow and the taskpane build; offline DOCX editing can use a packaged standalone runtime.

Engine selection is controlled with `WORD_AI_ENGINE=auto|dotnet|python`, or per operation for assessment, dry run, apply, and validation tools. Advanced deployments can select a runtime identifier or backend path with the documented `WORD_AI_DOTNET_*` variables.

## Tools and capabilities

- Inspect DOCX structure and locate headings, paragraphs, tables, fields, images, comments, revisions, and content-control anchors.
- Plan, normalize, assess, dry-run, apply, validate, diff, and roll back PatchSets.
- Require hashes or expected text before changing targeted content.
- Edit a currently open Word document through `word_session_*` tools and the Office.js taskpane.
- Use a localhost HTTP bridge and file-backed session command queue for Office workflows.
- Install an agent skill that helps compatible agents choose offline `docx_*` or live `word_session_*` operations.

## Limitations and notes

Writes are PatchSet-only by design; direct source overwrite and full document reconstruction are not the normal path. Live Word editing depends on the Office.js add-in and local bridge, while offline editing depends on an available backend. The Python OOXML path is a fallback when automatic engine selection cannot use .NET, so deployments that require fail-fast behavior can select the .NET engine explicitly. The project describes the OfficeCLI integration as optional and read-only.

_Full upstream README: https://allmcps.com/mcp/word-ai/readme_

