Skip to main content
Glama

Office-MCP-Server

A unified MCP server for Word, PowerPoint, and Excel. PowerPoint and Excel are planned for later phases — this README currently covers the Word engine.

Word

Direct OOXML manipulation (JSZip + fast-xml-parser) with tracked changes and stable w14:paraId paragraph anchors, not a wrapper around python-docx. Every read tool returns human-readable text plus a trailing <json> block for programmatic use. Every write tool locks its target file per-path so concurrent calls against the same document serialize instead of corrupting it.

Prerequisites

  • Node.js 20+

  • LibreOffice, only for word_convert_to_pdf — install it so soffice is on your PATH, or at one of the standard install locations (/Applications/LibreOffice.app/... on macOS, C:\Program Files\LibreOffice\program\soffice.exe on Windows). No other tool needs it.

Tools

Category

Tools

Reading & search

word_read_document, word_get_document_info, word_search_text

Editing (tracked changes by default)

word_replace_texts, word_edit_paragraphs, word_insert_paragraphs, word_delete_paragraphs, word_ensure_anchors

Formatting

word_format_text, word_set_paragraph_formats, word_highlight_text, word_set_headings

Page layout

word_get_page_layout, word_set_page_layout

Tables

word_insert_table, word_read_table_structure, word_read_table_cell, word_edit_table_cells, word_edit_table_paragraphs, word_insert_table_paragraphs, word_delete_table_paragraphs

Comments

word_add_comment, word_add_comments, word_read_comments, word_reply_to_comment, word_delete_comment

Track changes

word_accept_all_changes, word_reject_all_changes

Images, headers/footers, footnotes

word_list_images, word_read_header_footer, word_read_footnotes

Document creation & styling

word_create_document, word_apply_document_preset, word_create_custom_style

Protection & conversion

word_add_password_protection, word_convert_to_pdf

Merging

word_merge_documents

Notable scope decisions

These keep the engine simple; see decisions.md/phases.md for the full rationale if you hit one of these edges:

  • Tracked-changes replace/insert/delete is paragraph-level, not a surgical cross-run replace — an edited paragraph's runs are rewrapped in w:ins/w:del wholesale.

  • Formatting tools apply directly, without w:rPrChange/w:pPrChange tracked-revision wrappers.

  • Page layout, headers, and footers address only the document's final, body-level section — no multi-section support.

  • Tables are addressed by table_index (0-based, document order), not a stable anchor; table-cell paragraphs still get real w14:paraIds.

  • Comment replies are independent top-level comments anchored to the same paragraph, not real w15:commentsEx parent/child threading.

  • word_merge_documents splices paragraphs/tables from later source documents into the first source's package as-is (full formatting fidelity) but does not remap images/hyperlinks/footnotes/comments — those keep their source document's now-meaningless relationship IDs.

  • word_add_password_protection implements Word's real, Word-enforced "Restrict Editing" password (a w:documentProtection hash in settings.xml) — not full document encryption, and no digital-signature tool (GongRzhe's own version of that feature isn't real either; see ADR-003/ADR-010 in decisions.md).

Example

{
  "tool": "word_replace_texts",
  "arguments": {
    "file_path": "/abs/path/to/report.docx",
    "edits": [{ "search": "Q3 draft", "replace": "Q3 final" }],
    "track_changes": true
  }
}

Available Tools

37 tools
word_accept_all_changesA

Accept all tracked changes in a Word document, keeping insertions and dropping deletions

Inputs: file_path (required).

word_add_commentA

Add a single comment anchored to a paragraph by paraId

Inputs: text (required), para_id (required), file_path (required), author.

word_add_commentsA

Add multiple comments, each anchored to a paragraph by paraId, in one pass

Inputs: comments (required), file_path (required), author.

word_add_password_protectionA

Enforce a password-protected editing restriction (Word's 'Restrict Editing') on a Word document, via settings.xml w:documentProtection

Inputs: password (required), file_path (required), edit_restriction.

word_apply_document_presetB

Apply a named page-layout + default-font preset to a Word document

Inputs: preset (required), file_path (required).

word_convert_to_pdfA

Convert a .docx file to PDF via a local LibreOffice install (requires LibreOffice/'soffice' on PATH or a standard install location)

Inputs: file_path (required), output_path.

word_create_custom_styleB

Create a new custom paragraph style in a Word document's styles.xml

Inputs: style_id (required), file_path (required), style_name (required), bold, +5 more.

word_create_documentA

Create a new, blank .docx file at the given path, optionally seeded with paragraphs

Inputs: file_path (required), initial_paragraphs.

word_delete_commentB

Delete a comment and its anchor markers from a Word document

Inputs: file_path (required), comment_id (required).

word_delete_paragraphsC

Delete paragraphs by paraId

Inputs: para_ids (required), file_path (required), track_changes.

word_delete_table_paragraphsB

Delete paragraphs inside table cells by paraId

Inputs: para_ids (required), file_path (required), track_changes.

word_edit_paragraphsB

Replace the text of specific paragraphs by paraId

Inputs: edits (required), file_path (required), track_changes.

word_edit_table_cellsA

Replace the text of specific table cells by table index, row, and column

Inputs: edits (required), file_path (required), track_changes.

word_edit_table_paragraphsA

Replace the text of a specific paragraph inside a table cell by paraId

Inputs: edits (required), file_path (required), track_changes.

word_ensure_anchorsB

Assign stable paraId anchors to any paragraph missing one

Inputs: file_path (required).

word_format_textB

Apply run-level formatting (bold/italic/underline/font/size/color) to paragraphs by paraId

Inputs: edits (required), file_path (required).

word_get_document_infoA

Get paragraph/word/character counts for a Word document

Inputs: file_path (required).

word_get_page_layoutA

Read page size, orientation, and margins for a Word document

Inputs: file_path (required).

word_highlight_textB

Search for text and apply a highlight color to matching paragraphs

Inputs: edits (required), file_path (required), case_sensitive.

word_insert_paragraphsB

Insert new paragraphs after a given paraId

Inputs: texts (required), file_path (required), after_para_id (required), track_changes.

word_insert_tableA

Insert a new table after a given paraId, optionally seeded with cell text

Inputs: cols (required), rows (required), file_path (required), after_para_id (required), +2 more.

word_insert_table_paragraphsB

Insert new paragraphs into a table cell, after a given paraId

Inputs: texts (required), file_path (required), after_para_id (required), track_changes.

word_list_imagesA

List embedded images in a Word document, with relationship id, target path, and size

Inputs: file_path (required).

word_merge_documentsA

Merge multiple .docx files into one new document, appending paragraphs/tables in order (base document's styles/media are kept; other sources contribute text/table content only)

Inputs: target_file_path (required), source_file_paths (required), add_page_breaks.

word_read_commentsA

Read all comments in a Word document

Inputs: file_path (required).

word_read_documentC

Read a Word document's paragraphs, with anchors

Inputs: file_path (required).

word_read_footnotesA

Read all normal footnotes in a Word document

Inputs: file_path (required).

word_read_table_cellA

Read a single table cell's text and paraIds

Inputs: col (required), row (required), file_path (required), table_index (required).

word_read_table_structureA

Read a table's row/col counts and each cell's text and paraIds

Inputs: file_path (required), table_index (required).

word_reject_all_changesA

Reject all tracked changes in a Word document, restoring deletions and dropping insertions

Inputs: file_path (required).

word_replace_textsC

Find and replace text across a Word document's paragraphs

Inputs: edits (required), file_path (required), track_changes, case_sensitive.

word_reply_to_commentA

Add a reply comment anchored to the same paragraph as an existing comment

Inputs: text (required), file_path (required), comment_id (required), author.

word_search_textB

Search a Word document's paragraphs for matching text

Inputs: query (required), file_path (required), case_sensitive.

word_set_headingsA

Set or clear a heading style on paragraphs by paraId

Inputs: edits (required), file_path (required).

word_set_page_layoutA

Set page size, orientation, and/or margins for a Word document

Inputs: file_path (required), width_pt, height_pt, orientation, +7 more.

word_set_paragraph_formatsB

Apply paragraph-level formatting (alignment/spacing/indent) to paragraphs by paraId

Inputs: edits (required), file_path (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 37 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes, but a few pairs like add_comment/add_comments and edit_table_cells/edit_table_paragraphs could cause confusion without careful reading. Descriptions sufficiently differentiate them.

    Naming Consistency5/5

    All tools follow a consistent word_verb_noun pattern (e.g., word_read_document, word_insert_table, word_accept_all_changes), making actions and targets predictable.

    Tool Count2/5

    With 37 tools, the server is over-sized compared to the typical 3-15 range. While the Word domain is broad, this count feels heavy and could overwhelm agents.

    Completeness3/5

    Core editing, formatting, tables, comments, and tracked changes are well covered, but several significant gaps exist: headers/footers and footnotes are read-only, and images can only be listed, not inserted or modified.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers