mroffice-mcp
v0.2.0
Published
MR Office's document, spreadsheet and PDF editors for AI apps: an MCP server whose tools create, open, read, picture and export files, with the real editor shown inline where the host renders MCP Apps -- or, with the MR Office desktop app open, the app's
Maintainers
Readme
MR Office MCP server
Put a real document editor into your AI conversations. The assistant writes a document or spreadsheet, MR Office opens it in its editor, you change it by hand, and the assistant reads your edits back before it goes on.
Add it in one step
Pick your app and paste one line. Nothing else to set up: no API key, no settings. The first time it needs your MR Office account (Word, Excel and PowerPoint files, or the hosted server), your browser opens on MR Office's sign-in page and you click Allow.
Hosted (nothing to install): the server is https://mcp.mroffice.ai/mcp.
| App | One step |
|---|---|
| Claude (claude.ai, Claude Desktop) | Settings › Connectors › Add custom connector, URL https://mcp.mroffice.ai/mcp |
| ChatGPT | Settings › Apps & Connectors › Create (developer mode), URL https://mcp.mroffice.ai/mcp, authentication OAuth |
| Claude Code | claude mcp add --transport http mroffice https://mcp.mroffice.ai/mcp |
| Codex | codex mcp add mroffice --url https://mcp.mroffice.ai/mcp |
| Cursor | Add to Cursor |
| VS Code | Install in VS Code or code --add-mcp '{"name":"mroffice","type":"http","url":"https://mcp.mroffice.ai/mcp"}' |
| Gemini CLI | gemini mcp add -s user -t http mroffice https://mcp.mroffice.ai/mcp |
| opencode | opencode mcp add › Remote, name mroffice, URL https://mcp.mroffice.ai/mcp |
Local (runs on your computer with Node.js 22+; your
documents stay on it): the command is npx -y mroffice-mcp.
| App | One step |
|---|---|
| Claude Code | claude mcp add mroffice -- npx -y mroffice-mcp |
| Codex | codex mcp add mroffice -- npx -y mroffice-mcp |
| Cursor | Add to Cursor |
| VS Code | Install in VS Code |
| Gemini CLI | gemini mcp add -s user mroffice npx -- -y mroffice-mcp |
| opencode | opencode mcp add mroffice --global -- npx -y mroffice-mcp |
| Claude Desktop, Windsurf, Cline, Roo Code, Zed, any other | the JSON entry below in the app's MCP settings |
{ "mcpServers": { "mroffice": { "command": "npx", "args": ["-y", "mroffice-mcp"] } } }Instructions for more apps are below, and on mroffice.ai/developers/mcp.
MR Office as your AI's screen (Codex, Claude Code, Cursor…)
With the MR Office desktop app (0.1.6 or
newer; MRNote Classic 0.1.10 or newer) open on your Mac or PC, the local server above becomes your AI's screen: the AI opens
your own .docx, .xlsx, .pptx and .pdf files in the app's window, and
every edit it makes appears there as it is made — an edit you can undo with
⌘Z / Ctrl+Z, saved back to your file like your own typing. You can type in the
same window meanwhile; the AI reads your changes before it goes on.
Same one line, nothing else to configure:
claude mcp add mroffice -- npx -y mroffice-mcp # Claude Code
codex mcp add mroffice -- npx -y mroffice-mcp # Codex# or Codex's ~/.codex/config.toml
[mcp_servers.mroffice]
command = "npx"
args = ["-y", "mroffice-mcp"]Then ask: "Open ~/Documents/q4-report.docx and tighten the introduction." The first time, MR Office asks whether that AI app may work on your documents (Allow once, Always allow or Don't allow).
When the desktop app runs (or is installed: it is then started in the
background), npx -y mroffice-mcp hands the connection to the app;
otherwise it works as described below. To choose:
npx -y mroffice-mcp --desktop # always the desktop app (starts it when it is not running)
npx -y mroffice-mcp --no-desktop # never the desktop appThe tools against the live window:
| Tool | What it does |
|---|---|
| open_document | Opens a file on your computer by its path in the window (or brings it forward), returns its id and content |
| list_documents | The documents open in the app's windows |
| get_document | The document as it is now, your edits included, with addresses: Word paragraphs and tables by block id, cells by A1 address with formulas, slides and shapes by id, PDF pages; its revision and what you changed since the AI last looked |
| get_selection | What you have selected (text and its paragraph, range and active cell, the slide or page shown) |
| edit_document | Edits through the editor, each one Undo step: the Automation API's word.*, excel.*, powerpoint.* and pdf.* methods (insert and replace text, Markdown, tables; values and formulas; shape text and slides; highlights and comments) |
| get_changes | What you changed since the AI's last read or edit |
| render_page | A picture of the document's window as you see it |
| save_document | Saves to the file now (as ⌘S / Ctrl+S; autosave also writes it) |
| export_document | Another format (PDF, OpenDocument, CSV, Markdown …) next to the original, never over it |
The app's endpoint listens on 127.0.0.1 only, on a port chosen at each
launch, and takes only requests that carry the launch's token, which the app
writes to ai-screen.json in its data folder (readable by your user only,
removed when it quits); web pages and other computers are refused. Settings ›
General in the app lists the AI apps always allowed, removes them, and turns
the endpoint off. More: mroffice.ai/developers/mcp/desktop.
What it does
- Create documents from Markdown and spreadsheets from CSV.
- Open Word, Excel and PowerPoint files (with your MR Office account), and Markdown, HTML, text, CSV/TSV and PDF files (from text, base64 or an https URL).
- Edit together: in apps that render MCP Apps views (Claude, ChatGPT, VS Code, Cursor, Goose) the editor appears inline in the chat and autosaves; everywhere else the tool answers with a link to the same editor in your browser and a picture of the page.
- Read back what you changed (
get_document), picture any page as the editor draws it (render_page), and export as.docx,.xlsx,.pptx(with your account),md,html,csvorpdf.
Hosted or local?
| | Hosted (https://mcp.mroffice.ai/mcp) | Local (npx -y mroffice-mcp) |
|---|---|---|
| Install | nothing | Node.js 22+ |
| Sign-in | your app signs you in to MR Office (OAuth) when you add it | only for Word, Excel and PowerPoint files, the first time you use one |
| Documents | on MR Office's server, visible only to your account, removed 7 days after their last save (export what you keep) | in a folder on your computer |
| Editor links | https://mcp.mroffice.ai/..., open anywhere | http://127.0.0.1:3410/..., open on your computer |
| Apps | apps that connect to remote MCP servers (claude.ai and ChatGPT need it) | apps that start local servers |
Word, Excel and PowerPoint: your MR Office account
.docx, .xlsx and .pptx files are read and written by MR Office's Office
engine, as your own MR Office account (a free account works; conversions use
your plan's normal limits and nothing is stored in your account).
On the hosted server you are already signed in. Locally, the first Office file opens MR Office's sign-in page in your browser by itself; allow it there and ask again. You can also sign in ahead, or check and revoke it, from a terminal:
npx -y mroffice-mcp login # opens the browser; allow the app there
npx -y mroffice-mcp whoami
npx -y mroffice-mcp logout # revokes this computer's accessThe sign-in is OAuth 2.1 with PKCE to mroffice.ai; the server never sees
your password. A local server keeps its tokens in
~/.config/mroffice-mcp/credentials.json, readable only by you. Your
connected apps are listed, and can be disconnected, in MR Office's Settings.
Page pictures
Local pictures (render_page, and the picture apps without views get) use
Google Chrome or Microsoft Edge if one is installed, else
npx playwright-core install chromium-headless-shell. Everything else works
without them.
More apps
Every local entry below runs npx -y mroffice-mcp (--stdio, which older
instructions add, means the same). Where an app also connects to remote
servers, the hosted URL https://mcp.mroffice.ai/mcp works in place of the
command.
Claude Desktop (local)
Settings › Developer › Edit Config, add the JSON entry above to
claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/,
Windows: %APPDATA%\Claude\) and restart Claude. Or use the hosted server as
a connector (Settings › Connectors), as in the table at the top.
ChatGPT
ChatGPT connects only to remote servers. Settings › Apps & Connectors ›
Advanced settings: turn on developer mode; then Create, name MR Office, MCP
server URL https://mcp.mroffice.ai/mcp, authentication OAuth. ChatGPT opens
MR Office's sign-in; allow it, and the tools are there in new chats.
Claude Code
claude mcp add --transport http mroffice https://mcp.mroffice.ai/mcp # hosted; then /mcp to sign in
claude mcp add mroffice -- npx -y mroffice-mcp # localAdd -s user to have it in every project.
Codex
codex mcp add mroffice --url https://mcp.mroffice.ai/mcp # hosted; signs in in the browser
codex mcp add mroffice -- npx -y mroffice-mcp # localIf the browser did not open, codex mcp login mroffice. In ~/.codex/config.toml:
[mcp_servers.mroffice]
url = "https://mcp.mroffice.ai/mcp"
# or, local:
# command = "npx"
# args = ["-y", "mroffice-mcp"]Cursor
The Add to Cursor links at the top, or in ~/.cursor/mcp.json (all
projects) or .cursor/mcp.json (one project):
{ "mcpServers": { "mroffice": { "url": "https://mcp.mroffice.ai/mcp" } } }(local: the JSON entry at the top).
VS Code (GitHub Copilot)
The Install in VS Code links at the top, code --add-mcp, or a workspace
.vscode/mcp.json:
{ "servers": { "mroffice": { "type": "http", "url": "https://mcp.mroffice.ai/mcp" } } }local: { "servers": { "mroffice": { "type": "stdio", "command": "npx", "args": ["-y", "mroffice-mcp"] } } }.
opencode
opencode mcp add mroffice --global -- npx -y mroffice-mcpor in ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"mroffice": { "type": "remote", "url": "https://mcp.mroffice.ai/mcp", "enabled": true }
}
}(local: "mroffice": { "type": "local", "command": ["npx", "-y", "mroffice-mcp"], "enabled": true };
opencode mcp auth mroffice signs in to the hosted server).
Gemini CLI
gemini mcp add -s user -t http mroffice https://mcp.mroffice.ai/mcp # hosted
gemini mcp add -s user mroffice npx -- -y mroffice-mcp # localWindsurf
Settings › Cascade › MCP servers › View raw config (~/.codeium/windsurf/mcp_config.json),
add the JSON entry above, or { "mcpServers": { "mroffice": { "serverUrl": "https://mcp.mroffice.ai/mcp" } } }.
Goose
Add to Goose
or goose configure › Add Extension › Command-line Extension, name
mroffice, command npx -y mroffice-mcp. Goose Desktop shows the editor inline.
Cline
MCP Servers › Configure › Configure MCP Servers, add the JSON entry above to
cline_mcp_settings.json. Cline CLI: cline mcp add mroffice --yes -- npx -y mroffice-mcp.
Roo Code
MCP panel › Edit Global MCP (mcp_settings.json) or Edit Project MCP
(.roo/mcp.json): the JSON entry above.
Continue
In ~/.continue/config.yaml (MCP tools are used in agent mode):
mcpServers:
- name: mroffice
type: stdio
command: npx
args: ["-y", "mroffice-mcp"]Zed
Settings › AI › MCP Servers › Add Server › Add Local Server, or in Zed's
settings file: { "context_servers": { "mroffice": { "command": "npx", "args": ["-y", "mroffice-mcp"], "env": {} } } }.
JetBrains AI Assistant and Junie
AI Assistant: Settings › Tools › AI Assistant › Model Context Protocol (MCP) ›
Add, paste the JSON entry above. Junie: Settings › Tools › Junie › MCP
Settings › Add, or the same entry in ~/.junie/mcp/mcp.json.
Cherry Studio, Chatbox, LobeHub and other apps
Cherry Studio: Settings › MCP › Add, type stdio, command npx, arguments
-y mroffice-mcp (or type Streamable HTTP, URL https://mcp.mroffice.ai/mcp).
Chatbox: Add to Chatbox
or Settings › MCP › Add Server. LobeHub desktop: Settings › Skills › Custom ›
Import JSON config, the JSON entry above. Any other app: the command
npx -y mroffice-mcp, or the URL https://mcp.mroffice.ai/mcp.
The server does not care which model you talk to: DeepSeek, Qwen, Kimi and others work through any app that lets you pick them.
Running your own hosted server
MROFFICE_MCP_LISTEN_HOST=0.0.0.0 \
MROFFICE_MCP_PUBLIC_URL=https://mcp.example.com \
MROFFICE_MCP_DATA_DIR=/var/lib/mroffice-mcp \
MROFFICE_MCP_AUTH=oauth MROFFICE_MCP_RETENTION_DAYS=7 \
npx -y mroffice-mcp --httpbehind an HTTPS proxy; the MCP endpoint is <public url>/mcp. With
MROFFICE_MCP_AUTH=oauth it takes only callers signed in to MR Office: it
publishes its OAuth protected-resource metadata, and each caller's app signs
them in (dynamic registration or a client ID metadata document, PKCE) and
converts as that person; each account sees only its own documents. Each
request's token is checked with MR Office (each answer kept 5 seconds), so an
app the person disconnects in MR Office's settings is refused within 5
seconds. Without it the server has no sign-in of its own: anyone who can
reach the address can use it, so keep it private.
Tools
| Tool | What it does |
|---|---|
| create_document | New document (Markdown) or spreadsheet (CSV), opened in the editor |
| open_document | Open a file given as text, base64 or an https URL |
| update_document | Replace a document's content as a new revision (refused if you edited it since the revision the assistant read) |
| get_document | Read the current content, including your edits: Markdown for documents, CSV per sheet |
| render_page | A PNG of one page as the editor draws it |
| export_document | The document as a file (docx, xlsx, pptx, md, html, csv, pdf ...), with a download link |
| list_documents | The documents created or opened with this server |
| sign_in / sign_out | Sign this computer in to your MR Office account, or out (revoking its access) |
Every tool carries a title and read-only / destructive hints.
Configuration
All optional, as environment variables:
| Variable | Default | Meaning |
|---|---|---|
| MROFFICE_MCP_PORT | 3410 | Port of the local editor pages (and of --http) |
| MROFFICE_MCP_DATA_DIR | <system temp>/mroffice-mcp | Where documents and their revisions are kept |
| MROFFICE_MCP_EDITOR_ORIGIN | https://demo.mroffice.ai | Where the editor's scripts, styles and fonts load from |
| MROFFICE_MCP_PUBLIC_URL | http://127.0.0.1:<port> | The address links point to (set it when serving --http remotely) |
| MROFFICE_MCP_LISTEN_HOST | 127.0.0.1 | The address the HTTP side listens on |
| MROFFICE_MCP_MAX_FILE_BYTES | 20971520 | Largest file a tool accepts |
| MROFFICE_MCP_UI_DOMAIN | – | A stable sandbox domain for the inline view, when an app asks for one |
| MROFFICE_MCP_API_URL | https://mroffice.ai | The MR Office to sign in to and convert with |
| MROFFICE_MCP_ENGINE | account | account (your MR Office account), or none (no Office files) |
| MROFFICE_MCP_CONFIG_DIR | ~/.config/mroffice-mcp | Where the sign-in is kept |
| MROFFICE_MCP_AUTH | none | oauth: a shared --http server that takes only callers signed in to MR Office |
| MROFFICE_MCP_RETENTION_DAYS | – | Remove documents nobody saved for this many days |
| MROFFICE_MCP_MAX_DOCUMENTS_PER_PERSON | 200 | With oauth: the most documents one account keeps (oldest go first) |
| MROFFICE_MCP_RENDER_CONCURRENCY | 2 | Pages the headless editor draws at once |
Set MROFFICE_MCP_DATA_DIR to a folder of your own to keep documents across
restarts. When several apps run the server at once, the first one serves the
editor pages and the others link to it (same port, same folder).
Privacy
The hosted server (https://mcp.mroffice.ai/mcp) keeps the documents your
apps create or open on MR Office's server, readable only through your own
account's sessions and through the editor links the tools give you, and
removes each 7 days after its last save. It converts Office files as your
account, like the local server. Run locally:
- Documents are stored only in
MROFFICE_MCP_DATA_DIRon your machine. - Links to the editor carry a per-document secret and work only on your machine (
127.0.0.1). open_documentwith aurlfetches that https address from your machine; local and private-network addresses are refused.- The editor page loads its code from
https://demo.mroffice.aiand sends your documents nowhere. - Word, Excel and PowerPoint files you open or export are sent to MR Office's
conversion service at
mroffice.ai, as your account, and converted without being stored. Nothing else leaves your machine.
See also MR Office's privacy policy.
About
MR Office (mroffice.ai) is an AI office suite for documents, spreadsheets, presentations and PDFs; MR Note (mr-note.com) is the AI notebook it grew from. Questions and reports: [email protected].
License: AGPL-3.0-only.
