get_contents_from_docxLABSCO SUMMARY
Reformat a draft against a template's styles.
Because content and styles are separate calls, a document can be taken apart and reassembled in steps — read the template's styles, put them onto the draft, then write the content — instead of one reformat that either works or does not.
What it is
A .docx reader and writer built as four paginated tools. Content blocks and the paragraph style catalogue are read and written separately, which is what lets a document be reformatted in steps rather than through one all-or-nothing pass.
What you get
- Content blocks — paragraphs and tables — read in pages rather than all at once
- A document's paragraph style catalogue read on its own
- Content written back, with the file created if it does not exist yet
- Style definitions unioned onto an existing file, the incoming definition winning any conflict
Requirements
A recent Python runtime. It works on files on disk, so the documents have to be reachable from wherever the server runs.
Setup effort
Build from source — git clone https://github.com/gossipauthorxpm/docs-mcp
USE CASES
Putting a draft into the house template
Read the styles off the template, union them onto the draft, and write the content into the styled file — the reformat happens as three checkable steps.
Reading a long document a section at a time
Content comes back in pages, paragraphs and tables alike, so a hundred-page file can be worked through without loading all of it at once.
Auditing what styles a document actually uses
The style catalogue is readable on its own, which is how you find out why one heading looks different from the rest.
Producing a new document from scratch
Writing content creates the file if it is missing, and the styles can be laid on afterwards, so a generated report comes out looking like the others.
4 tools
Listed in project docs. Your client may show a different list.
write_contents_to_docxget_styles_from_docxwrite_styles_to_docxBEFORE YOU INSTALL
What to know first
Tools you get
4 tools named in the project's documentation.
Requires
- Python 3.11 or later
- uv
- Docker, only for the Docker route
INSTALLATION
Connect your client
Server setup
git clone https://github.com/gossipauthorxpm/docs-mcp
cd docs-mcp
uv sync --extra devMCP Clients
Cursor — Docker
Build the image once, from the root of your clone:
docker build -t docs-mcp .{
"mcpServers": {
"docs-mcp": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"docs-mcp"
]
}
}
}This block mounts no folders, so the file paths the agent passes must exist inside the container. To work on files on your machine, add a volume that matches those paths, for example "-v", "/home/user/docs:/home/user/docs" before docs-mcp in args.
Cursor — uv
{
"mcpServers": {
"docs-mcp": {
"command": "uv",
"args": [
"run",
"--directory",
"<YOUR_PATH_TO_DOCS_MCP>",
"docx-mcp"
]
}
}
}<YOUR_PATH_TO_DOCS_MCP> is the full path of your clone. Cursor needs an absolute path here.