The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the OfficeAgent.NET listing page.
Give coding agents a structured way to create and edit real Word documents, PowerPoint decks, and Excel workbooks. OfficeAgent.NET turns an agent's intent into typed, validated operations and applies them directly to OOXML packages while preserving document structure.
Use it to generate documents and presentations, make targeted edits, update tables, styles, and images, or manage comments and review state. The engine ships as an MCP server, Microsoft Agent Framework tools, and a .NET API, with filesystem, SharePoint, session, and inline document workflows.
One example is a targeted Word edit whose result remains reviewable:

An Office Open XML file is a package of related XML parts. A small change can affect runs, styles, numbering, comments, content controls, or revision markup. OfficeAgent.NET handles that document-specific work. The model works with structured document data and JSON-serialisable operations such as "replace this clause as a tracked change" or "add a row to this table."
The same engine is available in three forms:
Microsoft.Extensions.AI;It supports Word .docx, PowerPoint .pptx, and Excel .xlsx; one client routes
each document to the module that handles it. See Scope and limitations before choosing
it for a workflow that depends on Office's layout or calculation engine.
| Area | Supported workflows |
|---|---|
| Word creation and editing | Create .docx files; inspect and change text, paragraphs, tables, images, styles, content controls, headers, footers, notes, page setup, and document properties |
| Word review | Read and manage comments, preserve or resolve review state, set one revision identity per plan, and record supported edits as tracked revisions |
| PowerPoint creation and editing | Build or update decks with slides, layouts, text, tables, native editable charts, images, media, notes, comments, sections, transitions, and animations |
| Excel inspection and editing | Inspect worksheets, tables, and bounded ranges; find raw or displayed values; set cells and formulas; append table rows; manage cell notes |
| Agent and application integration | Use MCP over stdio or HTTP, Microsoft Agent Framework tools, or the direct .NET API, with SHA-256 apply receipts and host-supplied audit actors |
| Document access | Work with bounded filesystem roots, SharePoint, in-memory sessions, or self-contained inline content |
| I want to... | Start here |
|---|---|
| Try a targeted Word edit | Try a Word edit |
| Create a Word document from scratch | Create a document |
| Create or edit a PowerPoint deck | PowerPoint support |
| Inspect or edit an Excel workbook | Excel support |
| Connect Codex, Claude Code, Copilot Studio, or Microsoft 365 Copilot | Deployment and client setup |
| Use OfficeAgent from C# | Getting started |
| Add tools to a Microsoft Agent Framework agent | Agent integration |
| Host the MCP server or use SharePoint | MCP server and document providers |
| Edit documents with no storage configured | Documents with no storage |
| Run a tracked-review workflow | Optional word-document-review skill |
| Build a contract-review agent | ContractReview sample |
| Check support, compatibility, or security policy | Support and security |
| Contribute | Contributing |
This small workflow demonstrates that OfficeAgent can change an existing OOXML file without flattening its structure. It uses tracked changes because the result is easy to verify in Word; review is one part of the broader document operation set.
Install the server. The published package command is:
Make a folder for the agent to work in and download the sample contract into it — a fictional services agreement with a clause to change, a table, an open comment, and a pending redline:
PowerShell:
Any .docx of your own works too — the sample just gives you something with a comment and a
pending revision already in it.
Register the server with Claude Code, pointed at that folder and nothing else:
PowerShell:
For this review-specific workflow, you can optionally install the word-document-review skill before starting the client.
Then ask:
In services-agreement.docx, change the payment terms from thirty days to forty-five days.
Open the file in Word. Clause 3 now reads forty-five days as a tracked change you can accept or reject, and everything else — the table, the comment, the redline that was already there — is exactly as it was. This demonstrates a key engine property: apply the requested operation while preserving unrelated package content.
What else the sample is good for — reviewing comments, accepting revisions, editing the table.
Next, try creating a Word document, generating a PowerPoint deck, or using the direct .NET workflow.
claude mcp list shows officeagent as failed | Check RootPath is an absolute path to a directory that exists. |
| The agent says it cannot find the document | Use a relative name, or an absolute path that still resolves inside RootPath. |
io-error on save | Close the file in Word, then check filesystem permissions and the available disk space. |
The quick start above is deliberately the smallest thing that works. Four settings extend it:
| Setting | Adds |
|---|---|
OfficeAgent__AllowCreation=true | create_document, so "draft a project brief in brief.docx" makes a new file instead of failing |
OfficeAgent__FileSystemConnections__0__AllowedExtensions__0=.docx plus OfficeAgent__FileSystemConnections__0__AllowedExtensions__1=.pptx | Word and PowerPoint on one connection. Declaring this list replaces the .docx default. Set OfficeAgent__FileSystemConnections__0__DefaultChangeMode=Direct for decks, and send "mode": "Tracked" explicitly for reviewable Word edits on that mixed connection. |
OfficeAgent__EphemeralConnectionId=session | Names the in-memory session connection explicitly. With no configuration at all the server already falls back to one - this is for running it alongside storage, or under a different id |
OfficeAgent__AllowInlineContent=true | Tools that carry the document as base64, for a single self-contained call |
Past a couple of settings, use a file instead — the same OfficeAgent section, where a list
is a list:
The same configuration is available as
samples/config/word-and-powerpoint.json. Change
RootPath before using it.
Environment variables still override the file. Windows, PowerShell, other MCP clients, HTTP hosting and SharePoint are in Deployment and client setup; every setting is listed in MCP server.
skills/word-document-review teaches the review
loop: read comments and pending revisions before editing, keep reviewable Word edits as
redlines, use document ids for multi-step work, and recover from stable error codes. The
installation guide gives complete Bash and PowerShell steps
for Claude Code and Codex, including installation from a fresh machine and verification.
The skill is only needed when the task requires that review discipline; document creation,
ordinary direct edits, and PowerPoint workflows use the server without it.
The inspect and find tools return document text and structure to the model — that is how it locates an edit. Filesystem and SharePoint operations keep the package behind an opaque id. Inline tools carry the whole file as base64 on every call. Session import/export also carries the package as base64 if the agent performs those calls; a host integration can instead move the bytes outside model context. Connect storage and model providers appropriate for the data.
The server ships no authentication layer for HTTP hosting; put it behind your own. A filesystem root is a trust boundary: its ACLs must stop untrusted principals creating, renaming or replacing entries while the server runs.
Install the core package and Word module:
After registering services and a document provider, the edit loop looks like this:
The complete example, including service registration and reading the saved file, is in Getting started. The minimal direct-.NET sample runs against the bundled fictional contract, so it needs no MCP client, language model, or document of your own:
Open quickedit-output.docx in Word and verify that the payment term is a tracked
change while the existing revision, comment, table, and headings remain intact.
QuickEdit also accepts an exact source and replacement text
for your own document.
The repository also contains a
direct IChatClient Word-editing sample and an
interactive
Agent Framework sample, plus a complete
contract-review agent that separates model judgement from
validated document writes.
Every edit follows the same four steps:
A plan (DocumentPlan) is a typed, JSON-serialisable list of operations. An
anchor records both a location and the content expected there. If the content
or optional document snapshot has changed, validation fails instead of silently
targeting a different location. Applying a plan is all-or-nothing.
The Word module supports changes to text, paragraphs, tables, images, styles, content controls, comment threads, footnotes and endnotes, page geometry and breaks, document properties, and tracked revisions. Operations with a Word revision representation record a redline when the connection asks for one - an inserted clause, a deleted row and a restyled heading all come back as revisions a reviewer accepts or rejects, not only a replaced phrase. Image resizing is applied directly because WordprocessingML has no revision representation for drawing dimensions. The PowerPoint module implements a broad, explicitly documented set of deck operations: text, bullets, run and paragraph formatting, template slots, style copying, tables, images, text boxes, embedded video and audio, speaker notes, resolvable comments, footers and slide numbers, sections, transitions and animations, and the slide lifecycle - adding, removing, reordering and duplicating. Several slide inserts in one plan author a deck end to end, so a single call turns nothing into a finished presentation. Any verb it does not support is named rather than silently skipped. The full operation schema is documented in Document plans, and the deck specifics in PowerPoint support.
Documents are accessed through configured providers. After registration,
editing calls use a (connectionId, documentId) pair instead of a storage path
or credentials. The filesystem provider restricts registrations to its root;
the SharePoint provider uses the permissions of its configured identity.
CreateAsync starts a new document inside a connection: the requested .docx
or .pptx extension selects a registered blank-document factory. The engine
applies an optional initial plan in memory, and then asks
the provider to create and register it without overwriting an existing name.
| Guide | Covers |
|---|---|
| Documentation hub | Learning paths, package map, and the complete documentation set |
| Getting started | A complete edit from service registration to reading the result |
| Concepts | Anchors, snapshots, plans, providers, transactions, and capabilities |
| Document plans | JSON shapes and validation rules for every operation |
| Document providers | Filesystem, SharePoint, save modes, and custom providers |
| PowerPoint support | Slide addressing, the verbs the deck module implements, and what it preserves |
| Agent integration | Microsoft Agent Framework and Microsoft.Extensions.AI tools |
| MCP server | Server configuration, transports, security notes, and tool contracts |
| Deployment and client setup | Codex, Claude Code, Microsoft Copilot clients, containers, and Azure |
| Operations | Concurrency, streams, cancellation, telemetry, and production concerns |
| Troubleshooting | Startup, registration, validation, concurrency, and provider failures |
| Failure modes | Common plan errors and what to do next |
| Releasing | Publishing to NuGet, the MCP Registry, and GitHub |
Bug reports, documentation fixes, new document operations, provider integrations, and focused test cases are useful contributions. If you found a problem, open an issue with the document feature involved, the operation you attempted, and the error or unexpected result. Do not attach confidential documents; a small sanitised reproduction is enough.
To work on the code, install the .NET 8 SDK, fork the repository, and run:
Before starting a larger change, especially one that changes public types or the JSON wire format, open an issue so the design can be discussed. See CONTRIBUTING.md for code style, tests, and pull-request expectations.
OfficeAgent.NET edits Word .docx, PowerPoint .pptx, and Excel .xlsx files;
it does not automate the Office desktop applications.
The deck module refuses the verbs a presentation has no vocabulary for -
setProperty, revision, pageSetup, insertBreak and note - per
operation, rather than applying part of a plan, and refuses an explicit tracked
mode on any verb that carries one. PresentationML has no redline model, so tracked changes are Word-only, and
a slide has no header (that is a notes and handout concept). Animations cover
the effects expressible as a filtered p:animEffect; fly-in, zoom and motion
paths are refused rather than approximated. See
PowerPoint support for what a deck does and does not
accept.
The engine does not render pages, calculate Word fields, or evaluate Excel formulas. Formula edits set the workbook to recalculate when Excel opens it. Operations that depend on pagination, table-of-contents rendering, field recalculation, or page-fit checks are outside its scope. Preview reports structural changes, not a visual rendering of the final document. Test the workflow on representative documents and keep human review in the loop for consequential edits.
Two more limits worth knowing before you build on it:
fidelity and paging - that is where the saving comes from. The inline
*_content tools are the deliberate exception: they carry the whole file as
base64 in both directions, which costs tokens in proportion to file size. They
suit a single self-contained call, not a sequence of edits - a model asked to
pass a document of a few kilobytes back for a second edit reproduces it
imperfectly and the follow-up fails. Use a connection, or a session connection,
when more than one edit is coming.OfficeAgent.NET is MIT-licensed and can be self-hosted. Managed hosting and commercial support are available from dotaction: contact dotaction.
MIT. See LICENSE.