Docx Editor AI Agent
SuperDoc - DOCX Editor and Agent SDK for reviewing, filling, and editing documents
Docx Editor is an open-source ai agent by superdoc, written mainly in TypeScript, with 1,117 GitHub stars and the AGPL-3.0 license. Its code was last updated Nov 1, 2026. The latest npm release is superdoc 2.31.0, published Nov 12, 2026, with 294,554 downloads last week.
Tracked changes, threaded comments, tables, headers, and footers stay DOCX structures, and pages lay out as in Word. Edits write back to OOXML without an HTML conversion step.
- Open Source. AGPLv3, with a commercial license for proprietary deployments.
- Self-hosted. Runs in the browser, on your servers, or inside your agent workflows (Node.js, Python, Rust, CLI, MCP). It does not require document content to be sent to SuperDoc.
- Custom UI. Use the built-in UI or build your own on the same Document API.
Quick start: DOCX editor
<a href="https://www.superdoc.dev" target="_blank"><img src="assets/editor-quickstart.png" width="100%" alt="SuperDoc DOCX Editor and toolbar and sidepanel showing an editable document pages with tracked changes and comments"/></a>
npm install superdoc
SuperDoc mounts into elements you provide:
<div id="toolbar"></div>
<div id="editor"></div>
<button id="export" type="button" disabled>Export DOCX</button>
import { SuperDoc } from 'superdoc';
import 'superdoc/style.css';
const superdoc = new SuperDoc({
selector: '#editor',
document: '/sample.docx',
documentMode: 'editing',
ui: { toolbar: { container: '#toolbar' } },
onReady: () => { document.querySelector('#export').disabled = false; },
});
document.querySelector('#export').addEventListener('click', async () => {
await superdoc.export({ exportType: ['docx'], exportedName: 'sample-edited' });
});
document accepts a URL, a File, or a Blob. Omit it to start with a blank
DOCX. documentMode is 'editing', 'suggesting', or 'viewing'. The editor
needs no server of its own.
Next, follow the editor quick start for a complete vanilla JavaScript or React project, then configure the editor.
Quick start: DOCX agent
<a href="https://www.superdoc.dev" target="_blank"><img src="assets/agent-quickstart.png" width="1200" alt="SuperDoc agent workflow showing an LLM using the SDK to add a risk review comment to a DOCX contract."/></a>
Use a headless SDK to let your own LLM review and edit DOCX files. This example uses the Node.js SDK with the Vercel AI SDK to change a contract's payment terms as tracked changes.
npm install @superdoc/sdk ai@6 @ai-sdk/anthropic@3
curl -fL https://raw.githubusercontent.com/superdoc/docx-editor/refs/heads/main/assets/sample-contract.docx -o sample-contract.docx
Set ANTHROPIC_API_KEY and ANTHROPIC_MODEL before running it.
import { SuperDocClient, createAgentToolkit } from '@superdoc/sdk';
import { anthropic } from '@ai-sdk/anthropic';
import { generateText, jsonSchema, stepCountIs } from 'ai';
const client = new SuperDocClient({
user: { name: 'Contract assistant', email: 'assistant@example.com' },
});
try {
await client.connect();
const doc = await client.open({ doc: './sample-contract.docx' });
const toolkit = await createAgentToolkit({
provider: 'vercel', preset: 'core', enforceChangeMode: 'tracked',
});
const tools = Object.fromEntries(toolkit.tools.map(tool => [tool.name, {
description: tool.description,
inputSchema: jsonSchema(tool.inputSchema),
execute: args => toolkit.dispatch(doc, tool.name, args),
}]));
await generateText({
model: anthropic(process.env.ANTHROPIC_MODEL),
system: toolkit.systemPrompt,
prompt: 'Change payment terms from 60 to 30 days',
tools,
stopWhen: stepCountIs(10),
});
await doc.save({ out: './sample-contract-reviewed.docx' });
} finally {
await client.dispose();
}
Your LLM chooses which SuperDoc tools to call; SuperDoc runs the document
operations and, with enforceChangeMode: 'tracked', records every edit as a
tracked change. Document content sent to the model is subject to the model
provider's policies.
Before saving in production, check each edit's receipt. See Build an agent for the full loop and verification, and real-time collaboration to have agents and users edit the same document at once.
Demos and examples
examples/: small, runnable projects for common workflows.- demos.superdoc.dev: full demo applications, including custom UIs.
How SuperDoc works
SuperDoc reads, renders, edits, and writes DOCX files through their Office Open XML (OOXML) parts.
- Open. The engine parses content, styles, relationships, media, headers, footers, and the other OOXML parts into editable document state.
- Render. The layout engine paginates that state, and the browser paints the resolved pages. OOXML remains the document format.
- Edit. Editor input and headless operations update document state through the Document API: queries, targets, mutations, and receipts.
- Write. Save and export write changes back into the OOXML package instead of rebuilding a DOCX from HTML.
The same engine runs without a browser DOM, so the editor, SDKs, CLI, and MCP server share one document model.
Packages
| Package | Purpose |
|---|---|
superdoc | Browser DOCX editor for JavaScript and TypeScript. |
@superdoc/react | React wrapper for the editor. |
@superdoc/vue | Vue wrapper for the editor. |
@superdoc/sdk | Node.js SDK for headless DOCX editing and agent toolkits. |
@superdoc/cli | superdoc command-line interface. |
@superdoc/mcp | MCP server for AI agents and MCP clients. |
@superdoc/fonts | Optional metric-compatible font substitutes. |
superdoc-sdk (PyPI) | Python SDK. See the Python SDK guide. |
superdoc-sdk (crates.io) | Rust SDK. See its README. |
Stable releases are published to npm as latest. To try fixes and features
from main before they reach stable, install the next tag, for example
npm install superdoc@next. See the
release notes.
For AI agents
Start with llms.txt, or copy a
starter prompt. Agents working in
this repository start with AGENTS.md.
Machine-readable documentation:
llms.txt: index of every documentation page.llms-full.txt: all authored guides in one file.llms-reference.txt: the generated Document API reference. Prefer the focused reference pages when you need only a few operations.- Context7: the documentation indexed for retrieval.
Tool discovery:
- The MCP server serves every tool's JSON Schema, generated from the Document API contract.
getToolCatalog('core')orgetToolCatalog('legacy')in@superdoc/sdkreturns the same data for that preset. Read the advertised schema rather than a copy of it. superdoc discover "<intent>"andsuperdoc describe command <name>search and explain the CLI contract.- The custom-actions skill teaches Claude Code or Codex to extend the SDK's actions.
- Agent safety covers filesystem boundaries, content sent to model providers, and review.
Usage rules:
- The browser editor needs a browser. Use
@superdoc/sdkin Node.js API routes. - The Python SDK installs as
superdoc-sdkand importsSuperDocClientfrom thesuperdocmodule. - Document modes control editor behavior; your application manages access permissions.
- Record edits as tracked changes with
documentMode: 'suggesting'in the editor orchangeMode: 'tracked'for supported headless mutations. - Find text targets with
query.matchand pass the returned target to the mutation. Do not construct targets from OOXML IDs. - Inspect mutation receipts and errors before treating an edit as complete.
Security
SuperDoc runs inside your infrastructure and does not require document content to be sent to or stored by SuperDoc. For enterprise reviews, a SOC 2 Type II report, architecture and data-flow materials, and a software bill of materials are available. See Trust & Security.
Report suspected vulnerabilities privately as described in SECURITY.md.
Community and contributing
Ask questions on Discord, and follow product updates in the changelog.
Community contributions start with an issue. Bug reports, feature requests, and technical investigations are welcome. Pull requests are limited to repository collaborators. Read the contributing guide and the Code of Conduct.
Contributors
Thank you to everyone who has helped us build and improve the SuperDoc editor.
<img src="./assets/contributors.svg" alt="SuperDoc contributors across V1 and V2" />License
AGPLv3 for open source use. A commercial license is available for proprietary deployments. For questions, contact the SuperDoc team or email q@superdoc.dev.
Docx Editor alternatives
View more →Similar ai agents in Productivity & Workflow, ranked by GitHub stars. Compare licence, recent activity and scan status before you choose.
| Name | Stars | Licence | Last updated | Scan |
|---|---|---|---|---|
| Docx Editor (this page) superdoc | 1.1k | AGPL-3.0 | Nov 1, 2026 | Scanned, no flagged issues |
| Paperclip paperclipai | 110k | MIT | Nov 1, 2026 | Scanned, no flagged issues |
| Ppt Master hugohe3 | 72k | MIT | Oct 30, 2026 | Scanned, no flagged issues |
| Llama Index run-llama | 53k | MIT | Oct 26, 2026 | Scanned, see report |
| Nanobot HKUDS | 50k | MIT | Oct 31, 2026 | Scanned, no flagged issues |
| Sim simstudioai | 30k | Apache-2.0 | Nov 1, 2026 | Scanned, see report |