# MR Office

> Open-source browser office editors with an AI copilot and an MCP server for agents

- Category: AI Productivity & Writing / Office Documents & Spreadsheets
- Language: TypeScript
- Licence: AGPL-3.0
- Repository: https://github.com/XinaTian/MROffice
- Website: https://mroffice.ai
- Canonical page: https://ai-tldr.dev/tools/mroffice/

## In short

MR Office is an AI office suite for Word, Excel, PowerPoint and PDF files that runs on the web and as a free desktop app. This repository publishes the source of its five editors (Documents, Spreadsheets, Presentations, PDF and Code) as React packages that share a common core. It sits in the Office Documents & Spreadsheets category of the AI Productivity & Writing tools and is open-source, written in TypeScript and licensed AGPL-3.0.

## Overview

MR Office is an AI office suite for Word, Excel, PowerPoint and PDF files that runs on the web and as a free desktop app. This repository publishes the source of its five editors (Documents, Spreadsheets, Presentations, PDF and Code) as React packages that share a common core. You can build and run them in the browser, wrap them in the bundled Electron desktop shell, or embed them in your own product under the AGPL-3.0.

In the hosted product, an AI copilot works inside each editor. You select or circle part of the document and describe the change, and the copilot edits paragraphs, tables, cells, formulas, shapes and slides in place. It previews each change before applying it, and every change can be undone. A proposal is discarded if the file changed in the meantime, so nothing you wrote is overwritten.

The same repository holds an MCP server (`apps/mcp`, published as `mroffice-mcp`). Through it, Claude, ChatGPT, Cursor, Codex, VS Code and other MCP clients can create, open, edit, read back, render and export documents and spreadsheets. Exports cover docx, xlsx, pptx, pdf, md, html and csv.

The split between open and hosted parts matters. On their own, the open-source editors save their own formats (.mrdoc, .mrsheet, .mrslides) and open CSV, HTML, Markdown and PDF. Real Word, Excel and PowerPoint files, the full formula engine, charts, SmartArt and saving PDF edits come with the free desktop app's component or the hosted embed service. The hosted embed has a free tier and paid plans.

## What it does

- Five editors in one repo: a paged word processor, a spreadsheet, a slide editor, a PDF reader with comments, and a code editor with outline and quick open
- An MCP server with `create_document`, `open_document`, `update_document`, `get_document`, `render_page` and `export_document`, run locally via `npx -y mroffice-mcp` or through the hosted endpoint
- An in-editor AI copilot in the hosted product that edits the file's own objects and previews every change before it lands
- Editors published on npm as React components (`mroffice-docs`, `mroffice-sheets`, `mroffice-slides`, `mroffice-pdf`, `mroffice-code` on `mroffice-core`)
- An Electron desktop shell (`apps/desktop`) that runs the open editors on their own, or becomes the full MR Office app with its free component
- A hosted embed SDK (`mroffice-embed`) for opening real .docx, .xlsx, .pptx and .pdf files inside your own web app

## Getting started

There are three ways in, all from the README: give an AI agent the MCP server, run the open-source editors locally, or embed the hosted editors in your app.

1. Add the MCP server to your AI agent

   Register the server with Claude Code or Codex. Clients that take a JSON config use `{ "mcpServers": { "mroffice": { "command": "npx", "args": ["-y", "mroffice-mcp"] } } }`. You can skip the install and connect the hosted endpoint `https://mcp.mroffice.ai/mcp`, signing in with an MR Office account.

```bash
# Claude Code
claude mcp add mroffice -- npx -y mroffice-mcp
# Codex
codex mcp add mroffice -- npx -y mroffice-mcp
```

2. Run the open-source editors locally

   Clone the repository and build the playground app, which runs all five editors together at http://localhost:5178. `npm run fonts` fetches open substitutes for Office's fonts, and `npm run dev` starts a development server at the same address.

```bash
git clone https://github.com/XinaTian/MROffice
cd MROffice
npm install
npm run fonts
npm run build
npm run preview
```

3. Or start the desktop shell

   After a build, the Electron shell in `apps/desktop` runs the same editors as a desktop app. Without the free MR Office component from Releases, it opens .mrdoc, .mrsheet, .mrslides, CSV, HTML, Markdown and PDF files.

```bash
npm run desktop
```

4. Embed the hosted editors in a web app

   `npx mroffice-embed init` creates an app and writes its keys to `.env.local`. Your server then mints a short-lived session token, and the page opens the editor with it.

```js
// server
import { createSessionToken } from "mroffice-embed/server";
const token = await createSessionToken({
  appId: process.env.MROFFICE_APP_ID,
  secretKey: process.env.MROFFICE_SECRET_KEY,
  file: { key: "contract-42", name: "contract.docx", url: signedUrlToTheFile },
  user: { id: user.id, name: user.name },
  mode: "edit",
});

// page
import { open } from "mroffice-embed";
open({ container: "#editor", token: () => fetch("/api/mroffice/session").then((r) => r.json()).then((b) => b.token) });
```

## When to use it

- Let Claude Code or Codex produce a real .docx, .xlsx or .pptx deliverable and export it, instead of handing back Markdown
- Add document, spreadsheet and slide editing to a web app without writing an editor
- Self-host browser-based word-processing, spreadsheet and slide editors under the AGPL in your own product
- Review AI edits to a spreadsheet or deck one change at a time before you accept them
