{"_id":"@docx-mcp/docx-mcp","_rev":"4-dff4704131ad2b7a2cc5bf0fbe7ae65a","name":"@docx-mcp/docx-mcp","dist-tags":{"latest":"0.5.0"},"versions":{"0.1.0":{"name":"@docx-mcp/docx-mcp","version":"0.1.0","keywords":["mcp","model-context-protocol","docx","word","document","server","nodejs"],"author":{"name":"Your Name"},"license":"MIT","_id":"@docx-mcp/docx-mcp@0.1.0","maintainers":[{"name":"lihongjie0209","email":"lihongjie0209@gmail.com"}],"homepage":"https://github.com/lihongjie0209/docx-mcp#readme","bugs":{"url":"https://github.com/lihongjie0209/docx-mcp/issues"},"bin":{"docx-mcp":"dist/index.js"},"dist":{"shasum":"9406b3d9fd9f328cae8b200635662e137c703053","tarball":"https://registry.npmjs.org/@docx-mcp/docx-mcp/-/docx-mcp-0.1.0.tgz","fileCount":7,"integrity":"sha512-z/MQS4st4ygJi5z7F3yYmDS1Q3KgHlELLqW0UucEplvb2lie99hWJh5Id/cYX56EdoWB7QdDPOI/XtXEAgwsVA==","signatures":[{"sig":"MEUCIQDQSg7TmfCx3GhknvR08ZGakCcCdbt9AQFg2vU/boLFyAIgUkIeVko99wfDU6EmNGiS6G5BxIysIJBIwS/9uaStkpM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":42686},"main":"dist/index.js","type":"module","gitHead":"972029874dea648220fbae6639ce2f48a3c44bb7","private":false,"scripts":{"dev":"tsx watch src/index.ts","build":"tsc -p tsconfig.json","check":"tsc -p tsconfig.json --noEmit","start":"node dist/index.js"},"_npmUser":{"name":"lihongjie0209","email":"lihongjie0209@gmail.com"},"repository":{"url":"git+https://github.com/lihongjie0209/docx-mcp.git","type":"git"},"_npmVersion":"10.2.0","description":"Model Context Protocol (MCP) server for DOCX document operations with comprehensive image support","directories":{},"_nodeVersion":"21.0.0","dependencies":{"ajv":"^8.17.1","docx":"^8.5.0","jszip":"^3.10.1","sharp":"^0.34.3","nanoid":"^5.0.7","xml2js":"^0.6.2","ajv-formats":"^3.0.1","@modelcontextprotocol/sdk":"^1.2.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.16.2","typescript":"^5.5.4","@types/xml2js":"^0.4.14"},"_npmOperationalInternal":{"tmp":"tmp/docx-mcp_0.1.0_1756181998558_0.5471234790995585","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@docx-mcp/docx-mcp","version":"0.1.1","keywords":["mcp","model-context-protocol","docx","word","document","server","nodejs"],"author":{"name":"Your Name"},"license":"MIT","_id":"@docx-mcp/docx-mcp@0.1.1","maintainers":[{"name":"lihongjie0209","email":"lihongjie0209@gmail.com"}],"homepage":"https://github.com/lihongjie0209/docx-mcp#readme","bugs":{"url":"https://github.com/lihongjie0209/docx-mcp/issues"},"bin":{"docx-mcp":"dist/index.js"},"dist":{"shasum":"57a8ab4fc9c0abdfe76059cfa57eade33a35016d","tarball":"https://registry.npmjs.org/@docx-mcp/docx-mcp/-/docx-mcp-0.1.1.tgz","fileCount":7,"integrity":"sha512-Y36DZZO0fWlU3Y+O8hJAUSYcsESpiPxReyGRk6MYoBgGofv+x1qS1ovwv60R4kM+3fBk/NChbR8zOZy3CVZrmQ==","signatures":[{"sig":"MEUCIAqjV7fILHF8JxIAi+urFnlUZnx4OTrK7XCLCXdO9NdnAiEAtjoAO5il258kQgFk3nZ0jnbSkV3ki6zyqN3JRnLs2OY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":42513},"main":"dist/index.js","type":"module","gitHead":"942f31603c95c7e5af03e7445d861e28f4f9bba2","private":false,"scripts":{"dev":"tsx watch src/index.ts","build":"tsc -p tsconfig.json","check":"tsc -p tsconfig.json --noEmit","start":"node dist/index.js"},"_npmUser":{"name":"lihongjie0209","email":"lihongjie0209@gmail.com"},"repository":{"url":"git+https://github.com/lihongjie0209/docx-mcp.git","type":"git"},"_npmVersion":"10.8.2","description":"Model Context Protocol (MCP) server for DOCX document operations with comprehensive image support","directories":{},"_nodeVersion":"18.20.8","dependencies":{"ajv":"^8.17.1","docx":"^8.5.0","jszip":"^3.10.1","sharp":"^0.34.3","nanoid":"^5.0.7","xml2js":"^0.6.2","ajv-formats":"^3.0.1","@modelcontextprotocol/sdk":"^1.2.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.16.2","typescript":"^5.5.4","@types/xml2js":"^0.4.14"},"_npmOperationalInternal":{"tmp":"tmp/docx-mcp_0.1.1_1756182363842_0.3204682675392936","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@docx-mcp/docx-mcp","version":"0.2.0","keywords":["mcp","model-context-protocol","docx","word","document","server","nodejs"],"author":{"name":"Your Name"},"license":"MIT","_id":"@docx-mcp/docx-mcp@0.2.0","maintainers":[{"name":"lihongjie0209","email":"lihongjie0209@gmail.com"}],"homepage":"https://github.com/lihongjie0209/docx-mcp#readme","bugs":{"url":"https://github.com/lihongjie0209/docx-mcp/issues"},"bin":{"docx-mcp":"dist/index.js"},"dist":{"shasum":"aefc5909783cdb42abd7a9110a39a40e197814b8","tarball":"https://registry.npmjs.org/@docx-mcp/docx-mcp/-/docx-mcp-0.2.0.tgz","fileCount":7,"integrity":"sha512-JaK8uM6671cfq/ZXlUlHUDtS0IpyIkKft5JKGHWX574gW7QapQTe9J4t/E0ZQ1OoS/8s5YSJxY0RsbLMteQRDA==","signatures":[{"sig":"MEQCIF0PTQJSewFlmXKbQaMe9hZEPk72nS2ZeOP1jDlL7+GaAiBO6qGN506xtULTdpXIB6ngzG6HLmJtUONdTD8A8ntJyQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":52981},"main":"dist/index.js","type":"module","gitHead":"1eec08592efe48cec3f2903ddd0d7455592985ae","private":false,"scripts":{"dev":"tsx watch src/index.ts","build":"tsc -p tsconfig.json","check":"tsc -p tsconfig.json --noEmit","start":"node dist/index.js"},"_npmUser":{"name":"lihongjie0209","email":"lihongjie0209@gmail.com"},"repository":{"url":"git+https://github.com/lihongjie0209/docx-mcp.git","type":"git"},"_npmVersion":"10.2.0","description":"Model Context Protocol (MCP) server for DOCX document operations with comprehensive image support","directories":{},"_nodeVersion":"21.0.0","dependencies":{"ajv":"^8.17.1","docx":"^8.5.0","jszip":"^3.10.1","sharp":"^0.34.3","nanoid":"^5.0.7","xml2js":"^0.6.2","ajv-formats":"^3.0.1","highlight.js":"^11.11.1","@types/highlight.js":"^10.1.0","@modelcontextprotocol/sdk":"^1.2.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.16.2","typescript":"^5.5.4","@types/xml2js":"^0.4.14"},"_npmOperationalInternal":{"tmp":"tmp/docx-mcp_0.2.0_1756183248500_0.8547494869540018","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@docx-mcp/docx-mcp","version":"0.5.0","description":"Model Context Protocol (MCP) server for DOCX document operations with comprehensive image support","private":false,"type":"module","main":"dist/index.js","bin":{"docx-mcp":"dist/index.js"},"keywords":["mcp","model-context-protocol","docx","word","document","server","nodejs"],"author":{"name":"Your Name"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/lihongjie0209/docx-mcp.git"},"bugs":{"url":"https://github.com/lihongjie0209/docx-mcp/issues"},"homepage":"https://github.com/lihongjie0209/docx-mcp#readme","scripts":{"build":"tsc -p tsconfig.json","start":"node dist/index.js","dev":"tsx watch src/index.ts","check":"tsc -p tsconfig.json --noEmit"},"dependencies":{"@modelcontextprotocol/sdk":"^1.2.0","@types/highlight.js":"^10.1.0","ajv":"^8.17.1","ajv-formats":"^3.0.1","docx":"^8.5.0","highlight.js":"^11.11.1","jszip":"^3.10.1","nanoid":"^5.1.5","sharp":"^0.34.3","xml2js":"^0.6.2"},"devDependencies":{"@types/xml2js":"^0.4.14","tsx":"^4.16.2","typescript":"^5.5.4"},"_id":"@docx-mcp/docx-mcp@0.5.0","gitHead":"a189b25c198ad4f0ce8097472a4b506efd49e560","_nodeVersion":"21.0.0","_npmVersion":"10.2.0","dist":{"integrity":"sha512-BB37l0cFNSIXByYjFF7uzFqhGEWv3ygWIY77itmW15tvPJADojVZtSpRBx5X4UFb5SKvligfDbDG8D/UMKw71g==","shasum":"af566673dc2468ce6c1767233675fc853314bb0c","tarball":"https://registry.npmjs.org/@docx-mcp/docx-mcp/-/docx-mcp-0.5.0.tgz","fileCount":7,"unpackedSize":89599,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIF0XmM92nPc90rPd5EmAYsN152DE0VA+eGeU3aWrcwE8AiEApfUpRVJWuNQbFX5wL4iZuOMqBjrzo5pD5oHiJKirmLw="}]},"_npmUser":{"name":"lihongjie0209","email":"lihongjie0209@gmail.com"},"directories":{},"maintainers":[{"name":"lihongjie0209","email":"lihongjie0209@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/docx-mcp_0.5.0_1756200431458_0.6096128068797406"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-26T04:19:58.454Z","modified":"2025-08-26T09:27:11.877Z","0.1.0":"2025-08-26T04:19:58.728Z","0.1.1":"2025-08-26T04:26:04.076Z","0.2.0":"2025-08-26T04:40:48.683Z","0.5.0":"2025-08-26T09:27:11.673Z"},"bugs":{"url":"https://github.com/lihongjie0209/docx-mcp/issues"},"author":{"name":"Your Name"},"license":"MIT","homepage":"https://github.com/lihongjie0209/docx-mcp#readme","keywords":["mcp","model-context-protocol","docx","word","document","server","nodejs"],"repository":{"type":"git","url":"git+https://github.com/lihongjie0209/docx-mcp.git"},"description":"Model Context Protocol (MCP) server for DOCX document operations with comprehensive image support","maintainers":[{"name":"lihongjie0209","email":"lihongjie0209@gmail.com"}],"readme":"# docx-mcp\r\n\r\nA Node.js MCP server that lets clients create, query, edit, and save DOCX documents using a JSON schema, powered by the `docx` library.\r\n\r\n## Features\r\n- **Complete DOCX operations**: Create, edit, and save Word documents via Model Context Protocol (MCP)\r\n- **JSON Schema validation**: Structured document definition with comprehensive validation\r\n- **Rich content blocks**:\r\n  - **Text & Headings**: 6 heading levels with advanced formatting\r\n  - **Lists**: Ordered/unordered lists with multiple numbering styles and nesting\r\n  - **Code Blocks**: Syntax highlighting for 180+ languages with themes and line numbers\r\n  - **Tables**: Full table support with styling and cell formatting\r\n  - **Images**: URL downloads with fallback, local files, and base64 embedding\r\n  - **Page Control**: Page breaks and section breaks\r\n- **Advanced text formatting**:\r\n  - Basic: Bold, italic, underline, strikethrough, colors\r\n  - Enhanced: Superscript, subscript, font families, highlights, small caps\r\n  - Spacing: Character spacing, paragraph alignment, indentation\r\n- **Document management**: In-memory registry with unique IDs\r\n- **Metadata support**: Complete document properties and custom metadata\r\n- **File operations**: Open existing DOCX files and save to disk\r\n- **Error handling**: Graceful fallbacks and comprehensive validation\r\n\r\n## JSON Schema\r\nSee `src/schema.ts` for the full schema. Key concepts:\r\n- **meta**: Document metadata (title, subject, creator, etc.)\r\n- **pageSettings**: Page size, orientation, margins, header/footer margins (NEW in v0.3.0)\r\n- **headers**: Page header configuration with default/first/even page support (NEW in v0.4.0)\r\n- **footers**: Page footer configuration with default/first/even page support (NEW in v0.4.0)\r\n- **content**: Array of blocks: heading, paragraph, table, image, codeBlock, list, pageBreak, horizontalRule, blockquote, infoBox, textBox\r\n- **Enhanced blocks**:\r\n  - **CodeBlock**: `{ type: \"codeBlock\", language: \"javascript\", code: \"...\", showLineNumbers: true }`\r\n  - **List**: `{ type: \"list\", ordered: true, items: [...] }` with nesting support\r\n  - **Table**: Enhanced with backgroundColor, borders, verticalAlign, cell margins (NEW in v0.3.0)\r\n  - **HorizontalRule**: `{ type: \"horizontalRule\", style: \"single\", color: \"#666\" }` (NEW in v0.3.0)\r\n  - **Blockquote**: `{ type: \"blockquote\", children: [...], borderColor: \"#ccc\" }` (NEW in v0.3.0)\r\n  - **InfoBox**: `{ type: \"infoBox\", boxType: \"info\", title: \"Note\", children: [...] }` (NEW in v0.3.0)\r\n  - **TextBox**: `{ type: \"textBox\", children: [...] }` with border styling (NEW in v0.3.0)\r\n  - **Enhanced TextRun**: Supports fontFamily, superScript, subScript, highlight, etc.\r\n- Each paragraph/heading uses inline runs (text, hyperlink) with rich formatting options\r\n\r\n### Headers & Footers Configuration (NEW in v0.4.0)\r\n```json\r\n{\r\n  \"headers\": {\r\n    \"default\": {\r\n      \"alignment\": \"center\",\r\n      \"children\": [\r\n        {\r\n          \"type\": \"documentTitle\",\r\n          \"bold\": true,\r\n          \"size\": 14,\r\n          \"color\": \"#1f4788\"\r\n        }\r\n      ]\r\n    },\r\n    \"first\": {\r\n      \"alignment\": \"right\",\r\n      \"children\": [\r\n        {\r\n          \"type\": \"text\",\r\n          \"text\": \"Confidential Document\",\r\n          \"bold\": true,\r\n          \"color\": \"#cc0000\"\r\n        }\r\n      ]\r\n    }\r\n  },\r\n  \"footers\": {\r\n    \"default\": {\r\n      \"alignment\": \"center\", \r\n      \"children\": [\r\n        {\r\n          \"type\": \"text\",\r\n          \"text\": \"Page \"\r\n        },\r\n        {\r\n          \"type\": \"pageNumber\",\r\n          \"format\": \"decimal\"\r\n        },\r\n        {\r\n          \"type\": \"text\",\r\n          \"text\": \" of \"\r\n        },\r\n        {\r\n          \"type\": \"pageNumber\",\r\n          \"format\": \"totalPages\"\r\n        }\r\n      ]\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nSupported header/footer elements:\r\n- **text**: Static text with styling options\r\n- **pageNumber**: Auto page numbering (decimal, upperRoman, lowerRoman, upperLetter, lowerLetter)\r\n- **currentDate**: Auto-updating date with custom format strings\r\n- **documentTitle**: References document meta.title\r\n- **image**: Images in headers/footers (base64, path, url)\r\n\r\n## New in v0.4.0 - Document Structure & Headers/Footers\r\n- ✅ **Headers & Footers System**: Comprehensive page header and footer support\r\n  - Default, first page, and even page headers/footers\r\n  - Rich content: text, page numbers, dates, document title, images\r\n  - Flexible alignment: left, center, right\r\n  - Advanced styling: fonts, colors, sizes, bold/italic\r\n- ✅ **Dynamic Content Elements**:\r\n  - `pageNumber`: Automatic page numbering with multiple formats (decimal, roman, letters)\r\n  - `currentDate`: Auto-updating dates with custom formats\r\n  - `documentTitle`: Reference document metadata\r\n  - `text`: Static text with full styling options\r\n  - `image`: Headers/footers images support\r\n- ✅ **Professional Layout Control**:\r\n  - Different headers/footers for first page vs. rest of document\r\n  - Odd/even page variations for book-style layouts\r\n  - Precise margin control for headers and footers\r\n  - Integration with existing page settings system\r\n\r\n## New in v0.3.0 - Styles & Layout\r\n- ✅ **Page Settings**: Page size (A4, Letter, etc.), orientation, margins control\r\n- ✅ **Enhanced Tables**: Background colors, border styles, vertical alignment, table templates\r\n- ✅ **New Block Types**: Horizontal rules, blockquotes, info boxes, text boxes\r\n- ✅ **Advanced Styling**: More comprehensive table and cell formatting options\r\n\r\n## Previous Updates\r\n### v0.2.0 - Enhanced Document Operations\r\n- ✅ **Code Blocks**: Syntax highlighting for 180+ programming languages\r\n- ✅ **Lists**: Ordered and unordered lists with multiple styles and nesting\r\n- ✅ **Page Breaks**: Control document pagination\r\n- ✅ **Enhanced Text**: Superscript, subscript, font families, highlights\r\n- ✅ **Improved Schema**: More comprehensive validation and type safety\r\n\r\n## Run locally\r\n1. Install deps\r\n\r\n```pwsh\r\nnpm install\r\n```\r\n\r\n2. Dev mode\r\n\r\n```pwsh\r\nnpm run dev\r\n```\r\n\r\n3. Build and start\r\n\r\n```pwsh\r\nnpm run build\r\nnpm start\r\n```\r\n\r\n## Tools\r\n- docx-getSchema { } // Get JSON schema - call this first!\r\n- docx-create { json }\r\n- docx-open { id?, path }  // open .docx file from disk\r\n- docx-queryMeta { id }\r\n- docx-queryObjects { id }\r\n- docx-editMeta { id, patch }\r\n- docx-editContent { id, index, block }\r\n- docx-insertContent { id, index, block }\r\n- docx-removeContent { id, index }\r\n- docx-save { id, path }\r\n- docx-exportJson { id }\r\n\r\n## Example JSON\r\n```json\r\n{\r\n  \"meta\": { \"title\": \"Demo\", \"creator\": \"DOCX MCP v0.2.0\" },\r\n  \"content\": [\r\n    { \"type\": \"heading\", \"level\": 1, \"children\": [ { \"type\": \"text\", \"text\": \"Title\" } ] },\r\n    { \"type\": \"paragraph\", \"children\": [ \r\n      { \"type\": \"text\", \"text\": \"Hello \", \"bold\": true }, \r\n      { \"type\": \"text\", \"text\": \"world\", \"color\": \"FF0000\" } \r\n    ]},\r\n    { \r\n      \"type\": \"codeBlock\", \r\n      \"language\": \"javascript\", \r\n      \"showLineNumbers\": true,\r\n      \"code\": \"console.log('Hello, World!');\" \r\n    },\r\n    {\r\n      \"type\": \"list\",\r\n      \"ordered\": false,\r\n      \"items\": [\r\n        { \"children\": [{ \"type\": \"text\", \"text\": \"First item\" }] },\r\n        { \"children\": [{ \"type\": \"text\", \"text\": \"Second item\" }] }\r\n      ]\r\n    },\r\n    { \"type\": \"image\", \"url\": \"https://picsum.photos/300/200\", \"width\": 300, \"height\": 200 },\r\n    { \"type\": \"pageBreak\" },\r\n    { \"type\": \"table\", \"rows\": [ { \"cells\": [ \r\n      { \"children\": [ { \"type\": \"paragraph\", \"children\": [ { \"type\": \"text\", \"text\": \"A\" } ] } ] }, \r\n      { \"children\": [ { \"type\": \"paragraph\", \"children\": [ { \"type\": \"text\", \"text\": \"B\" } ] } ] } \r\n    ] } ] }\r\n  ]\r\n}\r\n```\r\n\r\n## Image Support\r\nImages can be included in three ways:\r\n- **URL**: `{ \"type\": \"image\", \"url\": \"https://example.com/image.png\", \"width\": 300, \"height\": 200 }`\r\n- **Local file path**: `{ \"type\": \"image\", \"path\": \"/path/to/image.png\", \"width\": 300, \"height\": 200 }`\r\n- **Base64 data**: `{ \"type\": \"image\", \"data\": \"base64string\", \"format\": \"png\", \"width\": 150, \"height\": 100 }`\r\n\r\n**URL Image Features:**\r\n- Automatic download from HTTP/HTTPS URLs\r\n- Fallback to generated placeholder image if download fails\r\n- Placeholder shows original URL and dimensions\r\n- Support for common image formats (PNG, JPEG, JPG)\r\n- Note: Fontconfig warnings on Windows are harmless and can be ignored\r\n\r\nSupported formats: PNG, JPEG, JPG\r\n\r\n## Notes\r\n- Hyperlinks are rendered visually as underlined blue text. Full hyperlink relationships can be added later.\r\n- Images support URL downloads, local file paths, and base64 data.\r\n- This server runs over stdio to be compatible with MCP hosts.\r\n","readmeFilename":"README.md"}