Microsoft Office — Claude Code MCP server: how to install
Enables AI to inspect and modify open Word documents, Excel workbooks, and PowerPoint decks on macOS or Windows via a local add-in sidecar.
claude mcp add --env MCP_OFFICE_SIDECAR_STATE=<MCP_OFFICE_SIDECAR_STATE> --env MCP_OFFICE_SIDECAR_DISABLE=<MCP_OFFICE_SIDECAR_DISABLE> --env REBEL_DISABLE_OFFICE_SIDECAR=<REBEL_DISABLE_OFFICE_SIDECAR> --env MCP_OFFICE_SIDECAR_STATE_DIR=<MCP_OFFICE_SIDECAR_STATE_DIR> --env MCP_OFFICE_ADDIN_DIR=<MCP_OFFICE_ADDIN_DIR> --transport stdio office -- npx -y @mindstone/mcp-server-officeWhat Microsoft Office does
The package connects your assistant to desktop Microsoft 365 applications on your computer. Instead of syncing through cloud APIs, it modifies documents currently open. Everything ships in one npm package: the stdio server, a sidecar helper, and the add-in.
It provides 62 tools. The assistant can inspect document structure in Word or insert Excel formulas. Managing connections is handled by setup and status tools.
Running the server requires Node.js 20+ and desktop Office. Without setting the required MCP_OFFICE_SIDECAR_STATE environment variable to a valid JSON file path, the stdio process fails to communicate. Windows users also need to accept an admin prompt once for the local certificate.
What it helps with
- fill formulas and format cell ranges in active Excel workbooks
- read headings and selected text in open Word documents
- inspect and update PowerPoint presentations locally
- edit desktop Microsoft 365 files without routing data through cloud APIs
Example prompts for the agent
- Fill column D with formulas multiplying columns B and C in my active Excel sheet.
- Read the outline and current selection of the open Word document.
- Check if desktop Office apps are connected using
rebel_office_status.
How to install Microsoft Office
Platform CLI
claude mcp add --env MCP_OFFICE_SIDECAR_STATE=<MCP_OFFICE_SIDECAR_STATE> --env MCP_OFFICE_SIDECAR_DISABLE=<MCP_OFFICE_SIDECAR_DISABLE> --env REBEL_DISABLE_OFFICE_SIDECAR=<REBEL_DISABLE_OFFICE_SIDECAR> --env MCP_OFFICE_SIDECAR_STATE_DIR=<MCP_OFFICE_SIDECAR_STATE_DIR> --env MCP_OFFICE_ADDIN_DIR=<MCP_OFFICE_ADDIN_DIR> --transport stdio office -- npx -y @mindstone/mcp-server-officeReplace <…> with your own values
Platform CLI
codex mcp add office --env MCP_OFFICE_SIDECAR_STATE=<MCP_OFFICE_SIDECAR_STATE> --env MCP_OFFICE_SIDECAR_DISABLE=<MCP_OFFICE_SIDECAR_DISABLE> --env REBEL_DISABLE_OFFICE_SIDECAR=<REBEL_DISABLE_OFFICE_SIDECAR> --env MCP_OFFICE_SIDECAR_STATE_DIR=<MCP_OFFICE_SIDECAR_STATE_DIR> --env MCP_OFFICE_ADDIN_DIR=<MCP_OFFICE_ADDIN_DIR> -- npx -y @mindstone/mcp-server-officeReplace <…> with your own values
Config file
{
"mcpServers": {
"office": {
"command": "npx",
"args": [
"-y",
"@mindstone/mcp-server-office"
],
"env": {
"MCP_OFFICE_SIDECAR_STATE": "<MCP_OFFICE_SIDECAR_STATE>",
"MCP_OFFICE_SIDECAR_DISABLE": "<MCP_OFFICE_SIDECAR_DISABLE>",
"REBEL_DISABLE_OFFICE_SIDECAR": "<REBEL_DISABLE_OFFICE_SIDECAR>",
"MCP_OFFICE_SIDECAR_STATE_DIR": "<MCP_OFFICE_SIDECAR_STATE_DIR>",
"MCP_OFFICE_ADDIN_DIR": "<MCP_OFFICE_ADDIN_DIR>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"office": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@mindstone/mcp-server-office"
],
"env": {
"MCP_OFFICE_SIDECAR_STATE": "<MCP_OFFICE_SIDECAR_STATE>",
"MCP_OFFICE_SIDECAR_DISABLE": "<MCP_OFFICE_SIDECAR_DISABLE>",
"REBEL_DISABLE_OFFICE_SIDECAR": "<REBEL_DISABLE_OFFICE_SIDECAR>",
"MCP_OFFICE_SIDECAR_STATE_DIR": "<MCP_OFFICE_SIDECAR_STATE_DIR>",
"MCP_OFFICE_ADDIN_DIR": "<MCP_OFFICE_ADDIN_DIR>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e MCP_OFFICE_SIDECAR_STATE=<MCP_OFFICE_SIDECAR_STATE> -e MCP_OFFICE_SIDECAR_DISABLE=<MCP_OFFICE_SIDECAR_DISABLE> -e REBEL_DISABLE_OFFICE_SIDECAR=<REBEL_DISABLE_OFFICE_SIDECAR> -e MCP_OFFICE_SIDECAR_STATE_DIR=<MCP_OFFICE_SIDECAR_STATE_DIR> -e MCP_OFFICE_ADDIN_DIR=<MCP_OFFICE_ADDIN_DIR> office npx -y @mindstone/mcp-server-officeReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Microsoft Office
How to install Microsoft Office in Claude Code?
Run claude mcp add mcp-server-office -e MCP_OFFICE_SIDECAR_STATE=<MCP_OFFICE_SIDECAR_STATE> -- npx -y @mindstone/mcp-server-office. Replace <MCP_OFFICE_SIDECAR_STATE> with the absolute path to your sidecar state JSON file.
What does the Microsoft Office MCP server do?
It gives AI assistants 62 tools to read and edit active Word documents, Excel sheets, and PowerPoint decks inside desktop Microsoft 365 on macOS and Windows.
Why is the MCP_OFFICE_SIDECAR_STATE variable required?
It specifies the path to the sidecar state file. The MCP server reads the port and token from this JSON file to talk to the local Office add-in.