MCP Server Office logo

MCP Server Office

by famano

MCP Server Office is a Model Context Protocol (MCP) server designed to read and write Microsoft Word (docx) files. It provides tools for content extraction, creation, and modification.

View on GitHub

Last updated: N/A

What is MCP Server Office?

MCP Server Office is an MCP server that provides tools for interacting with Microsoft Word (docx) files. It allows users to read the contents of docx files, create new docx files, and edit existing ones by replacing or inserting paragraphs.

How to use MCP Server Office?

To use MCP Server Office, first install it using pip: pip install mcp-server-office. Then, start the server by running mcp-server-office or uvx mcp-server-office. The server provides several tools accessible via the MCP protocol, including read_docx, write_docx, edit_docx_paragraph, and edit_docx_insert. Each tool requires specific input parameters such as file paths and content.

Key features of MCP Server Office

  • Read docx files including tables and images

  • Create new docx files with specified content

  • Edit existing docx files by replacing text in paragraphs

  • Insert new paragraphs into docx files

  • Supports table creation using [Table] tag with | separators

Use cases of MCP Server Office

  • Automated document processing

  • Content extraction from Word documents

  • Programmatic creation of reports and documents

  • Batch editing of Word documents

  • Integration with other applications via MCP

FAQ from MCP Server Office

What is the purpose of the [Image] placeholder?

Images in the docx file are converted to [Image] placeholders during the read operation.

How do I create a new paragraph when writing a docx file?

Use double line breaks (\n\n) to create new paragraphs in the content string.

How do I create a table in a docx file?

Use the [Table] tag with | separators to define the table structure. For example: [Table]Column1|Column2\nRow1|Row2[/Table]

Are track changes supported?

No, track changes are not shown when reading docx files.

What are the dependencies for this server?

The server requires Python >= 3.12, mcp[cli] >= 1.2.0, and python-docx >= 1.1.2.