New

docx-editor 1.x has shipped. Vue support, i18n, agents. Read the migration guide →

Packages

@eigenpal/docx-editor-agents

Agent toolkit. 14 tools, three transports (live editor, headless, MCP). Apache 2.0, relicensed from AGPL in 1.0.

What's in it

14 document-editing tools, three transports. Same tool shapes everywhere; pick the transport that fits where the agent runs.

TransportAPIUse case
Live editoruseDocxAgentTools (React or Vue)Agent calls land on a <DocxEditor> running in a user's browser. Comments and tracked changes show up as they happen.
HeadlessDocxReviewer (Node)Server-side batch. Parse buffer, run the agent, get the modified buffer back. No DOM.
MCPMcpServerExpose the tool catalog over JSON-RPC. Any MCP-compatible client can drive it.
npm install @eigenpal/docx-editor-agents

Subpaths

  • @eigenpal/docx-editor-agents: DocxReviewer, agentTools, getToolSchemas, executeToolCall
  • @eigenpal/docx-editor-agents/react: useDocxAgentTools, useAgentChat, getToolDisplayName
  • @eigenpal/docx-editor-agents/vue: Vue composables matching the React hooks
  • @eigenpal/docx-editor-agents/server: server-side types
  • @eigenpal/docx-editor-agents/ai-sdk/server: getAiSdkTools() for Vercel AI SDK streamText
  • @eigenpal/docx-editor-agents/ai-sdk/react: toAgentMessages() to bridge AI SDK UIMessage[] into <AgentChatLog> shape
  • @eigenpal/docx-editor-agents/bridge: lower-level transport for non-React hosts
  • @eigenpal/docx-editor-agents/mcp: McpServer for MCP integration

Full surface in the API reference for @eigenpal/docx-editor-agents.

The 14 tools

  • Locate (7): read_document, read_selection, read_page, read_pages, find_text, read_comments, read_changes
  • Mutate (6): add_comment, suggest_change, apply_formatting, set_paragraph_style, reply_comment, resolve_comment
  • Navigate (1): scroll

Locate-then-mutate. Locate tools return paragraphs tagged with paraId (Word's built-in w14:paraId attribute); mutate tools take paraId as input. paraId survives concurrent edits, agent loop iterations, and tool calls. So an agent can find_text in turn 1 and add_comment on the same paragraph in turn 5 without re-resolving.

Where to next