# adeu [Health: Active]

**Category:** 🏢 Workplace & Productivity  
**Repository:** https://github.com/dealfluence/adeu  
**GitHub Stars:** 162  
**npm Downloads (last month):** 3383  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/adeu

## Description
docx ↔ LLM translator. Projects .docx office files to Markdown for editing. Projects edits back to OOXML as tracked changes (redlines). Python and Node.js implementations.

## Tools
Capabilities this server exposes over MCP:

- **accept_all_changes** — Accepts every tracked change in the document, producing a finalized clean document.

remove_comments (boolean, DEFAULT TRUE): also delete every comment. The default is TRUE because this tool's purpose is a distributable clean document, and comments are internal review notes that must not travel to a counterparty. Pass remove_comments=false to accept the tracked changes while KEEPING the comments — use that when the review conversation is still live. Either way the response reports how many comments were deleted and names each one with its author, and comments whose anchored text an accepted deletion consumes are removed regardless, exactly as Word does. [Adeu v3.0.6+df9e00c]
- **apply_text_revision** — Applies whole-text revised text to a DOCX document by computing a diff and generating tracked changes. Includes a clean-text verification gate to ensure the applied document matches the supplied text.

`revised_text` must be the complete CLEAN view of the document: read it with `read_docx` (`clean_view=true`, `page='all'`), edit that text, and send ALL of it back. Never CriticMarkup ({++, {--, {>>) — this tool diffs against the clean view, so markup tokens would land in the document as literal prose. Never one page of a paginated extract — everything absent from the text is applied as a tracked deletion.

INTERLOCK: a revision that drops >50% of the characters (>75% for documents under 2000 characters) is refused unless you pass allow_major_deletions=true.

If the applied document's clean text does not then match `revised_text`, NOTHING is written to output_path: a diagnostic copy is kept at <name>.unverified.docx and the call fails. output_path defaults to <name>_redlined.docx; an existing _redlined/_processed artifact is revised in place. [Adeu v3.0.6+df9e00c]
- **diff_docx_files** — Compares two DOCX files and returns a compact `@@ Word Patch @@` diff — Adeu's token-level, sub-word patch format — of their text content. Useful for analyzing differences between versions before editing. [Adeu v3.0.6+df9e00c]
- **finalize_document** — Prepares a document for external distribution or e-signature. Note: in this zero-dependency environment, protection_mode='encrypt' is unsupported and falls back to a native read-only lock; export_pdf and password are ignored. [Adeu v3.0.6+df9e00c]
- **process_document_batch** — Applies a batch of edits and review actions to a DOCX.

Batches apply SEQUENTIALLY: each change validates against state from prior changes. Valid changes apply when others fail (salvage default): response LEADS with `PARTIAL: applied K of N` listing unapplied changes. Pass partial=false for all-or-nothing.

Each item in `changes` needs a `type`:
1. 'modify': search-and-replace. `target_text` must match uniquely (`match_mode`:'strict', default) — add context or set `match_mode`:'first'/'all'. Set `regex`:true for regex matching (groups in `new_text` as $1, $2…). `new_text` supports Markdown: '#'–'######' headings, '**bold**', '_italic_', '\n\n' paragraph split. Omit it (with a comment) to annotate without changing text; empty string deletes. Never write CriticMarkup manually — use `comment`.
   • EMPTY CELLS: blank cells carry `{#cell:<id>}` anchors — set `target_text` to the anchor and value in `new_text`. Pipes are display separators.
2. 'accept'/'reject': finalize or revert a tracked change by `target_id` (e.g. 'Chg:12').
3. 'reply': reply to a comment by `target_id` (e.g. 'Com:5') with `text`.
4. 'set_field': fill a form field — `field` is its 'CC:<N>' id, tag or alias, `value` the text; list via `read_docx` `mode`:'fields'. Checkboxes take true/false, dates YYYY-MM-DD, dropdowns a listed option. Dual-writes bound stores. A locked/protected control refuses and names the override permitting it.
5. 'insert_row': add table row — `target_text` anchors on an existing row's text, `cells` holds cell values (left-to-right), `position` is 'above'/'below' (default below). 'delete_row': remove row matching `target_text`. Disk mode only.

ID VOLATILITY: 'Chg:N'/'Com:N' ids shift between states — call `read_docx` before accept/reject/reply; never reuse ids from earlier turns.

`author_name` sets Track Changes attribution; defaults to 'Adeu AI (TS)' when omitted. [Adeu v3.0.6+df9e00c]
- **read_docx** — Reads a DOCX file. Returns text with inline CriticMarkup for Tracked Changes and Comments: {++inserted++}, {--deleted--}, {==highlighted==}{>>comment<<}. Set clean_view=True for the finalized 'Accepted' text without markup.

Modes:
- 'full' (default): paginated body content. Use page=N to navigate.
- 'outline': heading map only — start here for large docs to plan targeted reads. Defaults to L1-L2 headings; pass outline_max_level=3-6 to see deeper structure.
- 'appendix': defined terms, anchors, and cross-reference targets. Consult before editing legal/technical docs to avoid breaking references.
- 'changes' (mode='changes'): a ledger of every tracked change and comment (id, type, author, page, snippet) — start here for review work instead of reading pages. Filter with changes_author, page, and changes_offset.
- 'fields' (mode='fields'): a ledger of every content control (ordinal, class, alias/tag, location, lock/binding state, current value) — start here to discover fillable fields. Paginate with fields_offset; `page` and `search_query` do not apply.

`page`: a positive integer (1-indexed, default 1), a page RANGE like '2-6' (returns up to 8 pages in one call, then names the next range), or 'all'. Pages are synthetic length-based chunks sized for LLM consumption, NOT printed Word pages. In mode='full', page='all' returns the whole body with no page chrome; oversized documents are refused with an outline and a bounded-read recipe unless force=true. With `search_query`, `page` instead restricts matches to that page (default: search all pages). [Adeu v3.0.6+df9e00c]

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

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

## Documentation & README

# Adeu: Track Changes for the LLM era

[![GitHub Repo stars](https://img.shields.io/github/stars/dealfluence/adeu?style=social)](https://github.com/dealfluence/adeu)
[![PyPI version](https://img.shields.io/pypi/v/adeu.svg)](https://pypi.org/project/adeu/)
[![npm version](https://img.shields.io/npm/v/@adeu/core.svg)](https://www.npmjs.com/package/@adeu/core)
[![Downloads](https://img.shields.io/pepy/dt/adeu)](https://pepy.tech/project/adeu)
[![MCP Compatible](https://img.shields.io/badge/MCP-Compatible-green.svg)](https://modelcontextprotocol.io/)
[![Smithery](https://img.shields.io/badge/Smithery-Available-blue.svg)](https://smithery.ai/servers/adeu/adeu)
[![CI](https://github.com/dealfluence/adeu/actions/workflows/ci.yml/badge.svg)](https://github.com/dealfluence/adeu/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/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](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.
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](https://adeu.ai).

---

## 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](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:

```
/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](https://agentskills.io) and works with any compatible agent:

```bash
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](https://github.com/dealfluence/adeu/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](https://geminicli.com/extensions/). To install:
```bash
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**
```json
{
  "mcpServers": {
    "adeu": {
      "command": "npx",
      "args": ["-y", "@adeu/mcp-server"]
    }
  }
}
```

**Python (Required for Live MS Word integration on Windows)**
```json
{
  "mcpServers": {
    "adeu": {
      "command": "uvx",
      "args": ["--from", "adeu", "adeu-server"]
    }
  }
}
```

### Smithery
To install Adeu using the Smithery package manager:
```bash
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](https://docs.astral.sh/uv/).

```bash
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](https://github.com/dealfluence/adeu/blob/HEAD/docs/FIDELITY.md).

### The Python SDK
```python
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.

```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](https://github.com/dealfluence/adeu/tree/main/node/packages/core#readme) for full installation and usage details.

### n8n Community Node
Adeu 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.

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

See 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.

---

## LangChain Integration

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

```bash
pip install langchain-adeu
```

Bundle its capabilities as tools in your agent workflow:
```python
from langchain_adeu import AdeuToolkit

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

Refer to the [LangChain Workspace Guide](https://github.com/dealfluence/adeu/blob/HEAD/langchain/README.md) 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/`](https://github.com/dealfluence/adeu/blob/HEAD/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](https://github.com/dealfluence/adeu/blob/HEAD/ecosystem/VENDOR_POLICY.md) 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](https://adeu.ai).

---

## Contributing

We welcome contributions from the community! Whether it's fixing bugs, adding capabilities, or improving documentation, please see our [Contributing Guide](https://github.com/dealfluence/adeu/blob/HEAD/CONTRIBUTING.md) 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.


