adeu agent

Docx ↔ LLM translator.

by dealfluence·MIT license·★ 165 Stars on the repo·GitHub ↗

Files of adeu

dealfluence/main1 file
README.md
Show the full text262 lines

Adeu: Track Changes for the LLM era

GitHub Repo stars PyPI version npm version Downloads MCP Compatible Smithery CI License: MIT

LLMs speak Markdown; reviewers speak "Track Changes."

Adeu is a docx ↔ LLM translator: a Model Context Protocol (MCP) server (Python and Node.js implementations) and accompanying SDKs that act as a Virtual DOM for Microsoft Word. It provides a two-way abstraction layer that lets AI agents freely edit document text without destroying the underlying formatting or complex DOCX XML.

While standard libraries like python-docx excel at generating documents from scratch, they fail at non-destructive redlining. Adeu solves this by translating .docx files into a token-efficient Markdown representation. This frees AI agents to focus entirely on document semantics instead of wasting tokens wrestling with OpenXML.

Adeu acts as an intelligent proxy, processing AI edits as safe, atomic transactions:

  1. Read: Translates the document (from disk or live Word) into LLM-friendly CriticMarkup with a Semantic Appendix of defined terms, cross-references, and likely typos. The agent starts with semantic structure, not raw data.
  2. Validate: Acts as a strict safety gate. It protects the document's integrity by automatically blocking ambiguous text matches or invalid structural changes before they touch the file.
  3. Apply: Translates the AI's text edits into native Word Track Changes. Adeu handles the complex XML under the hood, ensuring existing layouts, fonts, and margin comments are perfectly preserved.

Built and maintained by the team at Adeu.


Installation

Adeu can be installed directly into AI assistants as an MCP server, used as a Claude Code plugin or Agent Skill, CLI tool, or used locally as a developer toolchain.

Claude Code (Plugin)

Adeu ships as a Claude Code plugin with a built-in agent skill that teaches Claude how to use the engine effectively. Inside Claude Code:

/plugin marketplace add dealfluence/adeu
/plugin install adeu-redlining@adeu-skills

For best results, also connect either the Node MCP server (npx -y @adeu/mcp-server) or the Python MCP server (uvx --from adeu adeu-server). The plugin works without an MCP server too — it falls back to driving the uvx adeu CLI via Bash.

Other Skills-Compatible Agents (Cursor, Windsurf, VS Code Copilot, etc.)

Adeu's redlining skill follows the open Agent Skills specification and works with any compatible agent:

npx skills add dealfluence/adeu

The skill installs to your agent's skills directory and activates automatically when you ask Claude to redline, edit, or review a .docx file.

Claude Desktop

You can install Adeu directly into Claude Desktop using the official extension package:

  1. Download the latest Adeu.mcpb file from the GitHub Releases page.
  2. Open Claude Desktop and navigate to Settings > Extensions.
  3. Click Advanced settings and find the Extension Developer section.
  4. Click Install Extension..., select the downloaded .mcpb file, and follow the prompts.
Gemini CLI

Adeu is available as a native Gemini CLI extension. To install:

gemini extensions install https://github.com/dealfluence/adeu
Other MCP Clients (Cursor, Windsurf, etc.)

For IDEs or clients that configure MCP servers via JSON, you can use either the Node.js or Python backend:

Node.js

{
  "mcpServers": {
    "adeu": {
      "command": "npx",
      "args": ["-y", "@adeu/mcp-server"]
    }
  }
}

Python (Required for Live MS Word integration on Windows)

{
  "mcpServers": {
    "adeu": {
      "command": "uvx",
      "args": ["--from", "adeu", "adeu-server"]
    }
  }
}
Smithery

To install Adeu using the Smithery package manager:

npx -y @smithery/cli install adeu --client claude

Agent Workflows

Adeu provides agents with specific tools to read, review, and edit documents safely.

MCP Apps UI: The read_docx tool supports the MCP Apps UI protocol. When an agent reads a document, Adeu dynamically renders a custom, interactive Markdown view directly inside the chat window.

Recommended Agent Prompt: You can guarantee the best behavioral results by adding this context to your agent's system prompt or project instructions:

Role: Document Specialist Tools:

  • read_docx(clean_view=True): Read the final "clean" version of the text to understand context. Use search_query and page filters to locate specific clauses without reading the whole document.
  • process_document_batch: Commit & Negotiate Mode. Apply a unified list of changes. Use type: "modify" for specific search-and-replace text edits (supports match_mode="all" and regex=True for bulk updates), and type: "accept", "reject", or "reply" to manage existing Track Changes and Comments by ID.
  • finalize_document: Pre-Send Scrub. Strip dangerous metadata, author names, and internal tracking IDs, lock the document (protection_mode="read_only"), and prepare it for distribution.
Live MS Word Integration

If you are running on Windows with Microsoft Word installed, Adeu can act as a real-time copilot, editing the active document right in front of you. This requires running the Python MCP server backend (see Developer Tools below).


Developer Tools (Python & TypeScript)

If you are building a legal-tech application, an automated pipeline, or want to use the local CLI, use our SDKs.

The Python CLI

The Python toolchain is managed via uv.

pip install uv
uv tool install adeu

# Extract clean text for RAG or prompting
adeu extract contract.docx -o contract.md

# Generate a visual diff between two versions
adeu diff v1.docx v2.docx

# Apply edits to the DOCX
adeu apply contract.docx edits.json --author "Review Bot"

# Apply valid edits in salvage mode while reporting failing edits
adeu apply contract.docx edits.json --partial

# High-throughput JSON-Lines daemon
adeu serve

# Scrub author metadata and internal trackers
adeu sanitize redline.docx -o clean.docx --keep-markup --author "My Firm" --report

What the text projection preserves exactly, what it normalizes (lists, styles, synthetic pages), and what stays read-only is specified in docs/FIDELITY.md.

The Python SDK
from adeu import RedlineEngine, ModifyText
from io import BytesIO

with open("MSA.docx", "rb") as f:
    stream = BytesIO(f.read())

edit = ModifyText(
    target_text="State of New York",
    new_text="State of Delaware",
    comment="Standardizing governing law."
)

engine = RedlineEngine(stream, author="AI Copilot")
engine.apply_edits([edit])

with open("MSA_Redlined.docx", "wb") as f:
    f.write(engine.save_to_stream().getvalue())
The TypeScript SDK

The entire core parsing and diffing engine is also available in pure TypeScript.

import { readFileSync, writeFileSync } from "fs";
import { DocumentObject, RedlineEngine } from "@adeu/core";

const buffer = readFileSync("MSA.docx");
const doc = await DocumentObject.load(buffer);

const engine = new RedlineEngine(doc, "AI Copilot");
engine.process_batch([{
  type: "modify",
  target_text: "State of New York",
  new_text: "State of Delaware",
  comment: "Standardizing governing law."
}]);

const outBuffer = await doc.save();
writeFileSync("MSA_Redlined.docx", outBuffer);

See the @adeu/core documentation for full installation and usage details.

n8n Community Node

Adeu ships as an n8n community node (n8n-nodes-adeu) for teams who prefer visual workflow automation over code. It exposes the full engine (extract Markdown, apply tracked changes, generate diffs, and finalize documents) as drop-in nodes that work in both deterministic pipelines and AI Agent tool calls.

# In n8n: Settings → Community Nodes → Install: n8n-nodes-adeu

See the n8n-nodes-adeu README for installation, $fromAI recipes, and example workflows.


LangChain Integration

langchain-adeu is an official integration package that exposes Adeu's local, offline-capable document manipulation tools directly to the LangChain ecosystem.

pip install langchain-adeu

Bundle its capabilities as tools in your agent workflow:

from langchain_adeu import AdeuToolkit

# Instantiate and retrieve all document tools
tools = AdeuToolkit().get_tools()

Refer to the LangChain Workspace Guide for full development instructions and detailed parameters.


Ecosystem & Integrations

Adeu is designed as a Virtual DOM for DOCX. Because we keep the core strictly focused on OpenXML safety, we maintain a dedicated ecosystem/ directory for third-party integrations.

The ecosystem folder hosts policies and guidelines for third-party contributions such as legal validation workflows, CLM sync scripts, and specialized multi-agent architectures.

Are you a vendor or builder? We welcome PRs to the ecosystem folder! Please see our Vendor & Integration Policy to get started.


Adeu Cloud

By default, the core Adeu redlining engine and local file tools are fully open-source and execute entirely on your machine. Adeu never phones home with your local documents (though your chosen LLM provider will naturally process the text the agent reads).

However, for teams requiring end-to-end workflows, you can connect to Adeu Cloud to unlock:

  • Email Processing & Fetching: We offer an extended MCP server with secure email thread fetching, document extraction, and automated drafting capabilities to handle contracts directly from your inbox.

Learn more about Adeu Cloud.


Contributing

We welcome contributions from the community! Whether it's fixing bugs, adding capabilities, or improving documentation, please see our Contributing Guide for instructions on setting up the local uv environment, running tests, and understanding the project's strict XML safety guidelines.


License

MIT License. Open source and free to use in commercial applications.

1# Adeu: Track Changes for the LLM era
2 
3[![GitHub Repo stars](https://img.shields.io/github/stars/dealfluence/adeu?style=social)](https://github.com/dealfluence/adeu)
4[![PyPI version](https://img.shields.io/pypi/v/adeu.svg)](https://pypi.org/project/adeu/)
5[![npm version](https://img.shields.io/npm/v/@adeu/core.svg)](https://www.npmjs.com/package/@adeu/core)
6[![Downloads](https://img.shields.io/pepy/dt/adeu)](https://pepy.tech/project/adeu)
7[![MCP Compatible](https://img.shields.io/badge/MCP-Compatible-green.svg)](https://modelcontextprotocol.io/)
8[![Smithery](https://img.shields.io/badge/Smithery-Available-blue.svg)](https://smithery.ai/servers/adeu/adeu)
9[![CI](https://github.com/dealfluence/adeu/actions/workflows/ci.yml/badge.svg)](https://github.com/dealfluence/adeu/actions/workflows/ci.yml)
10[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
11 
12**LLMs speak Markdown; reviewers speak "Track Changes."**
13 
14Adeu is a **docx ↔ LLM translator**: a Model Context Protocol (MCP) server (Python and Node.js implementations) and accompanying SDKs that act as a **Virtual DOM for Microsoft Word**. It provides a two-way abstraction layer that lets AI agents freely edit document text without destroying the underlying formatting or complex DOCX XML.
15 
16While standard libraries like `python-docx` excel at generating documents from scratch, they fail at non-destructive redlining. Adeu solves this by translating `.docx` files into a token-efficient Markdown representation. This frees AI agents to focus entirely on document semantics instead of wasting tokens wrestling with OpenXML.
17 
18Adeu acts as an **intelligent proxy**, processing AI edits as safe, atomic transactions:
19 
201. **Read:** Translates the document (from disk or live Word) into LLM-friendly **[CriticMarkup](https://fletcher.github.io/MultiMarkdown-6/syntax/critic.html)** with a **Semantic Appendix** of defined terms, cross-references, and likely typos. The agent starts with semantic structure, not raw data.
212. **Validate:** Acts as a strict safety gate. It protects the document's integrity by automatically blocking ambiguous text matches or invalid structural changes before they touch the file.
223. **Apply:** Translates the AI's text edits into native Word Track Changes. Adeu handles the complex XML under the hood, ensuring existing layouts, fonts, and margin comments are perfectly preserved.
23 
24Built and maintained by the team at [Adeu](https://adeu.ai).
25 
26---
27 
28## Installation
29 
30Adeu can be installed directly into AI assistants as an MCP server, used as a Claude Code plugin or Agent Skill, CLI tool, or used locally as a developer toolchain.
31 
32### Claude Code (Plugin)
33Adeu ships as a [Claude Code plugin](https://docs.claude.com/en/docs/claude-code/plugins) with a built-in agent skill that teaches Claude how to use the engine effectively. Inside Claude Code:
34 
35```
36/plugin marketplace add dealfluence/adeu
37/plugin install adeu-redlining@adeu-skills
38```
39 
40For best results, also connect either the Node MCP server (`npx -y @adeu/mcp-server`) or the Python MCP server (`uvx --from adeu adeu-server`). The plugin works without an MCP server too — it falls back to driving the `uvx adeu` CLI via Bash.
41 
42### Other Skills-Compatible Agents (Cursor, Windsurf, VS Code Copilot, etc.)
43Adeu's redlining skill follows the open [Agent Skills specification](https://agentskills.io) and works with any compatible agent:
44 
45```bash
46npx skills add dealfluence/adeu
47```
48 
49The skill installs to your agent's skills directory and activates automatically when you ask Claude to redline, edit, or review a `.docx` file.
50 
51### Claude Desktop
52You can install Adeu directly into Claude Desktop using the official extension package:
531. Download the latest `Adeu.mcpb` file from the [GitHub Releases](https://github.com/dealfluence/adeu/releases) page.
542. Open Claude Desktop and navigate to **Settings > Extensions**.
553. Click **Advanced settings** and find the Extension Developer section.
564. Click **Install Extension...**, select the downloaded `.mcpb` file, and follow the prompts.
57 
58### Gemini CLI
59Adeu is available as a native [Gemini CLI extension](https://geminicli.com/extensions/). To install:
60```bash
61gemini extensions install https://github.com/dealfluence/adeu
62```
63 
64### Other MCP Clients (Cursor, Windsurf, etc.)
65For IDEs or clients that configure MCP servers via JSON, you can use either the Node.js or Python backend:
66 
67**Node.js**
68```json
69{
70 "mcpServers": {
71 "adeu": {
72 "command": "npx",
73 "args": ["-y", "@adeu/mcp-server"]
74 }
75 }
76}
77```
78 
79**Python (Required for Live MS Word integration on Windows)**
80```json
81{
82 "mcpServers": {
83 "adeu": {
84 "command": "uvx",
85 "args": ["--from", "adeu", "adeu-server"]
86 }
87 }
88}
89```
90 
91### Smithery
92To install Adeu using the Smithery package manager:
93```bash
94npx -y @smithery/cli install adeu --client claude
95```
96 
97---
98 
99## Agent Workflows
100 
101Adeu provides agents with specific tools to read, review, and edit documents safely.
102 
103> **MCP Apps UI:** The `read_docx` tool supports the MCP Apps UI protocol. When an agent reads a document, Adeu dynamically renders a custom, interactive Markdown view directly inside the chat window.
104 
105**Recommended Agent Prompt:**
106You can guarantee the best behavioral results by adding this context to your agent's system prompt or project instructions:
107 
108> **Role:** Document Specialist
109> **Tools:**
110>
111> - `read_docx(clean_view=True)`: Read the final "clean" version of the text to understand context. Use `search_query` and `page` filters to locate specific clauses without reading the whole document.
112> - `process_document_batch`: **Commit & Negotiate Mode.** Apply a unified list of changes. Use `type: "modify"` for specific search-and-replace text edits (supports `match_mode="all"` and `regex=True` for bulk updates), and `type: "accept"`, `"reject"`, or `"reply"` to manage existing Track Changes and Comments by ID.
113> - `finalize_document`: **Pre-Send Scrub.** Strip dangerous metadata, author names, and internal tracking IDs, lock the document (`protection_mode="read_only"`), and prepare it for distribution.
114 
115### Live MS Word Integration
116If you are running on Windows with Microsoft Word installed, Adeu can act as a real-time copilot, editing the active document right in front of you. This requires running the Python MCP server backend (see Developer Tools below).
117 
118---
119 
120## Developer Tools (Python & TypeScript)
121 
122If you are building a legal-tech application, an automated pipeline, or want to use the local CLI, use our SDKs.
123 
124### The Python CLI
125The Python toolchain is managed via [uv](https://docs.astral.sh/uv/).
126 
127```bash
128pip install uv
129uv tool install adeu
130 
131# Extract clean text for RAG or prompting
132adeu extract contract.docx -o contract.md
133 
134# Generate a visual diff between two versions
135adeu diff v1.docx v2.docx
136 
137# Apply edits to the DOCX
138adeu apply contract.docx edits.json --author "Review Bot"
139 
140# Apply valid edits in salvage mode while reporting failing edits
141adeu apply contract.docx edits.json --partial
142 
143# High-throughput JSON-Lines daemon
144adeu serve
145 
146# Scrub author metadata and internal trackers
147adeu sanitize redline.docx -o clean.docx --keep-markup --author "My Firm" --report
148```
149 
150What the text projection preserves exactly, what it normalizes (lists,
151styles, synthetic pages), and what stays read-only is specified in
152[docs/FIDELITY.md](docs/FIDELITY.md).
153 
154### The Python SDK
155```python
156from adeu import RedlineEngine, ModifyText
157from io import BytesIO
158 
159with open("MSA.docx", "rb") as f:
160 stream = BytesIO(f.read())
161 
162edit = ModifyText(
163 target_text="State of New York",
164 new_text="State of Delaware",
165 comment="Standardizing governing law."
166)
167 
168engine = RedlineEngine(stream, author="AI Copilot")
169engine.apply_edits([edit])
170 
171with open("MSA_Redlined.docx", "wb") as f:
172 f.write(engine.save_to_stream().getvalue())
173```
174 
175### The TypeScript SDK
176The entire core parsing and diffing engine is also available in pure TypeScript.
177 
178```typescript
179import { readFileSync, writeFileSync } from "fs";
180import { DocumentObject, RedlineEngine } from "@adeu/core";
181 
182const buffer = readFileSync("MSA.docx");
183const doc = await DocumentObject.load(buffer);
184 
185const engine = new RedlineEngine(doc, "AI Copilot");
186engine.process_batch([{
187 type: "modify",
188 target_text: "State of New York",
189 new_text: "State of Delaware",
190 comment: "Standardizing governing law."
191}]);
192 
193const outBuffer = await doc.save();
194writeFileSync("MSA_Redlined.docx", outBuffer);
195```
196 
197See the [@adeu/core documentation](https://github.com/dealfluence/adeu/tree/main/node/packages/core#readme) for full installation and usage details.
198 
199### n8n Community Node
200Adeu ships as an [n8n](https://n8n.io) community node (`n8n-nodes-adeu`) for teams who prefer visual workflow automation over code. It exposes the full engine (extract Markdown, apply tracked changes, generate diffs, and finalize documents) as drop-in nodes that work in both deterministic pipelines and AI Agent tool calls.
201 
202```bash
203# In n8n: Settings → Community Nodes → Install: n8n-nodes-adeu
204```
205 
206See the [n8n-nodes-adeu README](https://github.com/dealfluence/adeu/blob/main/node/packages/n8n-nodes-adeu/README.md) for installation, `$fromAI` recipes, and example workflows.
207 
208---
209 
210## LangChain Integration
211 
212`langchain-adeu` is an official integration package that exposes Adeu's local, offline-capable document manipulation tools directly to the LangChain ecosystem.
213 
214```bash
215pip install langchain-adeu
216```
217 
218Bundle its capabilities as tools in your agent workflow:
219```python
220from langchain_adeu import AdeuToolkit
221 
222# Instantiate and retrieve all document tools
223tools = AdeuToolkit().get_tools()
224```
225 
226Refer to the [LangChain Workspace Guide](langchain/README.md) for full development instructions and detailed parameters.
227 
228---
229 
230## Ecosystem & Integrations
231 
232Adeu is designed as a Virtual DOM for DOCX. Because we keep the core strictly focused on OpenXML safety, we maintain a dedicated [`ecosystem/`](ecosystem/) directory for third-party integrations.
233 
234The ecosystem folder hosts policies and guidelines for third-party contributions such as legal validation workflows, CLM sync scripts, and specialized multi-agent architectures.
235 
236**Are you a vendor or builder?** We welcome PRs to the ecosystem folder! Please see our [Vendor & Integration Policy](ecosystem/VENDOR_POLICY.md) to get started.
237 
238---
239 
240## Adeu Cloud
241 
242By default, the core Adeu redlining engine and local file tools are fully open-source and execute entirely on your machine. **Adeu never phones home with your local documents** (though your chosen LLM provider will naturally process the text the agent reads).
243 
244However, for teams requiring end-to-end workflows, you can connect to **Adeu Cloud** to unlock:
245 
246- **Email Processing & Fetching:** We offer an extended MCP server with secure email thread fetching, document extraction, and automated drafting capabilities to handle contracts directly from your inbox.
247 
248[Learn more about Adeu Cloud](https://adeu.ai).
249 
250---
251 
252## Contributing
253 
254We welcome contributions from the community! Whether it's fixing bugs, adding capabilities, or improving documentation, please see our [Contributing Guide](CONTRIBUTING.md) for instructions on setting up the local `uv` environment, running tests, and understanding the project's strict XML safety guidelines.
255 
256---
257 
258## License
259 
260MIT License. Open source and free to use in commercial applications.
261 
262 

Discussion

Alternatives