# cmd_op

> cmd_op is an open-source MCP server for files and documents. MCP server letting AI agents create, read and edit Word, Excel and PowerPoint files. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API, Linux, Windows, Self-hosted
- **Repository:** https://github.com/karlmoriaty/office-command-operate
- **MCP Registry name:** io.github.karlmoriaty/cmd_op
- **Categories:** [files and documents](https://ai-powered.com/categories/files-and-documents)
- **Listing updated:** 2026-12-04

## About

Office documents become something an agent can drive through structured JSON instead of fragile scripts. Each element in a file gets a stable path such as a slide or shape address, so an agent can query, set, move or remove content without touching raw XML. Formulas written into spreadsheets are evaluated on write, and pivot tables are aggregated into the file before anyone opens it.

A built-in renderer produces HTML and PNG previews, letting an agent inspect its own output for overflowing text or overlapping shapes and correct it. Template merge fills {{placeholders}} from JSON, so one designed layout can produce many documents. The server runs as a single binary with no Microsoft Office installation required, and it is also reachable through npm.

The project suits developers and teams building document-generation pipelines or agent workflows that need reports, decks or spreadsheets produced and checked without a desktop Office install.

## Features

- **Path-based element access:** Every element has a stable address like /slide[1]/shape[2], so agents navigate documents without handling XML namespaces.
- **Built-in visual preview:** HTML and PNG rendering lets an agent view its own output and fix layout problems without a display.
- **Spreadsheet formula evaluation:** Over 350 Excel functions are computed on write, and pivot tables are aggregated in the file.
- **Template merge:** Placeholders across paragraphs, tables, shapes and headers are replaced from JSON data to fill one layout many times.
- **Atomic batch operations:** Multiple edits apply in one pass that rolls back entirely if any item fails, unless best-effort mode is chosen.
- **Document diff:** Two Word, Excel or PowerPoint files can be compared line by line, with structured JSON output.

## Good for

- Generating standardized reports or invoices from JSON data using a single template
- Letting an AI agent draft and visually check a slide deck before delivery
- Bulk-updating spreadsheet cells or importing CSV data into Excel sheets from a script
- Comparing two versions of a contract or report to list changed paragraphs
- Running Office document creation in CI pipelines or Docker containers without Office installed

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add cmd_op -- npx -y cmd_op
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "cmd_op": {
      "command": "npx",
      "args": [
        "-y",
        "cmd_op"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "cmd_op": {
      "command": "npx",
      "args": [
        "-y",
        "cmd_op"
      ]
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "cmd_op": {
      "command": "npx",
      "args": [
        "-y",
        "cmd_op"
      ]
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "cmd_op": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "cmd_op"
      ]
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add cmd_op -- npx -y cmd_op
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.cmd_op]
command = "npx"
args = ["-y", "cmd_op"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "cmd_op": {
      "command": "npx",
      "args": [
        "-y",
        "cmd_op"
      ]
    }
  }
}
```

Or run: gemini mcp add -s user cmd_op npx -- -y cmd_op

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "cmd_op": {
      "command": "npx",
      "args": [
        "-y",
        "cmd_op"
      ]
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "cmd_op": {
      "command": "npx",
      "args": [
        "-y",
        "cmd_op"
      ]
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "cmd_op": {
      "command": "npx",
      "args": [
        "-y",
        "cmd_op"
      ]
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "cmd_op": {
      "command": "npx",
      "args": [
        "-y",
        "cmd_op"
      ]
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "cmd_op": {
      "command": "npx",
      "args": [
        "-y",
        "cmd_op"
      ]
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "cmd_op": {
      "command": "npx",
      "args": [
        "-y",
        "cmd_op"
      ]
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "cmd_op": {
      "command": "npx",
      "args": [
        "-y",
        "cmd_op"
      ]
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "cmd_op": {
      "command": "npx",
      "args": [
        "-y",
        "cmd_op"
      ]
    }
  }
}
```

## FAQ

### Does cmd_op need Microsoft Office installed?

No. The project states that it runs headless on Linux and Windows without Microsoft Office or Python.

### How can an MCP client connect to cmd_op?

Start the server with the mcp command, or point the client at the npm package using npx with the cmd_op mcp arguments.

### What license is cmd_op released under?

The project is licensed under Apache License 2.0.

### Which file formats are supported?

Word (.docx), Excel (.xlsx) and PowerPoint (.pptx).

### Is cmd_op free?

Yes. cmd_op is open source, so you can use and self-host it for free.

### How do I add cmd_op to Claude Code?

Run this command in your terminal: claude mcp add cmd_op -- npx -y cmd_op

### What are the best alternatives to cmd_op?

The closest alternatives to cmd_op are OfficeCTRL, Office MCP, Office files, Word AI and Documentero.

## Where this comes from

- Description: written from the project's README and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [OfficeCTRL](https://ai-powered.com/mcp/officectrl): OfficeCTRL is an open-source MCP server for files and documents.
- [Office MCP](https://ai-powered.com/mcp/office-mcp): Office MCP is an open-source MCP server for files and documents.
- [Office files](https://ai-powered.com/mcp/office-files): Office files is an open-source MCP server for files and documents.
- [Word AI](https://ai-powered.com/mcp/word-ai): Word AI is an open-source MCP server for files and documents.
- [Documentero](https://ai-powered.com/mcp/documentero): Documentero is a freemium MCP server for files and documents.
- [docmcp — Word & Excel files](https://ai-powered.com/mcp/docmcp-word-and-excel-files): docmcp — Word & Excel files is a freemium MCP server for files and documents.
- [8sheets](https://ai-powered.com/mcp/8sheets): 8sheets is a paid MCP server for files and documents.
- [API Keg — Office OOXML Template Merge & Markdown Extractor](https://ai-powered.com/mcp/api-keg-office-ooxml-template-merge-and-markdown-extractor): API Keg — Office OOXML Template Merge & Markdown Extractor is a paid MCP server for files and documents.

---
Source: https://ai-powered.com/mcp/cmd-op
