Labsco
MCP SERVER

Word MCP Server

by cuongpham2107

Build .docx files from a conversation — headings, styled runs, images from disk or a numpy array, and tables — through python-docx.

Document Conversion, PDF & Translation
Summary
Run-level styling is what separates this from a Markdown exporter.

Being able to add a differently-styled run inside an existing paragraph — one phrase bold and red, the next highlighted yellow — is the difference between generating a document and generating a document someone will accept. The image path taking a numpy array as well as a file path is a small but telling detail: a chart rendered in memory can go straight into the report without a temp file.

What it is

A FastMCP server that creates and edits Microsoft Word documents through python-docx. It covers the document-assembly path: open or create, add headings and paragraphs, style individual runs inside a paragraph, insert images and tables, then save.

What you get
  • `create_new_document` and `open_document` to start from scratch or from an existing `.docx`
  • `add_heading` with a level, and `add_paragraph` with style, font size, bold, italic and alignment
  • `add_run_to_paragraph`, which styles part of a paragraph differently — bold, coloured, or highlighted — rather than forcing one style per block
  • `add_picture` from a file path with a width, or straight from a numpy array read through OpenCV
  • `add_table` with rows, columns and a table style, then cell-by-cell text
  • A fixed colour vocabulary for text and highlights: black, blue, green, dark blue, dark red, dark yellow, dark green, pink, red, white, teal, yellow, violet, gray25 and gray50
  • `save_document` to write the result out
Requirements

Python 3.12+ with python-docx, opencv-python, numpy and FastMCP. Install with `uv pip install .` inside a virtual environment, then point the client at `server.py` using that environment's Python interpreter — the README's config uses the absolute path into `.venv`. The project is `word-mcp-server` (0.1.1 in pyproject). Documentation is in Vietnamese. Resources and prompts live in the `resources` and `prompts` folders.

Setup effort

One command — uvx word-mcp-server