Office MCP
Uses LibreOffice for portable PDF conversion when native Microsoft Office is unavailable.
Runs the MCP server locally over stdio using Node.js 20 or newer.
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 MCPCreate a two-slide PowerPoint about Q3 results and save it to Documents"
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.
Office MCP
A local-first Model Context Protocol server for Microsoft Excel, Word, and PowerPoint files and applications.
This is an independent open-source project and is not affiliated with or endorsed by Microsoft.
Office MCP gives an orchestrating AI deterministic handles for Microsoft Office. It can work directly with .xlsx, .docx, and .pptx packages on any supported platform, or use the real installed Excel, Word, and PowerPoint applications on Windows for full-fidelity editing, calculation, charts, PivotTables, PDF export, and slide rendering. It runs locally over stdio and requires no API key.
The server does not decide what a report, model, or presentation should say. The model plans the work and calls these tools to inspect inputs, construct the documents, render the result, visually review it, and iterate.
Quick start (Windows PowerShell)
You need Node.js 20+, Git, and an MCP client such as Codex/ChatGPT desktop or Claude Code. Desktop Microsoft Office is optional for basic .xlsx, .docx, and .pptx file creation; it is required for Windows-native features such as animations and PowerPoint rendering. This repository is not yet published on npm.
Download and build the server:
git clone https://github.com/gauravvvvvvvvvv/office-mcp.git Set-Location office-mcp npm ci npm run buildIn the same PowerShell window, choose which files the AI may access and connect one client. This example allows your Documents folder; change
$allowedto a narrower folder if you prefer:$entry = (Resolve-Path .\dist\index.js).Path $allowed = (Resolve-Path ([Environment]::GetFolderPath('MyDocuments'))).PathFor Codex CLI or ChatGPT desktop, run:
codex mcp add office --env "OFFICE_MCP_ROOTS=$allowed" -- node $entry codex mcp listFor Claude Code, run instead:
claude mcp add --scope user --env "OFFICE_MCP_ROOTS=$allowed" --transport stdio office -- node $entry claude mcp get officeRestart an already-open desktop client or start a new chat. Ask: “Call
office_capabilitiesand tell me which Office features are available.” Then try: “Usepowerpoint_create_designed_presentationto create a two-slide presentation in my Documents folder, inspect it, and report the saved path.” The server runs when the client launches it; do not startnode dist/index.jsin a separate terminal.
If you use both clients, run both registration commands. Existing office entries should be checked before re-adding them; codex mcp list and claude mcp get office show what is already configured. The checkout must remain at this path, because the clients launch its compiled dist/index.js. See other platforms and clients or troubleshooting below.
Related MCP server: MCP-OPENAPI-DOCX
Why this server
Hybrid operation: portable Office-file creation and inspection without desktop Office, plus native Windows Office operations when installed.
Prompt-specific quality contracts, file comparisons, render evidence, and a finalization gate that refuses stale or incomplete review.
PowerPoint generation that stays in the background by default; it does not repeatedly steal focus from the user's work.
Bounded filesystem roots, explicit overwrite behavior, and no arbitrary COM execution tool.
These are design choices, not proof that this project is more capable or produces better-looking documents than every alternative. Its 34-tool surface is intentionally bounded; a human-quality result still depends on the orchestrating model, source material, and visual review.
What works
Application | Operations |
Excel | Create and inspect workbooks; read/write/format ranges; descriptive analysis and read-only filtered/grouped queries; formulas and native recalculation; tables, charts, sorting, filters, named ranges, conditional formatting, validation, and PivotTables |
Word | Create and inspect documents; sections and page layout; headers, footers, page numbers, TOC fields, source-backed citation text, headings, lists, tables, images, links, footnotes, replacement, native comments and tracked changes, and PDF export |
PowerPoint | Create, inspect, and audit decks; reuse existing PPTX masters/layouts or duplicate styled slides; text, shapes, images, media, tables, charts, notes; native animation timeline editing, transitions, PDF export, and PNG rendering |
Common | Discover files in directories, list active Office files, inspect and compare supported files, export PDF, run prompt-specific quality checks, prepare render-backed review evidence, and finalize only reviewed drafts |
The server exposes 34 MCP tools:
office_capabilitiesoffice_inspect_fileoffice_search_filesoffice_convert_to_pdfoffice_export_pdfoffice_quality_checkoffice_compare_filesoffice_prepare_reviewoffice_finalizeoffice_get_review_imageexcel_create_workbookexcel_inspect_workbookexcel_read_rangeexcel_analyze_datasetexcel_query_datasetexcel_write_rangeexcel_set_formulasword_create_documentword_inspect_documentword_append_paragraphword_replace_textpowerpoint_create_presentationpowerpoint_create_designed_presentationpowerpoint_inspect_presentationpowerpoint_audit_presentationpowerpoint_inspect_templatepowerpoint_create_from_templatepowerpoint_replace_textoffice_native_statusoffice_list_open_filesexcel_native_batchword_native_batchpowerpoint_native_batchpowerpoint_render_presentation
Requirements
Node.js 20 or newer
Microsoft Office on Windows for native automation, active-document control, and PowerPoint rendering
LibreOffice only for portable PDF conversion when native Office is unavailable
Microsoft Office does not need to be installed for the portable file operations.
Platform compatibility
Platform | Portable | Native Office automation and animations | PDF / visual review |
Windows | Supported with Node.js | Requires installed desktop Microsoft Office | PowerPoint slide PNGs require desktop PowerPoint; PDF export can use Office or LibreOffice |
macOS and Linux | Designed to work with Node.js; verify in your environment | Not supported by the Windows COM bridge | PDF conversion needs LibreOffice; PowerPoint slide PNG review is unavailable |
The portable path edits document files, whether or not they are open in an Office application. It does not control an open Office window. Only Windows native automation can operate on the active document, add PowerPoint animations, use Excel's calculation engine, or render slides through PowerPoint. This is a local stdio server, not a hosted service: its client must be able to launch the Node.js process and access the allowed files.
Verify a development checkout
These commands are for contributors and maintainers, not required to install the server:
npm run check
npm run smokenpm run check type-checks, runs the portable integration tests, and builds dist/. npm run smoke launches the compiled server through an MCP client and creates a test deck. On Windows with desktop Microsoft Office installed, npm run test:native additionally tests native Excel, Word, and PowerPoint behavior. Do not run that native test on a machine without Office.
One-prompt workflow
For a request such as “analyze the financial workbook in this folder and create a board presentation,” an orchestrator can:
Call
office_search_filesto discover workbooks and templates.Call
office_inspect_fileorexcel_native_batchto understand data, formulas, and workbook structure.Call
excel_analyze_datasetfor deterministic data-quality statistics andexcel_query_datasetfor focused filters, group-by summaries, and sorting; then reason about the business question and plan the story.Call
powerpoint_create_designed_presentationfor a new narrative deck,powerpoint_create_presentationfor a custom layout, orpowerpoint_inspect_templatefollowed bypowerpoint_create_from_templateto preserve a company deck's layouts.If motion is requested, call
powerpoint_native_batchto add object animations and slide transitions, then save and reopen to inspect the timeline.Define a quality contract from the actual prompt, including required text, structure, numerical assertions, and—when editing—an optional baseline source file. Call
office_quality_check; repair blocking issues.Call
office_prepare_reviewto render every slide or export a Word/Excel PDF, and inspect the result. For a long deck, request slides beyond the inline preview withoffice_get_review_image.Visually critique alignment, overflow, hierarchy, and chart readability; apply corrections and rerun the check and render. PNG renders cannot demonstrate motion.
Call
office_finalizewith honest pass/fail notes for every slide, sheet, or document and every prompt criterion. It verifies the draft, contract, baseline, render evidence, and review coverage again, then copies to a separate final file without overwriting.
This is the intended separation: the AI supplies judgment; Office MCP supplies reliable handles.
Quality gate and honest limits
office_quality_check validates ZIP package relationships, checks explicit prompt assertions, and returns the draft's SHA-256 hash and review units. It can check Excel sheets, headers, exact cells, and formula errors; Word headings, tables, and image descriptions; and PowerPoint slide counts, minimum font sizes, speaker notes, and structural audit flags. A baseline.path compares an edited file to its source and blocks removed sheets, slides, or Word paragraphs by default. Contract thresholds can explicitly permit intended removal or bound changed Excel cells. office_compare_files returns the detailed semantic difference independently of finalization.
office_prepare_review creates hashed slide PNGs or a PDF and a manifest tied to the exact draft, contract, and baseline. office_finalize refuses failed machine checks, a stale or incomplete render, a changed draft, unreviewed units, failed criteria, or unaccepted warnings. The server cannot determine whether a claim is true, whether a chart tells the right story, whether a design is beautiful, or whether a reviewer genuinely inspected the output. The orchestrator must use the visual evidence and source data honestly; don't mark a criterion passed if it was not checked. Native rendering and PDF export need installed Office or LibreOffice, and PowerPoint slide PNG review specifically needs desktop PowerPoint on Windows.
Quiet background generation
Portable PPTX creation edits files directly and never opens PowerPoint. Native file-based PowerPoint operations now create or open presentations with hidden windows by default, including rendering, animation edits, and PDF export. They do not repeatedly bring a deck to the foreground.
PowerPoint automation uses a shared application instance on Windows. To avoid altering or closing a presentation the user is actively working in, the server refuses file-based native work while PowerPoint is already running. The agent should continue with portable creation and defer native rendering or animation work until PowerPoint is closed. target.active: true explicitly opts into the running session, and target.visible: true requests a visible window; neither should be used without the user's consent. Native rendering does not expose an active-session override.
Improving presentation quality
powerpoint_create_designed_presentation provides five widescreen compositions (cover, imageText, statement, comparison, panorama) and two visual styles (editorial, cinematic). panorama pairs a wide scene with an editable title and supporting copy; comparison accepts an optional takeaway to state the conclusion. It uses readable typography and crops supplied images to their frames. Supply relevant, distinct image assets when they help the story; the tool does not generate images or invent content. The lower-level PowerPoint tool remains available for charts, tables, and exact placement. Its image elements support fit: "cover", "contain", or "stretch".
The optional companion Codex skill lives at skills/office-presentation-quality/SKILL.md. Install that folder into your Codex skills directory to guide the agent through planning, render review, and revision. This skill improves the workflow; it cannot guarantee visual taste or replace a good reference deck. To use the updated server and skill in an existing Codex session, restart that session after rebuilding dist/.
powerpoint_audit_presentation works directly on any PPTX without opening Office. It reports off-slide objects, small explicitly sized text, unusually dense slides, pictures without meaningful alt text, low contrast where both colors are explicit solids, overlapping text boxes, empty slides, and grouped objects it cannot measure reliably. These are review flags, not proof of poor design. The creation tools accept image alt text (altText for custom images, imageAltText for designed layouts); without it, they use a reviewable placeholder rather than leaking a local image path into the deck.
Reusing a PowerPoint template
powerpoint_inspect_template opens an existing .pptx invisibly through desktop PowerPoint and reports its designs, custom layouts, placeholder indexes, and slide shape names. powerpoint_create_from_template can then add slides from those layouts or duplicate existing slides, fill placeholders or named text shapes, add text boxes, and save a separate .pptx. It keeps the source deck untouched and removes its original slides from the output unless keepTemplateSlides is true. Coordinates for new native text boxes are points. This requires Windows desktop PowerPoint and is subject to the quiet-background rule above; it does not import .potx files or offer arbitrary master editing yet.
Word structure and Excel analysis
word_create_document accepts either the original blocks array or a sections array with separate page size/orientation, margins, headers, footers, and page numbers. Blocks can include an updateable toc, a cited_paragraph referring to user-supplied sources, a bibliography, images with required alt text or an explicit decorative flag, hyperlinks, page breaks, and footnotes. Word fills the TOC entries when it updates the field. Citations are formatted document text, not entries in Word's built-in citation manager. Native Word batches can apply styles, insert sections, generate or refresh TOCs, and add comments to an existing document.
excel_analyze_dataset profiles a sheet or selected range for missing and duplicate rows, column types, descriptive numeric statistics, IQR outliers, top text values, dates, formula/error counts, and strongest Pearson correlations. It analyzes at most 50,000 rows and 100 columns per call. It does not clean the data, infer causation, run statistical tests, or calculate uncached formulas; use native Excel recalculation first when formula results matter.
excel_query_dataset reads up to 50,000 rows and 100 columns, applies typed filters, optionally groups and aggregates (count, countDistinct, sum, average, min, max), sorts, and returns at most 1,000 rows. It never writes back. Native Excel batches can define names, add conditional formatting, and set data validation.
Animations and transitions
On Windows with installed desktop PowerPoint, powerpoint_native_batch can apply object entrance (appear, fade, fly, wipe, zoom), emphasis (spin, growShrink), and exit (fade, fly, wipe, zoom) effects. Triggers are onClick, withPrevious, and afterPrevious; duration and delay use seconds. Call list_shapes to get a shape's name or 1-based index before add_animation. list_animations, update_animation, move_animation, delete_animation, and clear_animations support timeline inspection and revision, including repeat and reverse settings. add_media embeds a local audio or video asset. set_transition supports none, cut, fade, left/right push and wipe, and zoom-in, with optional timed advance. Include a save operation and reopen the result to verify persistence.
This is an expanding, validated Office capability set, not a wrapper around every Office command. Arbitrary COM execution is intentionally not exposed. Animation playback itself is not captured by the static PNG renderer.
Other platforms and clients
The quick start is the shortest route for Windows. The same built server works with any local stdio MCP client that can launch Node.js. Client configuration is separate: adding Office MCP to Codex does not automatically add it to Claude Code.
Codex and ChatGPT desktop
The codex mcp add command in the quick start writes Codex's user configuration, which the ChatGPT desktop app, Codex CLI, and Codex IDE extension share. In ChatGPT desktop, restart after adding the server and type /mcp to inspect it. You can also add it through Settings → MCP servers → Add server → STDIO. ChatGPT web does not read local Codex configuration; this repository does not provide a hosted MCP endpoint. See OpenAI's MCP guide.
Claude Code
The quick start uses Claude Code's user scope, so the server is available in all your local projects. Run claude mcp list or use /mcp inside Claude Code to check its connection. See Claude Code's MCP setup guide.
macOS or Linux
Portable .xlsx, .docx, and .pptx tools are designed for Node.js on these platforms, but this project's native Office bridge and PowerPoint PNG rendering are Windows-only. After cloning and running npm ci and npm run build, run the following from the repository root in a Bash-compatible shell; choose one client command:
entry="$(pwd -P)/dist/index.js"
allowed="$(pwd -P)" # Change to a directory containing the documents you want to use.
codex mcp add office --env "OFFICE_MCP_ROOTS=$allowed" -- node "$entry"
# Or: claude mcp add --scope user --env "OFFICE_MCP_ROOTS=$allowed" --transport stdio office -- node "$entry"The default example grants access only to the repository. Set allowed to an absolute documents directory if your files live elsewhere. Restart the client, check its MCP connection, and call office_capabilities.
Other local MCP clients
Configure a stdio server with node as the command, the absolute path to dist/index.js as its argument, and OFFICE_MCP_ROOTS as an environment variable. For example, adapt this JSON to your client's format (the paths shown are placeholders):
{
"command": "node",
"args": ["C:\\absolute\\path\\to\\office-mcp\\dist\\index.js"],
"env": { "OFFICE_MCP_ROOTS": "C:\\allowed\\documents" }
}Installation troubleshooting
Symptom | Check |
| Install Node.js 20+ and open a new terminal; run |
| Install the corresponding client CLI, or use that client's graphical MCP settings. |
Client says the server cannot start | Run |
| Inspect the existing entry with |
A file is rejected as outside allowed roots | Set |
Native animations, Excel recalculation, or PowerPoint rendering are unavailable | These require Windows and installed desktop Microsoft Office. Start by calling |
ChatGPT web cannot see the server | Web chats do not load local stdio MCP configuration; use ChatGPT desktop/Codex or build a separately hosted integration. |
Path security
By default, the server may only access files below its working directory. Set OFFICE_MCP_ROOTS to one or more allowed roots.
On Windows, separate multiple roots with a semicolon:
C:\Users\your-name\Documents;D:\Company FilesOn macOS and Linux, separate roots with a colon. The server resolves every input and output path before use and rejects path traversal outside these roots.
PDF conversion
office_convert_to_pdf uses LibreOffice in headless mode. The server checks standard installation locations and the system PATH. For a custom installation, set:
OFFICE_MCP_SOFFICE=C:\path\to\LibreOffice\program\soffice.exeCall office_capabilities to see whether the converter was detected.
Development
npm run devThe process waits silently for MCP messages on standard input. Do not write logs to standard output because stdout carries the MCP protocol. Diagnostics belong on stderr.
Manual releases
This repository has no GitHub Actions workflows or Dependabot configuration. Nothing runs automatically on pushes or pull requests, and pushing a tag does not create a release or publish to npm. It is a local stdio server, not a hosted Office service.
Before making a public release manually, update package.json and the lockfile; run npm run check and npm run smoke; and, on Windows with desktop Office, run npm run test:native. Verify a fresh packaged install and audit the bundled dependencies. Then decide whether to create a GitHub Release and attach the tested package. See CONTRIBUTING.md and SECURITY.md. No npm publication is currently configured.
Project layout:
src/
index.ts MCP tool registration and schemas
office.ts Cross-format inspection and PDF conversion
excel.ts XLSX adapter
word.ts DOCX adapter
powerpoint.ts PPTX adapter
paths.ts Allowed-root enforcement
errors.ts Structured MCP results and errors
native.ts Secure Node-to-native-Office bridge
native/
office-bridge.ps1 Excel, Word, and PowerPoint COM automation
tests/
office.test.ts End-to-end file testsImportant limitations
Native active-document control currently requires Windows and installed desktop Microsoft Office. A future Office.js bridge is required for the same live control on Mac, web, and iPad.
ExcelJS does not support every Excel feature. Re-saving complex workbooks may not preserve unsupported objects such as embedded charts or VBA projects. Prefer a separate
outputPathwhen editing valuable files.Word and PowerPoint replacement can match text split across formatting runs. When a replacement crosses multiple runs, it consolidates the replacement into the first run, so mixed character formatting inside that phrase is not retained.
PowerPoint creation is declarative. Positions and sizes use inches, matching PptxGenJS conventions.
The designed layouts are starting points. Template reuse is available through native PowerPoint but does not import
.potx, edit a master arbitrarily, or automatically judge aesthetics. Inspect renders before delivery.The PPTX audit cannot determine whether text actually fits, whether contrast inherited from a theme or image background is sufficient, or whether the story and aesthetics are strong. Visually inspect rendered slides.
Object animation and slide-transition editing currently requires desktop PowerPoint on Windows. Static slide images verify visual layout, not how effects play during a slideshow.
Background native PowerPoint work can be deferred when PowerPoint is already running. Hidden presentations avoid pop-up windows, but this is not a fully isolated headless PowerPoint service.
Formula values are written but not calculated by Node.js. The workbook is marked for recalculation when opened in Excel.
The server does not offer every command in Microsoft Office, nor does it act as an autonomous design model. Quality still depends on the orchestrating model, source assets, templates, and render review.
Technology
ExcelJS for
.xlsxdocx for document creation
PptxGenJS for presentation creation
JSZip for structure-preserving OOXML inspection and targeted edits
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Create and manage documents, spreadsheets, and presentations from your AI assistant.
Composable APIs for document extraction, image transformation, and document & sheet generation.
Document API for AI-native software: render PDFs, e-sign, PAdES-seal, and verify.
Real Word and Excel for agents: open your .docx/.xlsm, read, propose, apply, get it back intact.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAI-powered Office automation server that enables creating, editing, and processing Word, Excel, and PowerPoint documents through natural language instructions using Python-based libraries.1MIT
- AlicenseNot gradedqualityDmaintenanceEnterprise-grade document editing and management server that enables AI-powered operations on Microsoft Word DOCX files, including creating, editing, formatting, and exporting documents through both MCP protocol and RESTful API.3MIT
- AlicenseNot gradedqualityDmaintenanceEnables creation and editing of Word, Excel, and PowerPoint documents within MCP clients through AI assistants.MIT
- AlicenseBqualityCmaintenanceEnables complete Office document lifecycle management for AI agents, including creation, editing, conversion, and templating of DOCX, XLSX, PPTX, PDF, and EML files.4031 PyPIMIT