Word MCP Server is a Python application that enables creation and editing of Microsoft Word (.docx) documents through an API. It uses FastMCP to build tools for interacting with Word documents, allowing you to programmatically manipulate document content.
uv venv
source venv/bin/activate
uv pip install .
To use Word MCP Server with Large Language Models (LLMs), you need to configure it through a JSON file:
{
"mcpServers": {
"word-mcp-server": {
"command": "/path/to/word-mcp-server/.venv/bin/python3",
"args": ["/path/to/word-mcp-server/server.py"]
}
}
}
mcpServers
: Object containing configuration for MCP serversword-mcp-server
: Identifier name for the servercommand
: Path to Python interpreter (usually within virtual environment)args
: Command line parameters, where the first parameter is the path to server.pyOnce configured, the server will start and be ready to receive commands from the LLM.
create_new_document()
open_document("path/to/document.docx")
# Adding headings
add_heading("Document Title", level=0)
add_heading("Chapter 1", level=1)
# Adding plain paragraphs
add_paragraph("This is a paragraph content.")
# Adding formatted paragraphs
add_paragraph(
"This is a formatted paragraph.",
style="Normal",
font_size=14,
bold=True,
italic=False,
alignment=WD_PARAGRAPH_ALIGNMENT.CENTER
)
# Create a paragraph
p = add_paragraph("This is a basic paragraph. ")
# Add formatted text
add_run_to_paragraph(
p,
"This part is bold and red.",
bold=True,
color="red"
)
# Add highlighted text
add_run_to_paragraph(
p,
" This part is highlighted in yellow.",
highlight="yellow"
)
# Add image from file path
add_picture("path/to/image.jpg", width=4.0)
# Or add image from numpy array
import numpy as np
import cv2
img = cv2.imread("path/to/image.jpg")
add_picture(img, width=3.5)
# Create a table with 3 rows and 4 columns
table = add_table(rows=3, cols=4, style="Table Grid")
# Fill data into the table
table.cell(0, 0).text = "Row 1, Column 1"
table.cell(0, 1).text = "Row 1, Column 2"
# ...
When using color
and highlight
parameters, you can use the following values:
# Create a new document
create_new_document()
# Add title
add_heading("Project Report", level=0)
# Add creator information
p = add_paragraph("Created by: ")
add_run_to_paragraph(p, "John Doe", bold=True)
# Add table of contents
add_heading("Table of Contents", level=1)
add_paragraph("1. Introduction")
add_paragraph("2. Content")
add_paragraph("3. Conclusion")
# Add content
add_heading("1. Introduction", level=1)
add_paragraph("This is the introduction section of the project...")
# Add image
add_paragraph("Illustrative image:")
add_picture("project_diagram.jpg", width=5.0)
# Add data table
add_heading("Data Table", level=2)
table = add_table(rows=3, cols=3)
table.cell(0, 0).text = "Data 1"
table.cell(0, 1).text = "Data 2"
table.cell(0, 2).text = "Data 3"
# Fill other data...
# Save document
save_document("project_report.docx")
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.