Open Workbook
Local-first MCP runtime for fast, reversible, template-aware Excel automation, enabling agents to manipulate live Excel workbooks with safety features like snapshots and rollbacks.
README
Open Workbook
Open Workbook is a local-first MCP runtime for fast, reversible, template-aware Excel automation. It connects MCP clients such as OpenCode to live desktop Excel workbooks through an Office.js add-in and a local TypeScript backend, so teams can use OpenRouter or any MCP-capable agent without being locked into one frontier model vendor.
Why
Daily spreadsheet work usually does not need the largest model available, but it does need reliable workbook handling. Open Workbook focuses on the parts generic agents often break:
- preserving templates, headers, formulas, filters, tables, print layout, and styling
- batching reads and writes through Office.js instead of slow per-cell automation
- creating backups and rollback paths before changing workbooks
- keeping workbook data local unless a user explicitly sends it elsewhere
- exposing clear capability status for unsupported or host-limited Excel operations
Current Status
The project is publishable for local development, MCP integration, and sideloaded desktop Excel testing on macOS and Windows. It is not a Microsoft AppSource add-in and does not attempt to install itself into Excel without user or admin trust approval.
Stable areas include runtime connection, workbook/sheet/range operations, reversible batches, snapshots, rollback, templates, style fidelity, formula patterns, tables, filters, sorting, named ranges, regions, validation, repair, cleaning, PivotTables, charts, permissions, packaging, and OpenCode config generation. Some advanced Office.js-limited paths return explicit capability-unavailable results instead of pretending to work.
Architecture
MCP client / agent
|
v
apps/mcp-server -- stdio MCP server
|
v
apps/backend -- local WebSocket broker, plans, backups, snapshots
|
v
apps/excel-addin -- Office.js taskpane loaded by desktop Excel
|
v
Excel workbook
Shared packages:
packages/protocol: tool catalog, JSON-RPC contracts, resources, prompts, errors, and workbook typespackages/excel-core: range parsing, planning, backups, snapshots, templates, permissions, fingerprints, and diffspackages/office-js-engine: Office.js execution interface and defaultspackages/cli:owbCLI for running MCP, serving the add-in, generating manifests, sideloading, and diagnostics
Requirements
- Node.js
>=20.11 - pnpm through Corepack
- Desktop Microsoft Excel on macOS or Windows
- An MCP client such as OpenCode
- Network access only for installing packages or using whichever model provider your MCP client calls
Install From Source
git clone https://github.com/open-workbook/open-workbook.git
cd open-workbook
corepack pnpm install
corepack pnpm build
node packages/cli/dist/index.js doctor
Run the MCP server:
node packages/cli/dist/index.js mcp
Serve the Excel add-in assets in a separate terminal:
node packages/cli/dist/index.js addin serve
Generate OpenCode config:
node packages/cli/dist/index.js opencode config --id open-workbook --command "node packages/cli/dist/index.js"
For an installed package, the same commands become:
owb doctor
owb mcp
owb addin serve
owb opencode config --id open-workbook
Sideload Excel Add-in
macOS:
owb sideload mac
Windows:
owb sideload windows --out open-workbook.xml
Windows Excel uses a trusted shared-folder add-in catalog. Create a folder, share it, copy the generated manifest into that shared folder, add the UNC path in Excel Trust Center, select Show in Menu, restart Excel, and insert the add-in from Shared Folder.
More detail is in Local Excel Add-in Sideloading.
Runtime URLs
Defaults:
- Add-in taskpane:
http://127.0.0.1:37846/taskpane.html - Add-in backend:
ws://127.0.0.1:37845/addin
Environment overrides:
OPEN_WORKBOOK_ADDIN_HOSTOPEN_WORKBOOK_ADDIN_PORTOPEN_WORKBOOK_ADDIN_URLOPEN_WORKBOOK_HOSTOPEN_WORKBOOK_PORTOPEN_WORKBOOK_ADDIN_PATHOPEN_WORKBOOK_BACKUP_DIROPEN_WORKBOOK_PREVIEW_TOOLS=1
Common Commands
corepack pnpm check
corepack pnpm test
corepack pnpm build
node packages/cli/dist/index.js paths
node packages/cli/dist/index.js sideload manifest --out open-workbook.xml
Safety Contract
Mutating operations should follow the same lifecycle:
- Resolve workbook, sheet, and range targets.
- Validate permissions, locked regions, and destructive-action policy.
- Capture affected-region snapshots.
- Create backups for rollback.
- Compile writes into batch operations.
- Check target fingerprints immediately before apply.
- Apply through Office.js.
- Validate template, style, formula, table, filter, and layout invariants where requested.
- Return telemetry, warnings, diff summaries, and rollback IDs.
- Roll back through stored snapshots when requested or when repair workflows fail validation.
Documentation
- Installation
- Architecture
- Tool Surface
- Backup Lifecycle
- Template System
- Style Fidelity
- Formula Intelligence
- Tables, Filters, and Sorts
- Names and Regions
- PivotTables and Charts
- Advanced Range Reads
- Validation and Repair
- Permissions and Cleaning
- Workbook File Lifecycle
- Performance Contract
- OpenCode Configuration
- Packaging and Publishing
- Sideloading
- Roadmap
Contributing
See CONTRIBUTING.md. The most important rule is that write tools must not bypass planning, snapshots, permission checks, and rollback-aware batches.
Security
Open Workbook handles sensitive spreadsheet data. See SECURITY.md. Workbook content stays local by default; integrations that send data to external services must be explicit and documented.
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.