MS Word MCP server

Integrates with Microsoft Word documents to enable reading, writing, and editing of text, tables, and images for automated document processing and content generation.
Back to servers
Provider
famano
Release date
Jan 21, 2025
Language
Python
Stats
13 stars

The MCP Server Office enables you to read, write, and edit Microsoft Word (docx) files through a Model Context Protocol server interface, making document manipulation programmatically accessible.

Installation

Install the MCP server using pip:

pip install mcp-server-office

If you prefer using uv:

uvx mcp-server-office

Starting the Server

Start the MCP server by running:

mcp-server-office

Available Tools

The server provides four main tools for working with Word documents:

Read DOCX Files

The read_docx tool extracts the complete contents of a docx file, including tables and images.

Input parameters:

  • path (string) - Absolute path to the target file

Note: Images appear as [Image] placeholders, and track changes are not shown in the output.

Write DOCX Files

The write_docx tool creates new docx files with content you specify.

Input parameters:

  • path (string) - Absolute path to the target file
  • content (string) - Content to write to the file

Formatting guidelines:

  • Use double line breaks to create new paragraphs
  • Use [Table] tag with | separators to create tables

Edit DOCX Paragraphs

The edit_docx_paragraph tool makes text replacements in specific paragraphs of a docx file.

Input parameters:

  • path (string) - Absolute path to the file to edit
  • edits (array) - List of dictionaries containing:
    • paragraph_index (number) - 0-based index of the paragraph to edit
    • search (string) - Text to find within the specified paragraph
    • replace (string) - Text to replace with

Note: Each search string must match exactly once within the specified paragraph.

Insert Content into DOCX Files

The edit_docx_insert tool inserts new paragraphs into a docx file.

Input parameters:

  • path (string) - Absolute path to the file to edit
  • inserts (array) - List of dictionaries containing:
    • text (string) - Text to insert as a new paragraph
    • paragraph_index (number, optional) - 0-based index of the paragraph before which to insert. If not specified, the text will be inserted at the end.

System Requirements

  • Python 3.12 or newer
  • Required dependencies (installed automatically):
    • mcp[cli] ≥ 1.2.0
    • python-docx ≥ 1.1.2

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later