office-gateway
Uses headless LibreOffice to recalculate dynamic Excel formulas, then checks for runtime errors such as #DIV/0! and #N/A.
Provides Markdown-to-Word and Word-to-Markdown conversion via Pandoc.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@office-gatewayUpdate Q3 totals in budget.xlsx and recalc the formulas"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Build-Office-Gateway
One MCP door for Word, Excel, PowerPoint — and a PDF parser switchboard.
office-gateway is a Python MCP server built on one idea: an AI agent should
never open an Office file itself. It asks the door; the door picks the hand.
The hands behind the door
Job | Hand |
Light reads and edits on Word / Excel / PPT | officecli (external binary) |
Complex Excel edits | the zero-loss XML engine ( |
Excel risk pre-check | formula-impact analysis before any write; writes that would clobber complex structures are intercepted and the agent is told to run |
Dynamic formula recalculation | LibreOffice headless ( |
PPTX generation | an external html2pptx Node.js engine ( |
DOCX generation / templating | a C# OpenXML engine ( |
Markdown ↔ Word conversion | Pandoc |
PDF parsing | three strategies: MinerU (academic deep: two-column papers, formulas → LaTeX), MarkItDown (OCR / visual pages), PyMuPDF (fast plain text) |
Related MCP server: pharos-ai-doc-genie
Safety gates
Every path must resolve inside
OFFICE_GATEWAY_WORKSPACE_ROOT; segments like.git,.venv,node_modules,Trashare refused outright.Excel writes run a pre-check first; if the workbook cannot be safely analysed, the write is blocked — fail closed.
Install
pip install .
# then point your MCP client at:
python server.pyExternal tools used when the corresponding action is requested: officecli,
pandoc, magic-pdf (MinerU), LibreOffice, the .NET SDK, Node.js.
Configuration (environment variables)
Variable | Default | Purpose |
|
| the only directory tree the gateway will touch |
|
| path to the officecli binary |
|
| shared LibreOffice profile (lets headless runs hand off to an always-on listener) |
Notes
Every account, key and password in the published sources is a mock. Real credentials never leave the machine.
The engines are pluggable on purpose: the door and the safety rules are the contribution here, and each hand can be swapped without touching the router.
Licence
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Create, review and edit Word, PowerPoint, Excel and PDF documents from any AI agent.
An agent-first office suite Claude & ChatGPT read and write over one MCP URL.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables complete Office document lifecycle management for AI agents, including creation, editing, conversion, and templating of DOCX, XLSX, PPTX, PDF, and EML files.4065 PyPIMIT
- AlicenseAqualityDmaintenanceEnables AI agents to generate real Office documents (.pptx, .docx, .xlsx) and source code from natural language via MCP protocol.4MIT
- AlicenseNot gradedqualityDmaintenanceProvides a unified interface for AI agents and scripts to read, create, and edit office documents (.docx, .xlsx, .pdf) via MCP tools, using Markdown as the intermediary format. Supports in-place patching with stable IDs, Jinja2 templating, and formatting preservation.1MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to create and process office documents locally, including generating branded PDF, Word, Excel, and editable PowerPoint files from templates and themes, plus reading, OCR, form-filling, manipulation, and conversion of PDFs.1MIT