Introduction

The core concept of DeepSeek Harness (DSH) is “everything is a plugin.” When an Agent needs to export execution results as standard documents, it typically relies on external services. dsh-docx-mcp provides a local MCP stdio server that generates truly openable .docx files based on a JSON specification. Unlike solutions that require many dependencies, this plugin is implemented in pure Node and generates files by hand-writing OOXML and store-zip.

What This Is

dsh-docx-mcp is a DSH plugin maintained by helibeiqi, belonging to the “Chinese Office Automation” vertical. It registers as the docx tool through DSH’s MCP bridging mechanism, allowing Agents to call it directly. The core value of this plugin is zero dependencies: it can run without executing npm install.

Core Capabilities

This plugin supports the following features:

  • Generating true .docx files.
  • Zero dependencies (no npm install required).
  • Support for headings (Heading 1-3), paragraphs (with bold/italic), bulleted lists, and tables.
  • MCP stdio server mode.
  • Full integration with DeepSeek Harness.

Tool: docx_generate

When an Agent calls this tool, the following parameters must be provided:

Parameter Type Description
title string The main document title, automatically inserted as a level-1 heading at the beginning
filename string Output file name, with or without .docx
outDir string Output directory, default ~/dsh-docx-output
blocks array Array of content blocks

blocks Content Block Types

Type Fields Description
heading level(1-3), text Heading
paragraph runs(array {text,bold}) or text,bold Paragraph; runs supports mixed bold within the same paragraph
bullet items(string[]) or text Bulleted list
table rows(string[][]) Table, where each row is a set of cells

Typical Usage

The following is a JSON call example for generating a “Employee Labor Contract Renewal Notice”:

{
  "title": "员工劳动合同续签通知书",
  "blocks": [
    { "type": "paragraph", "runs": [
      { "text": "致:", "bold": false },
      { "text": "张三", "bold": true },
      { "text": "(工号 E000123)" }
    ]},
    { "type": "heading", "level": 2, "text": "一、续签事项" },
    { "type": "bullet", "items": ["合同期限:3 年", "试用期:无", "工时制度:标准工时"] },
    { "type": "heading", "level": 2, "text": "二、薪资结构" },
    { "type": "table", "rows": [
      ["项目", "占比"], ["基本工资", "40%"], ["岗位工资", "40%"], ["绩效工资", "20%"]
    ]}
  ]
}

The tool returns the file path and byte count.

Installation and Integration

This plugin is distributed as a bundle. When deploying to other machines, the absolute paths in cordis.patch.yml must be manually updated, because this file currently contains the author’s local paths (such as C:\Users\helib\dsh-docx-mcp\...).

Additionally, the Node runtime can be specified using the QUANT_MCP_NODE environment variable to handle managed-node version directory drift issues.

Local Execution

For local testing, start the MCP service directly:

node docx-mcp-server.mjs

Use Cases and Notes

This plugin is suitable for scenarios that require quickly generating standard-format documents, such as contracts and reports.

Note: The plugin runs with the permissions of the current DSH process, so ensure that the output directory has write permissions. Before deployment, it is recommended to review the source code and license (MIT).