# OfficeAgent.NET

An MCP server that hands your agent typed operations on .docx, .pptx and .xlsx files: edits, tables, comments, templates.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 27
- Author: ilia-sokolov
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/ilia-sokolov/OfficeAgent.NET
- Updated: 2026-10-22
- HTML: https://affpapa.org/en/nevibecode/mcp/officeagentnet

## What it does

OfficeAgent.NET is a .NET library built on the Open XML SDK, and the MCP server is one of three ways into the same engine. Your agent sends JSON operations such as replacing a clause as a tracked change or appending a row to a table, instead of touching raw XML. A single client routes each document to the Word, PowerPoint or Excel module.

On the Word side you get document creation and editing — text, paragraphs, tables, styles, headers, footers, content controls, document properties — plus comment handling and revision state. PowerPoint covers decks with slides, layouts, native editable charts, media and notes. Excel covers worksheet and range inspection, finding raw or displayed values, setting cells and formulas, appending table rows. Templates bind content-control tags or shape names, and Word comparison produces a redline plan only when the rest of the package is untouched.

The server runs from the `ghcr.io/ilia-sokolov/officeagent-mcp:1.2.0` image, so Docker has to be present. File access is scoped to the roots you declare in `OfficeAgent__FileSystemConnections__0__RootPath`; with no storage configured, documents stay in the session. If your workflow leans on Office's own layout or calculation engine, this is the wrong tool — it works on package structure and does not recalculate formulas.

## Requirements
- Needs: Docker
- Environment variables: `OfficeAgent__FileSystemConnections__0__ConnectionId`, `OfficeAgent__FileSystemConnections__0__RootPath`, `OfficeAgent__AllowCreation` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env OfficeAgent__FileSystemConnections__0__ConnectionId=<OfficeAgent__FileSystemConnections__0__ConnectionId> --env OfficeAgent__FileSystemConnections__0__RootPath=<OfficeAgent__FileSystemConnections__0__RootPath> --env OfficeAgent__AllowCreation=<OfficeAgent__AllowCreation> --transport stdio officeagentnet -- docker run -i --rm -e OfficeAgent__FileSystemConnections__0__ConnectionId -e OfficeAgent__FileSystemConnections__0__RootPath -e OfficeAgent__AllowCreation ghcr.io/ilia-sokolov/officeagent-mcp:1.2.0
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add officeagentnet --env OfficeAgent__FileSystemConnections__0__ConnectionId=<OfficeAgent__FileSystemConnections__0__ConnectionId> --env OfficeAgent__FileSystemConnections__0__RootPath=<OfficeAgent__FileSystemConnections__0__RootPath> --env OfficeAgent__AllowCreation=<OfficeAgent__AllowCreation> -- docker run -i --rm -e OfficeAgent__FileSystemConnections__0__ConnectionId -e OfficeAgent__FileSystemConnections__0__RootPath -e OfficeAgent__AllowCreation ghcr.io/ilia-sokolov/officeagent-mcp:1.2.0
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "officeagentnet": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "-e",
                "OfficeAgent__FileSystemConnections__0__ConnectionId",
                "-e",
                "OfficeAgent__FileSystemConnections__0__RootPath",
                "-e",
                "OfficeAgent__AllowCreation",
                "ghcr.io/ilia-sokolov/officeagent-mcp:1.2.0"
            ],
            "env": {
                "OfficeAgent__FileSystemConnections__0__ConnectionId": "<OfficeAgent__FileSystemConnections__0__ConnectionId>",
                "OfficeAgent__FileSystemConnections__0__RootPath": "<OfficeAgent__FileSystemConnections__0__RootPath>",
                "OfficeAgent__AllowCreation": "<OfficeAgent__AllowCreation>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "officeagentnet": {
            "type": "stdio",
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "-e",
                "OfficeAgent__FileSystemConnections__0__ConnectionId",
                "-e",
                "OfficeAgent__FileSystemConnections__0__RootPath",
                "-e",
                "OfficeAgent__AllowCreation",
                "ghcr.io/ilia-sokolov/officeagent-mcp:1.2.0"
            ],
            "env": {
                "OfficeAgent__FileSystemConnections__0__ConnectionId": "<OfficeAgent__FileSystemConnections__0__ConnectionId>",
                "OfficeAgent__FileSystemConnections__0__RootPath": "<OfficeAgent__FileSystemConnections__0__RootPath>",
                "OfficeAgent__AllowCreation": "<OfficeAgent__AllowCreation>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e OfficeAgent__FileSystemConnections__0__ConnectionId=<OfficeAgent__FileSystemConnections__0__ConnectionId> -e OfficeAgent__FileSystemConnections__0__RootPath=<OfficeAgent__FileSystemConnections__0__RootPath> -e OfficeAgent__AllowCreation=<OfficeAgent__AllowCreation> officeagentnet docker run -i --rm -e OfficeAgent__FileSystemConnections__0__ConnectionId -e OfficeAgent__FileSystemConnections__0__RootPath -e OfficeAgent__AllowCreation ghcr.io/ilia-sokolov/officeagent-mcp:1.2.0
```
Replace <…> with your own values

## When to use it
- generate a .docx from a template and data
- record a contract edit as a tracked revision
- append a table row and set a formula in Excel
- read comments and review state from a document
- build a PowerPoint deck with slides and charts

## Example prompts
- Replace clause 4.2 in `contract.docx` as a tracked change
- Append a row to the table on sheet `Q3` in `report.xlsx`
- Build a deck from `outline.md` and save it as `deck.pptx`

## Similar
- [Excel MCP Server](https://affpapa.org/en/nevibecode/mcp/excel-mcp-server.md) — MCP server · ★ 4259
- [kordoc](https://affpapa.org/en/nevibecode/mcp/kordoc.md) — MCP server · ★ 2726
- [Power BI Authoring MCP Server (Local)](https://affpapa.org/en/nevibecode/mcp/power-bi-authoring-mcp-server-local.md) — MCP server · ★ 1247
- [Microsoft 365 MCP Server](https://affpapa.org/en/nevibecode/mcp/microsoft-365-mcp-server.md) — MCP server · ★ 1074
- [anymd](https://affpapa.org/en/nevibecode/mcp/anymd.md) — MCP server · ★ 1051
- [Docling MCP](https://affpapa.org/en/nevibecode/mcp/docling-mcp.md) — MCP server · ★ 777

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
