home / mcp / mcp server office

MCP Server Office

Provides MCP-based tools to read, write, and modify Word docx files including paragraphs and tables.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "famano-mcp-server-office": {
      "command": "mcp-server-office",
      "args": []
    }
  }
}

You run a dedicated MCP server that lets you read, create, and modify Word docx files using straightforward tools. This server exposes focused capabilities for handling docx content, including reading complete documents, writing new content, editing specific paragraphs, and inserting new paragraphs. It’s designed to be easy to use from MCP clients, so you can integrate docx workflows into your automation or applications.

How to use

To use the MCP server, connect with an MCP client and call the available tools to manage docx files. You can read an entire document with read_docx, create a new document with write_docx, replace text in specific paragraphs with edit_docx_paragraph, or insert new paragraphs using edit_docx_insert. For each operation, provide the required inputs such as the absolute path to the target file and the content or edits you want to apply. Images in read_docx are shown as [Image] placeholders and track changes are not included.

How to install

Prerequisites you need before starting: Python 3.12 or newer.

pip install mcp-server-office

To start the MCP server, run one of the following commands. Use the default start command if you want the server to listen on its standard port and interface.

mcp-server-office

Alternatively, you can run the server through the uvx runner for environments that prefer it.

uvx mcp-server-office

Notes and tips

- Ensure you pass absolute paths for all file inputs. The tools do not automatically resolve relative paths.

- For write_docx you must provide a content string. Use two line breaks to indicate a new paragraph. Tables should be represented with a [Table] tag and pipe characters to separate columns.

- For edit_docx_paragraph, each edit entry must specify exactly one match per the target paragraph and provide a replacement string.

- For insertions with edit_docx_insert, you can specify a paragraph_index to insert before a given paragraph; if omitted, the new paragraph is appended at the end.

Available tools

read_docx

Read complete contents of a docx file including tables and images. Images are replaced with [Image] placeholders; track changes are not shown.

write_docx

Create a new docx file with the provided content. Use two line breaks for new paragraphs and [Table] with | separators for tables.

edit_docx_paragraph

Make text replacements in specified paragraphs. Each edit targets a specific 0-based paragraph index with a exact-match search string and a replacement string.

edit_docx_insert

Insert new paragraphs into a docx file. Provide text for the new paragraph and an optional 0-based paragraph index to insert before; if omitted, insert at the end.