@shashimadushan/docx-editor-mcp
v0.1.1
Published
MCP server exposing @shashimadushan/docx-editor-agent's tool registry over stdio, so Claude Desktop/Claude Code/any MCP client can read and edit .docx files directly.
Maintainers
Readme
@shashimadushan/docx-editor-mcp
An MCP server that exposes
@shashimadushan/docx-editor-agent's
tool registry over stdio, so Claude Desktop, Claude Code, or any MCP client can
open, read, and edit .docx files on disk directly — the same high-fidelity
OOXML round-trip the browser editor uses, running headless in Node.
How it works
- A headless
DocxEditoris mounted against ahappy-domwindow, so the browser-targeted editor/agent code runs unmodified in a plain Node process. - Every tool from
createDefaultToolRegistry()in@shashimadushan/docx-editor-agentis re-exported as an MCP tool (its JSON-Schemaparametersmaps straight onto MCP'sTool.inputSchema). - Two extra tools manage the file:
open_document—{ path }— open a.docxfrom an absolute path.save_document—{ path? }— save the open document (defaults to the path it was opened from; passpathfor "Save As").
- One document is open per server process at a time — matching how an MCP client works through one file per conversation.
Install
npm install -g @shashimadushan/docx-editor-mcp
# or run it without installing:
npx @shashimadushan/docx-editor-mcp@shashimadushan/docx-editor-editor (>=0.6.0) and
@shashimadushan/docx-editor-agent (>=0.4.0) are peer dependencies.
Use with Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"docx-editor": {
"command": "npx",
"args": ["-y", "@shashimadushan/docx-editor-mcp"]
}
}
}Then ask Claude to open_document with an absolute path and edit away; call
save_document to write it back.
Use with Claude Code
claude mcp add docx-editor -- npx -y @shashimadushan/docx-editor-mcpProgrammatic use
import { createServer, runStdioServer } from '@shashimadushan/docx-editor-mcp';
// Run over stdio (what the `docx-editor-mcp` bin does):
await runStdioServer();
// …or wire the Server to your own transport:
const server = createServer();DocumentSession, toMcpToolDefs, listAgentTools, and callAgentTool are also
exported for embedding the tool bridge elsewhere.
License
MIT
