Skip to content
MCP server
Registry

docx4j Word documents MCP Server

Read, convert and fill Word (.docx) documents: templates, Markdown/HTML in and out, PDF with math.

docx4j Word documents scores 47 (Fair), with no SPDX license recorded. It installs as a local process. It declares 8 tools. Filed under Knowledge. GitHub shows 0 stars. Install configs are generated for 10 clients. Being listed in the registry is not the same as being vendor-official.

by plutextNo license0 stars
Trust score
47Fair
Trust score 47 of 100, Fair

Fair trust

47 of 100 from six public signals. Nobody can buy a point.

  • Listed in the official MCP registry.
  • No license recorded.
How we score trust
Scorecard

License, quality and maintenance

How grades work
Trust breakdown

Where the 47 comes from

22 + 15 + 0 + 0 + 7 + 3 = 47. Each factor is capped, so no single signal can carry a listing.

Registry22 / 30

Active in the official MCP registry, plus a known vendor namespace.

Registry: 22 of 30 points.
Maintenance15 / 20

How recently the repository saw a commit or release.

Maintenance: 15 of 20 points.
Popularity0 / 20

GitHub stars and weekly downloads, on a log scale.

Popularity: 0 of 20 points.
License0 / 10

A clear, OSI-style open-source license.

License: 0 of 10 points.
Security7 / 10

Not archived, a secure install path, a pinned version.

Security: 7 of 10 points.
Docs3 / 10

A real summary, a README with depth, listed tools.

Docs: 3 of 10 points.

Install

Pick your client, copy the config, paste it in.

Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.

~/Library/Application Support/Claude/claude_desktop_config.json
{  "mcpServers": {    "plutext-docx4j-mcp": {      "command": "npx",      "args": [        "-y",        "https://github.com/plutext/docx4j-mcp/releases/download/v0.2.0/docx4j-mcp.mcpb"      ]    }  }}

Environment variables

This server does not declare environment variables.

Tools8Tool docs quality grade C

All capabilities
  • docx → standalone HTML (visitor exporter; imagedirpath for images; optional updatetoc).

  • docx → PDF via XSL-FO / Apache FOP; equations and WMF/EMF drawings rendered as vectors; optional updatetoc; reports font substitutions. Bundles metric-compatible fonts (Carlito, Caladea, Liberation, Tinos…).

  • What data a template wants: skeleton XML + xpaths/conditions (OpenDoPE, bound content controls) or MERGEFIELD names and format switches (mail merge). Call before filltemplate.

  • docx → Markdown (structure preserved). Options: trackedchanges accept/markup, imagedirpath.

  • Plain text, one line per paragraph/table.

  • Fill a template, preserving its formatting. data is an XML string (OpenDoPE / bound controls; repeats and conditions processed) or a JSON object (mail merge).

  • HTML → docx via docx4j-ImportXHTML. Loose HTML accepted (normalised with jsoup); h1–h6 map to heading styles; optional stylestemplatepath; mode: altchunk embeds the HTML for Word to convert on open. Remote images/stylesheets are never fetch

  • Markdown → properly styled docx (headings, numbering, GFM tables, footnotes, task lists, TeX math). Optional stylestemplatepath.

About

docx4j-mcp

A Model Context Protocol server that exposes docx4j's engine to AI agents: read, convert and fill Word (.docx) documents from Claude Desktop, Claude Code, or any MCP client.

Engine: docx4j 17.1.0 (the server versions independently; the bundled docx4j version is in the pom, the server's startup log, and its MCP instructions).

MCP protocol: 2025-11-25 (Java SDK 2.0.1, the newest available). Clients speaking the 2026-07-28 spec work if they implement its dual-era fallback: the server/discover probe gets a clean JSON-RPC -32601 and the client falls back to initialize (verified over stdio). A modern-only client with no fallback cannot connect until the SDK's 2026-07-28 support (milestone 2.2) ships, at which point this server will migrate.

Status: phase 3 — all tools work over stdio against released docx4j 17.0.4; packaged as a runnable jar, an .mcpb bundle, an OCI image and a Claude Code plugin. The plan, tool surface and phasing are in CR-mcp-server.md.

Build

Requires JDK 17+. All docx4j dependencies (docx4j 17.1.0, ImportXHTML 17.0.4) come from Maven Central.

mvn package            # -> target/docx4j-mcp.jar (shaded, runnable)
mvn test               # JUnit 5 tests against the tool handlers directly

Run

java -jar target/docx4j-mcp.jar --root /path/to/documents [--root ...] [--max-inline-chars N]

Bare directory arguments are also accepted as roots (this is what the .mcpb bundle's folder picker passes).

Claude Desktop, one click

Install docx4j-mcp.mcpb from the GitHub release (Settings → Extensions), pick the folders the server may touch, done. Built locally with packaging/build-mcpb.sh. Requires Java 17+ on your PATH.

Docker

docker run -i --rm -v /path/to/documents:/data ghcr.io/plutext/docx4j-mcp

(paths in tool calls are then container paths under /data; packaging/docker/Dockerfile to build locally).

Claude Code plugin

packaging/claude-plugin/ bundles the server config and a skill for the template/authoring workflows. Set DOCX4J_MCP_JAR (path to the jar) and optionally DOCX4J_MCP_ROOTS.

Releasing

Tag vX.Y.Z: .github/workflows/release.yml builds jar + mcpb, attaches them to the GitHub release, pushes ghcr.io/plutext/docx4j-mcp, and publishes server.json (sha filled in) to the official MCP registry via GitHub OIDC.

Every file path an agent passes must resolve inside one of the --root directories (symlinks are resolved first). There is no default root; the server refuses to start without one. Logging goes to stderr; stdout is the protocol. Tools that return text inline cap it at --max-inline-chars (default 200000) and otherwise write to output_path or truncate with a marker.

Claude Code (.mcp.json in your project)

{
  "mcpServers": {
    "docx4j": {
      "command": "java",
      "args": ["-jar", "/path/to/docx4j-mcp.jar", "--root", "/path/to/documents"]
    }
  }
}

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "docx4j": {
      "command": "java",
      "args": ["-jar", "/path/to/docx4j-mcp.jar", "--root", "/Users/you/Documents"]
    }
  }
}

Tools

ToolWhat it does
describe_templateWhat data a template wants: skeleton XML + xpaths/conditions (OpenDoPE, bound content controls) or MERGEFIELD names and format switches (mail merge). Call before fill_template.
fill_templateFill a template, preserving its formatting. data is an XML string (OpenDoPE / bound controls; repeats and conditions processed) or a JSON object (mail merge).
convert_to_pdfdocx → PDF via XSL-FO / Apache FOP; equations and WMF/EMF drawings rendered as vectors; optional update_toc; reports font substitutions. Bundles metric-compatible fonts (Carlito, Caladea, Liberation, Tinos…).
markdown_to_docxMarkdown → properly styled docx (headings, numbering, GFM tables, footnotes, task lists, TeX math). Optional styles_template_path.
docx_to_markdowndocx → Markdown (structure preserved). Options: tracked_changes accept/markup, image_dir_path.
html_to_docxHTML → docx via docx4j-ImportXHTML. Loose HTML accepted (normalised with jsoup); h1–h6 map to heading styles; optional styles_template_path; mode: altchunk embeds the HTML for Word to convert on open. Remote images/stylesheets are never fetched.
convert_to_htmldocx → standalone HTML (visitor exporter; image_dir_path for images; optional update_toc).
extract_textPlain text, one line per paragraph/table.

Mathematics is supported end to end: TeX math in Markdown ($..$) and MathML in HTML become real, editable Word equations (OMML), and equations render in PDF (via jeuclid/FOP, no LaTeX toolchain) and HTML (native MathML, no JavaScript) output. Known limitation: a very long single display equation is one atomic graphic in PDF and does not line-wrap.

Writers take output_path and refuse to overwrite unless overwrite: true.

Example (Claude Code)

Use describe_template on contracts/nda-template.docx, then fill it for Acme Pty Ltd and write contracts/nda-acme.docx, then convert that to PDF.

The agent gets the skeleton XML (or MERGEFIELD names), fills it, and calls fill_template and convert_to_pdf; the results tell it what was written and which fonts were substituted.

Licence

Apache License 2.0.

Frequently asked questions

What is docx4j Word documents MCP Server?

Read, convert and fill Word (.docx) documents: templates, Markdown/HTML in and out, PDF with math.

How do I install docx4j Word documents MCP Server in Claude Desktop, Cursor, or VS Code?

Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. docx4j Word documents MCP Server runs locally from the MCP bundle https://github.com/plutext/docx4j-mcp/releases/download/v0.2.0/docx4j-mcp.mcpb with the command npx -y https://github.com/plutext/docx4j-mcp/releases/download/v0.2.0/docx4j-mcp.mcpb.

Does docx4j Word documents MCP Server support remote (HTTP) connections?

No remote endpoint is listed for docx4j Word documents MCP Server. It runs locally on your machine over stdio, started by your MCP client.

What tools does docx4j Word documents MCP Server provide?

docx4j Word documents MCP Server provides 8 tools, including convert_to_html, convert_to_pdf, describe_template, and docx_to_markdown. See the full tool list for descriptions and parameters.

How is docx4j Word documents MCP Server's trust score calculated?

docx4j Word documents MCP Server scores 47 out of 100 (Fair). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.

Reviews

No reviews yet

—Be the first to review

5 star0 reviews at 5 stars
4 star0 reviews at 4 stars
3 star0 reviews at 3 stars
2 star0 reviews at 2 stars
1 star0 reviews at 1 stars

No published reviews yet. Used it? Tell the next person how it went.

Add badge to your README

Paste either snippet into the repository README. The image links to this listing.

Listed on MCPpedia

Top 5 MCP servers

Daily or weekly. Confirm by email, unsubscribe any time.

How often

Manage this listing

Claim this server