Skip to main content
Glama

MCP Word Server πŸ“

A Model Context Protocol (MCP) server that gives AI agents full control over Microsoft Word documents. Create, read, edit, format, and manage .docx files programmatically through a standardized MCP interface.

✨ Features

Document Management

  • Create new Word documents

  • Open existing .docx files

  • Save / Save As documents

  • Close documents

  • List open documents

Content Operations

  • Read full document text or specific paragraphs

  • Add paragraphs, headings, page breaks

  • Insert text at specific positions

  • Delete paragraphs

  • Replace text (find & replace)

  • Search text within documents

Formatting

  • Font styling – bold, italic, underline, strikethrough, color, size, font name

  • Paragraph alignment – left, center, right, justify

  • Paragraph spacing – before/after spacing, line spacing

  • Heading levels – H1 through H9

Tables

  • Create tables with custom rows and columns

  • Read table data

  • Add rows/columns to existing tables

  • Write to specific cells

  • Style tables with built-in Word table styles

Images

  • Insert images into documents

  • Resize images (width & height in inches)

Headers & Footers

  • Add/Edit headers and footers

  • Different first page headers/footers

Styles & Templates

  • Apply built-in Word styles

  • List available styles

Export

  • Export to PDF

  • Export to HTML

Page Setup

  • Set page margins, orientation, paper size

Live Word Application Control (COM)

  • Launch Microsoft Word application

  • Control Word via COM automation on Windows

  • Works offline with python-docx for .docx file manipulation

Related MCP server: Word Document MCP Server

πŸš€ Quick Start

Prerequisites

  • Python 3.10+

  • Microsoft Word (for COM automation features, Windows only)

  • python-docx and pywin32 libraries

Installation

# Clone the repository
git clone https://github.com/YOUR_USERNAME/MCP_Word.git
cd MCP_Word

# Install dependencies
pip install -r requirements.txt

Running the MCP Server

# Run with stdio transport (default for MCP)
python src/server.py

Configuration for Claude Desktop / Antigravity

Add to your MCP configuration:

{
  "mcpServers": {
    "word": {
      "command": "python",
      "args": ["src/server.py"],
      "cwd": "/path/to/MCP_Word"
    }
  }
}

πŸ“ Project Structure

MCP_Word/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ server.py              # MCP server entry point
β”‚   β”œβ”€β”€ word_engine.py         # Core Word manipulation engine
β”‚   β”œβ”€β”€ tools/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ document_tools.py  # Document CRUD operations
β”‚   β”‚   β”œβ”€β”€ content_tools.py   # Text/content manipulation
β”‚   β”‚   β”œβ”€β”€ format_tools.py    # Formatting operations
β”‚   β”‚   β”œβ”€β”€ table_tools.py     # Table operations
β”‚   β”‚   β”œβ”€β”€ image_tools.py     # Image operations
β”‚   β”‚   β”œβ”€β”€ header_footer_tools.py  # Headers & footers
β”‚   β”‚   β”œβ”€β”€ style_tools.py     # Style management
β”‚   β”‚   β”œβ”€β”€ export_tools.py    # Export (PDF, HTML)
β”‚   β”‚   └── page_setup_tools.py    # Page layout settings
β”‚   └── utils/
β”‚       β”œβ”€β”€ __init__.py
β”‚       └── helpers.py         # Shared utilities
β”œβ”€β”€ tests/
β”‚   └── test_word_engine.py
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ .gitignore
β”œβ”€β”€ LICENSE
└── README.md

πŸ›  Available MCP Tools

Tool

Description

create_document

Create a new blank Word document

open_document

Open an existing .docx file

save_document

Save the current document

save_document_as

Save document to a new path

close_document

Close a document

list_documents

List all open documents

read_document

Read all text from a document

read_paragraph

Read a specific paragraph

add_paragraph

Add a new paragraph

add_heading

Add a heading (level 1-9)

insert_text

Insert text at a position

delete_paragraph

Delete a specific paragraph

find_and_replace

Find and replace text

search_text

Search for text occurrences

format_text

Apply font formatting

set_paragraph_alignment

Set paragraph alignment

set_paragraph_spacing

Set paragraph spacing

create_table

Create a new table

read_table

Read table data

add_table_row

Add a row to a table

add_table_column

Add a column to a table

write_table_cell

Write to a table cell

style_table

Apply a table style

insert_image

Insert an image

add_header

Add/edit document header

add_footer

Add/edit document footer

apply_style

Apply a Word style

list_styles

List available styles

export_to_pdf

Export document to PDF

export_to_html

Export document to HTML

set_page_margins

Set page margins

set_page_orientation

Set page orientation

set_page_size

Set paper size

add_page_break

Insert a page break

πŸ“„ License

MIT License – see LICENSE for details.

🀝 Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      Not graded
      maintenance
      Enables AI assistants to create, read, and manipulate Microsoft Word documents with comprehensive formatting, table creation, content management, and document protection capabilities. Supports advanced operations like merging documents, PDF conversion, and rich text formatting through a standardized interface.
      32
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to read, edit, and create Microsoft Word documents (.docx) with support for rich text, tables, and images, deployable locally or via SSE.
      3
      MIT
    • A
      license
      Not graded
      quality
      F
      maintenance
      Enables AI assistants to create, edit, and extract data from Microsoft Word documents programmatically, supporting document creation, content editing, table manipulation, parameter extraction, and template generation.
      1
      MIT