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.
Install the MCP server using pip:
pip install mcp-server-office
If you prefer using uv:
uvx mcp-server-office
Start the MCP server by running:
mcp-server-office
The server provides four main tools for working with Word documents:
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 fileNote: Images appear as [Image]
placeholders, and track changes are not shown in the output.
The write_docx
tool creates new docx files with content you specify.
Input parameters:
path
(string) - Absolute path to the target filecontent
(string) - Content to write to the fileFormatting guidelines:
[Table]
tag with |
separators to create tablesThe edit_docx_paragraph
tool makes text replacements in specific paragraphs of a docx file.
Input parameters:
path
(string) - Absolute path to the file to editedits
(array) - List of dictionaries containing:
paragraph_index
(number) - 0-based index of the paragraph to editsearch
(string) - Text to find within the specified paragraphreplace
(string) - Text to replace withNote: Each search string must match exactly once within the specified paragraph.
The edit_docx_insert
tool inserts new paragraphs into a docx file.
Input parameters:
path
(string) - Absolute path to the file to editinserts
(array) - List of dictionaries containing:
text
(string) - Text to insert as a new paragraphparagraph_index
(number, optional) - 0-based index of the paragraph before which to insert. If not specified, the text will be inserted at the end.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.
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"
]
}
}
}
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.
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.