{
  "markdown": "# docx-forge-mcp\n\n**MCP server for Word document (.docx) creation and manipulation — the production-grade document automation tool for AI agents.**\n\nGenerate contracts, reports, proposals, and compliance documents directly from agent workflows. No Word installation required.\n\n[![npm](https://img.shields.io/npm/v/docx-forge-mcp)](https://www.npmjs.com/package/docx-forge-mcp)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![MCP Compatible](https://img.shields.io/badge/MCP-Compatible-blue)](https://modelcontextprotocol.io)\n\n---\n\n## Why docx-forge-mcp?\n\nWord documents are the default format for contracts, compliance reports, legal agreements, and business proposals — especially in enterprise and government workflows. This MCP server gives AI agents the ability to produce and manipulate `.docx` files programmatically, without any Office installation, UI automation, or file format guesswork.\n\n**Only 1 competitor exists** for Word document manipulation via MCP as of 2026. This server fills that gap with a production-quality, fully-tested implementation.\n\n---\n\n## Tools\n\n| Tool | Description |\n|------|-------------|\n| `create_document` | Create a new `.docx` from a title and markdown content |\n| `read_document` | Extract text, headings, paragraphs, and metadata from a `.docx` |\n| `add_section` | Append a new section (heading + body) to an existing `.docx` |\n| `replace_text` | Find and replace text — ideal for template variable substitution |\n| `add_table` | Insert a formatted table with bold headers into a `.docx` |\n| `merge_documents` | Combine multiple `.docx` files into one |\n| `export_to_pdf` | Convert `.docx` to PDF via LibreOffice or pandoc |\n| `get_document_stats` | Get word count, page estimate, section count, table count |\n\n---\n\n## Install\n\n### Claude Desktop\n\nAdd to your `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"docx-forge\": {\n      \"command\": \"npx\",\n      \"args\": [\"docx-forge-mcp\"]\n    }\n  }\n}\n```\n\n### Cursor\n\nAdd to your `.cursor/mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"docx-forge\": {\n      \"command\": \"npx\",\n      \"args\": [\"docx-forge-mcp\"]\n    }\n  }\n}\n```\n\n### Manual (Node.js)\n\n```bash\nnpm install -g docx-forge-mcp\ndocx-forge-mcp\n```\n\n---\n\n## Usage Examples\n\n### Create a contract from a template\n\n```\ncreate_document(\n  title=\"Service Agreement\",\n  content=\"# Parties\\n\\n**Client:** {{CLIENT_NAME}}\\n**Provider:** Acme Corp\\n\\n## Scope of Work\\n\\n{{SCOPE}}\\n\\n## Payment\\n\\n{{PAYMENT_TERMS}}\",\n  outputPath=\"/tmp/contract.docx\"\n)\n\nreplace_text(filePath=\"/tmp/contract.docx\", find=\"{{CLIENT_NAME}}\", replace=\"TechCorp Ltd\")\nreplace_text(filePath=\"/tmp/contract.docx\", find=\"{{SCOPE}}\", replace=\"Software development and consulting services.\")\nreplace_text(filePath=\"/tmp/contract.docx\", find=\"{{PAYMENT_TERMS}}\", replace=\"Net 30 days. $15,000/month.\")\n\nexport_to_pdf(filePath=\"/tmp/contract.docx\", outputPath=\"/tmp/contract.pdf\")\n```\n\n### Build a structured report\n\n```\ncreate_document(\n  title=\"Q1 2026 Performance Report\",\n  content=\"## Executive Summary\\n\\nRevenue grew 34% YoY.\",\n  outputPath=\"/tmp/report.docx\"\n)\n\nadd_section(\n  filePath=\"/tmp/report.docx\",\n  heading=\"Revenue Breakdown\",\n  content=\"Product A: $450K\\nProduct B: $320K\\nServices: $180K\",\n  headingLevel=2\n)\n\nadd_table(\n  filePath=\"/tmp/report.docx\",\n  headers=[\"Product\", \"Q1 Revenue\", \"Growth\"],\n  rows=[[\"Product A\", \"$450K\", \"+41%\"], [\"Product B\", \"$320K\", \"+28%\"], [\"Services\", \"$180K\", \"+19%\"]]\n)\n\nget_document_stats(filePath=\"/tmp/report.docx\")\n```\n\n### Read and inspect an existing document\n\n```\nread_document(filePath=\"/path/to/existing.docx\")\n# Returns: { text, paragraphs[], headings[], metadata: { wordCount, fileSizeBytes, ... } }\n```\n\n### Merge chapter files into a book\n\n```\nmerge_documents(\n  filePaths=[\"/docs/ch1.docx\", \"/docs/ch2.docx\", \"/docs/ch3.docx\"],\n  outputPath=\"/docs/complete-manual.docx\"\n)\n```\n\n---\n\n## Markdown Support\n\n`create_document` and `add_section` both accept markdown content:\n\n| Markdown | Result |\n|----------|--------|\n| `# Heading 1` | H1 heading |\n| `## Heading 2` | H2 heading |\n| `**bold text**` | Bold text |\n| `*italic text*` | Italic text |\n| `- item` | Bullet list item |\n| `1. item` | Numbered list item |\n| `---` | Horizontal divider |\n| Blank line | Paragraph break |\n\n---\n\n## PDF Export\n\n`export_to_pdf` requires a system-level converter. It tries in order:\n\n1. **LibreOffice** (best fidelity) — `sudo apt-get install libreoffice`\n2. **pandoc** — `sudo apt-get install pandoc`\n\nIf neither is available, the tool returns `success: false` with installation instructions. The source `.docx` file is always preserved.\n\n---\n\n## Resources\n\n| URI | Description |\n|-----|-------------|\n| `docx-forge://usage-guide` | Step-by-step guide with workflow examples |\n\n---\n\n## Dependencies\n\n- [`docx`](https://www.npmjs.com/package/docx) — `.docx` creation (no Office required)\n- [`mammoth`](https://www.npmjs.com/package/mammoth) — `.docx` reading and text extraction\n- [`@modelcontextprotocol/sdk`](https://www.npmjs.com/package/@modelcontextprotocol/sdk) — MCP protocol\n- [`zod`](https://www.npmjs.com/package/zod) — Input validation\n\n---\n\n## Requirements\n\n- Node.js >= 18.0.0\n- No Microsoft Word or Office installation required\n- PDF export requires LibreOffice or pandoc (optional)\n\n---\n\n## Development\n\n```bash\ngit clone https://github.com/mdfifty50-boop/docx-forge-mcp\ncd docx-forge-mcp\nnpm install\nnpm test        # Run test suite\nnpm start       # Start MCP server (stdio)\n```\n\n---\n\n## License\n\nMIT — see [LICENSE](LICENSE)\n\n---\n\n## Related MCP Servers\n\n- [agentic-observability-mcp](https://github.com/mdfifty50-boop/agent-observability-mcp) — Trace, cost-track, and monitor agent actions\n- [agent-guard-mcp](https://github.com/mdfifty50-boop/agent-guard-mcp) — Loop detection and circuit breakers\n- [compliance-shield-mcp](https://github.com/mdfifty50-boop/compliance-shield-mcp) — EU AI Act audit trails\n",
  "bytes": 5927,
  "sha": "13f494a6182d4a6a4e3a5afc36360b1d6f44f9cbea93de31008b11c2e3d13671",
  "repo_slug": "mdfifty50-boop/docx-forge-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_mdfifty50_boop_docx_forge_9c7b3e82/readme"
}