io.github.Anselmoo/mcp-ooxml-ledger
This server edits Office documents, records every change in a ledger, and refuses to seal a document unless every change is accounted for.
Start, resume, and close editing sessions for OOXML documents.
Inspect document structure and find text in Word, PowerPoint, and Excel files.
Preview edits without writing; apply all-or-nothing edits in tracked (Word revision marks) or direct mode.
Insert and delete whole Word paragraphs with precise addressing and tracking.
Commit documents through a replay gate that refuses unrecorded changes; force overrides are recorded and surfaced.
Verify documents against receipts (verified/unknown/failed), list/export receipts, and compute canonical digests.
Read-only deployment mode; CLI verification for CI.
Word .docx fully editable; PowerPoint .pptx direct-edit only; Excel .xlsx is verify/read-only.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@io.github.Anselmoo/mcp-ooxml-ledger Open report.docx, update Q3 revenue to $5M, and commit."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-ooxml-ledger
An MCP server that edits Office documents and refuses to write one where an edit went unrecorded.
Before sealing a session it replays every recorded operation against the document's baseline and compares the result to what is actually on disk. A change no operation explains means the commit is refused. Of ~18 competing MCP document-editing projects, none gates the write on that check. The refusal is the product.
Setup
uv add mcp-ooxml-ledgerAdd to .mcp.json (project) or claude_desktop_config.json (desktop — use an absolute path,
${CLAUDE_PROJECT_DIR} isn't expanded there):
{
"mcpServers": {
"ooxml-ledger": {
"command": "uv",
"args": ["run", "--project", "${CLAUDE_PROJECT_DIR}", "ooxml-ledger-mcp"],
"env": { "OOXML_LEDGER_ROOTS": "${CLAUDE_PROJECT_DIR}" }
}
}
}Needs uv on PATH; nothing else installed globally. Invoking the ooxml-ledger-mcp script
directly gives ENOENT — it lives in the project venv, not your shell's PATH.
OOXML_LEDGER_ROOTSis the security boundary. Anos.pathsep-separated list; every path any tool receives is resolved inside it and refused outside. Unset, it defaults to the server's working directory — set it deliberately, sinceexport_receiptwrites anywhere inside a root.
Related MCP server: Word AI
Tools
Tool | ||
session |
| writes |
read |
| read-only |
edit |
| writes |
seal |
| writes · enforces the gate |
stateless |
| read-only |
| writes | |
transfer |
| writes — into |
| read-only |
Typical loop:
open_document → find_text → preview_edits → apply_edits → commit_document → verifysid = open_document(document="report.docx")["session_id"]
find_text(sid, query="Q3 revenue") # → part, para_id, para_hash
preview_edits(sid, edits=[...], author="alice") # → what WOULD happen; writes nothing
apply_edits(sid, edits=[...], author="alice", mode="tracked")
commit_document(sid) # → refuses if anything is unaccounted for
verify("report.docx") # → verified | unknown | failedpreview_edits runs the same engine function as apply_edits against a throwaway copy, so
the two cannot disagree. Batches are all-or-nothing: a failing edit leaves the document
byte-identical.
mode="tracked" emits Word revision marks a reviewer sees in the document. mode="direct"
rewrites the text with none — still fully recorded, and the receipt discloses that a direct
edit touched a revision-capable part, so it is never silently indistinguishable from an
ordinary save.
Chat and hosted clients
A file uploaded into a chat lives in the client's sandbox, not on the server's filesystem,
so open_document correctly refuses its path. Widening OOXML_LEDGER_ROOTS cannot reach it.
Send the bytes instead:
import_document → open_document → … → commit_document → export_documentp = import_document(name="report.docx", content_base64="UEsDB…")["path"] # → <root>/_inbox/report.docx
sid = open_document(document=p)["session_id"]
... # edit as usual
commit_document(sid) # → receipt schema ooxml-ledger/2
export_document(document=p) # → file + receipt as embedded resourcesWhere it lands.
import_documenttakes a bare filename and writes_inbox/<name>under the first root. It never overwrites an existing file, and it validates the bytes as a real Office package before anything is published.Large files. A model has to emit the base64 itself, so a single call carries far less than the cap. Send chunks:
final=falsereturns anupload_id; continue with it andoffset(the bytes received so far); thefinal=truecall must carry thesha256of the whole file. A lost or repeated chunk is a refusal, never a different document.Size cap.
OOXML_LEDGER_IMPORT_MAX_BYTESsets the largest document either tool accepts, in decoded bytes. The default is 25 MiB.Provenance. An imported document's first bytes on this host came from a tool call, not from the user's filesystem. Every receipt in that lineage is therefore sealed as
ooxml-ledger/2, with a chain-boundprovenanceblock (docs/superpowers/specs/receipt-format-v2.md).verifyprints it as aPROVENANCEline, and it never changes the verdict. Receipts for every other document stayooxml-ledger/1, byte-identical to before.Getting it back.
export_documentreturns the file as an MCP embedded resource, with its Office media type and the receipt alongside. By default it refuses a document that no stored receipt matches, so an unsealed edit is never handed out; passrequire_receipt=falseto override.
Format matrix
Format | Verify | Edit |
Word | Yes | Yes — tracked + direct, paragraph insert/delete |
PowerPoint | Yes | Direct only — PresentationML has no revision model, so every edit carries a mandatory disclosure |
Excel | Yes | No — editing verbs refuse, naming the format |
Verification, digests, the gate and the receipt model are format-agnostic. Only the editing
engines are format-specific: wml.py (Word) and pml.py (PowerPoint).
Read-only deployment
OOXML_LEDGER_READ_ONLY=1 leaves exactly server_info, digest, verify, list_receipts,
export_document.
The others aren't merely hidden — calling one answers Unknown tool. No write surface inside
the roots at all.
CLI
ooxml-ledger verify report.docx # exit 0 only when verifiedNo server, no session — digests the file, finds its receipt by content address, checks it. Wire it into CI or a pre-commit hook and an unaccounted-for change fails the build.
Desktop bundle (.mcpb)
Every GitHub Release attaches a .mcpb file — a one-click Claude Desktop install: drag it onto
the app and Desktop launches it with
uv run --directory <bundle> --frozen --no-dev ooxml-ledger-mcp.
Nothing is vendored — the bundle carries only manifest.json, pyproject.toml, uv.lock,
README.md, LICENSE and src/. The host needs uv on PATH, and the first launch
resolves the exact dependency versions uv.lock pins from PyPI, which needs network access;
--frozen means it installs precisely the versions the test suite ran against, never a fresh
resolve, and --no-dev keeps the dev group (pytest, ruff, pre-commit) out of the install. mcpb/manifest.json exposes the document root and read-only toggle as install-time
settings instead of environment variables; the tool list matches the stdio server's.
CI builds and smoke-tests the bundle on macos-latest only, and the manifest's
compatibility.platforms declares darwin only — the bundle is built and proven on
macOS/arm64, nothing else. Because nothing is vendored, uv itself picks a Python
satisfying requires-python = ">=3.13" and installs the wheels uv.lock pins for the host's
own platform — native ones such as pydantic-core and cryptography included. That part is not
darwin-specific, but only the darwin launch path has actually been proven end-to-end here.
Honest limits
An unsigned receipt is accident-evident, not tamper-evident. It catches an agent falling back to a generic file write, an Office round-trip, a careless collaborator — not someone who rewrites the receipt alongside the document. Anchoring its hash somewhere the holder doesn't control (a git commit, a DOI, a submission portal) is what buys tamper-evidence.
Imported provenance lives beside
_inbox/. The import record sits in the store next to the imported file. Moving that file out of_inbox/before its first commit drops the record, so the first receipt is written as v1. After a commit, the lineage travels with the receipts store. Provenance records what arrived, not that it matches the user's original upload: compare itssha256out of band if that matters.A v0.3.0 verifier rejects
ooxml-ledger/2. This is by design. It cannot check the genesis rule, so refusing is better than silently accepting a chain it does not understand.verifynever replays. It checks the digest and the receipt's internal consistency; the replay runs once, at commit, andverifyreports that verdict rather than recomputing it.pptx and xlsx have no human-visible record. Word tracked changes are a second recording layer inside the document; those two formats have none, so the ledger is the only record.
The Word engine reaches paragraph text only (
w:p/w:r/w:t). Styles, numbering, settings and relationships are uneditable and covered by the accountability check alone.
Contributing and security
CONTRIBUTING.md covers setup, the branch and commit naming CI enforces, and the release flow. SECURITY.md covers private vulnerability reporting, and is explicit about which of this project's documented limits are design rather than defects.
MIT licensed. Design notes and specifications live in docs/superpowers/.
Available Tools
14 toolsapply_editsApply editsADestructive
Apply a batch of edits to the document and record each one in the session's journal. ALL-OR-NOTHING: the document is written only if every edit applied, so a failed batch leaves the file byte-identical and journals nothing. mode 'tracked' emits Word revision marks a reviewer can see; 'direct' rewrites the text and is recorded in the ledger alone, which the receipt discloses. Seal the session with commit_document.
Inputs: edits (required), author (required), session_id (required), mode. Returns: parts, applied, outcomes, session_id, +4 more
close_documentClose documentADestructive
End a session and delete its working directory WITHOUT sealing a receipt. Refuses when the journal holds recorded operations unless discard is set — closing over them would throw away the accountability record.
Inputs: session_id (required), discard. Returns: closed, session_id, removed_directory, journal_unreadable, +1 more
commit_documentCommit documentADestructive
End a session by sealing its journal into a receipt, but only if the recorded operations account for every change to the document. If they do not, the commit is REFUSED. force overrides a failed gate VERDICT and the override is recorded in the receipt, where verify will surface it; it does not override a ledger that could not be read or replayed at all.
Inputs: session_id (required), force. Returns: gate, caveat, forced, notices, +9 more
delete_paragraphDelete paragraphADestructive
Delete one whole paragraph and record it in the session's journal. Address it by para_id — the w14:paraId find_text returns — or by para_index TOGETHER WITH para_hash, because an index alone silently addresses a different paragraph once anything above it moves. mode 'tracked' marks the paragraph mark AND every run with w:del, so a reviewer can reject it back and nothing is actually removed; 'direct' removes it outright and is accounted for by the ledger alone, which the receipt discloses. Refused if the paragraph carries a section break, or holds an unaccepted revision by another author. Seal the session with commit_document.
Inputs: part (required), author (required), session_id (required), mode, +4 more. Returns: What one paragraph operation did. No `outcomes` list and no `applied` count, de…
describe_structureDescribe structureARead-onlyIdempotent
Report a session document's structure: which parts the digest covers, which it excludes, and the format's own units — paragraphs for docx, sheets for xlsx, slides (in <p:sldIdLst> order, never filesystem order) for pptx. Describes the session's working copy as opened; verify reports on the file on disk now.
Inputs: session_id (required). Returns: kind, name, parts, sheets, +9 more
digestCanonical digestARead-onlyIdempotent
Compute a document's canonical digest — stable across a no-op Office save, and the key a receipt is stored under. Needs no session.
Inputs: document (required), include_parts. Returns: kind, name, canon, parts, +2 more
export_receiptExport receiptAIdempotent
Write this document's receipt out as one self-contained sidecar file — the thing you attach to a submission, commit to git, or register alongside a DOI.
Inputs: document (required), dest, overwrite. Returns: gate, path, bytes, caveat, +4 more
find_textFind textARead-onlyIdempotent
Case-insensitive substring search over every text-bearing part the digest covers, returning the best address this build can give for each hit: paragraph id or index and hash for docx, slide id for pptx, sheet and cell for xlsx. On pptx, real slides (in presentation order) are visited before slide layouts, masters and notes masters, so the default page surfaces slide content first. Each match's text is a bounded window around the hit, not the whole run — text_length and match_offset locate it in the full run, and text_truncated says whether it was cut; a large result set can also stop early on total response size, reported the same way as max_results paging: truncated=True. Results come from the session's working copy as opened; verify is what reports on the file currently on disk.
Inputs: query (required), session_id (required), part, max_results. Returns: part, query, matches, truncated, +3 more
insert_paragraphInsert paragraphADestructive
Insert a new paragraph carrying text, BESIDE a paragraph you name, and record it in the session's journal. Pass exactly one anchor — after_para_id or before_para_id, the w14:paraId find_text returns. para_hash is OPTIONAL and recommended: the paraId already names one specific paragraph, and passing the hash find_text reported with it additionally refuses the call if that paragraph's text has moved on since you read it. There is deliberately NO raw index parameter. The new paragraph becomes a SIBLING of the anchor, which keeps it inside the same table cell, textbox or content control. mode 'tracked' marks the new paragraph and its run with w:ins, so rejecting removes the whole paragraph; 'direct' writes it unmarked and is accounted for by the ledger alone, which the receipt discloses. Seal the session with commit_document.
Inputs: part (required), text (required), author (required), session_id (required), +5 more. Returns: What one paragraph operation did. No `outcomes` list and no `applied` count, de…
list_receiptsList receiptsARead-onlyIdempotent
List every receipt in the store beside a document, flagging the one whose result digest matches the document as it stands now, and naming every file that was skipped and why.
Inputs: document (required). Returns: store, caveat, skipped, document, +3 more
open_documentOpen documentAIdempotent
Start an editing session: unpack the document to disk, record its baseline digest and part manifest, and sweep expired sessions. Reopening the same unchanged document resumes its live session instead of forking a second one.
Inputs: document (required), ttl_seconds, keep_baseline. Returns: kind, name, canon, parts, +8 more
preview_editsPreview editsARead-onlyIdempotent
Report what a batch of edits WOULD do, writing nothing. Runs the same engine against a throwaway copy of the document as it stands on disk right now — including every edit already applied in this session — so a green preview and the apply that follows it cannot disagree. author and mode are required because the engine's refusals depend on both.
Inputs: edits (required), author (required), session_id (required), mode. Returns: caveat, outcomes, session_id, would_apply
server_infoServer infoARead-onlyIdempotent
Versions, allowed roots, and what this build can and cannot do.
Inputs: no named parameters. Returns: tool, canon, roots, caveat, +5 more
verifyVerifyARead-onlyIdempotent
Check a document against its receipt. Reports three distinct outcomes: verified, unknown (no receipt matches this digest) and failed (a receipt matched but a tier failed). Needs no session — the same check runs in CI via ooxml-ledger verify.
Inputs: document (required), receipt, original. Returns: tiers, caveat, digest, outcome, +5 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Each tool targets a distinct operation—digest/verify, session lifecycle, receipt management, content discovery, and editing. Even closely related tools like list_receipts and verify are clearly differentiated by their outputs and intent.
The overwhelming majority of tools follow a readable verb_noun snake_case pattern (open_document, list_receipts, delete_paragraph). The exceptions—verify, digest, and server_info—are minor deviations that do not obscure meaning.
14 tools map cleanly onto the server's purpose: capability inspection, digest/verify, session lifecycle, receipt export/listing, content search, and edit operations. Each tool earns its place without redundancy or bloat.
The core workflow of opening a document, finding content, previewing and applying edits, committing, verifying, and exporting receipts is well covered. Minor gaps exist around receipt store management and editing support beyond paragraph/text-level operations, but agents can work around them.
Maintenance
Related MCP Connectors
Online office suite for AI agents: edit docs, sheets, slides and PDFs in browser or via MCP.
Personal, family and business books over fiat and crypto. Reads and records; it cannot pay.
Real Word and Excel for agents: open your .docx/.xlsm, read, propose, apply, get it back intact.
Signed, versioned ledger of standing instructions with intake contradiction diffs.
Related MCP Servers
- AlicenseDqualityDmaintenanceEnables reading, writing, editing, and converting Office documents (ODT, DOCX, ODS, XLSX, PDF, etc.) using MCP tools, with no external dependencies.1111 npmMIT
- AlicenseBqualityCmaintenanceStructure-preserving Word DOCX editing MCP server with a .NET Open XML backend and Office.js live sessions. Enables safe, auditable, incremental editing of Microsoft Word documents for AI agents.6313 npm10AGPL 3.0
- AlicenseAqualityDmaintenanceAn MCP server for byte-preserving, surgical editing of Office documents (docx, pptx) via the GenOffice engine, enabling extraction, patching, creation, deletion, watermarking, and app/CDP-driven operations without breaking layout.155MIT
- AlicenseAqualityBmaintenanceEnables local .docx files to be managed with verified writes, returning before/after evidence for every mutation, plus PDF export and lock/sync status checks.2MIT