@developer.k/ms-office-mcp
v1.0.0
Published
MCP server for local Microsoft Office files and active desktop Office documents
Maintainers
Readme
MS Office MCP
@developer.k/ms-office-mcp is an MCP server for working with Microsoft Office documents from an MCP client.
It supports two workflows:
- File-based operations for
.xlsx,.docx, and.pptxfiles. - Active desktop Office automation for documents already open in Excel, Word, or PowerPoint on Windows.
The server communicates over stdio and is designed to be launched by MCP clients such as Claude Desktop, Cursor, or other MCP-compatible tools.
Requirements
- Node.js 20 or later.
- Microsoft Office desktop apps for active-document tools.
- Windows PowerShell and Office COM automation for tools that read or edit currently open Office documents.
File-based tools can run anywhere Node.js can access the target files. Active Excel, Word, and PowerPoint tools require a Windows desktop session with the corresponding Office app already running.
Usage with MCP Clients
Using npx
Add this server to your MCP client configuration:
{
"mcpServers": {
"ms-office-mcp": {
"command": "npx",
"args": ["-y", "-p", "@developer.k/ms-office-mcp", "ms-office-mcp"]
}
}
}No environment variables are required.
Local Development
npm install
npm run build
npm startFor TypeScript development:
npm run devTools
File-Based Tools
| Tool | Office app | Purpose | Key inputs |
| --- | --- | --- | --- |
| list_sheets | Excel | List worksheet names in an .xlsx file. | path |
| read_excel | Excel | Read rows from a sheet as JSON objects. | path, optional sheetName |
| write_excel | Excel | Create or overwrite a sheet from object rows. | path, sheetName, data |
| read_word | Word | Extract raw text from a .docx file. | path |
| write_word | Word | Create a .docx file with optional title and text content. | path, optional title, content |
| read_pptx | PowerPoint | Extract text from a .pptx file. | path |
| write_pptx | PowerPoint | Create a .pptx file from slide title/content pairs. | path, slides |
Active Office Tools
Active Office tools connect to an already-running Office desktop application. They operate on the open document but do not automatically save it.
Use the filename argument when multiple documents are open. If omitted, the active document is used.
| Tool | Office app | Purpose | Key inputs |
| --- | --- | --- | --- |
| list_active_excel | Excel | List open Excel workbooks. | none |
| get_active_excel | Excel | Read the active sheet from an open workbook. | optional filename |
| write_active_excel | Excel | Write object rows into the active sheet of an open workbook. | optional filename, data |
| list_active_word | Word | List open Word documents. | none |
| get_active_word | Word | Read text from an open Word document. | optional filename |
| write_active_word | Word | Edit an open Word document. | optional filename, operation, text, optional findText, optional replaceAllMatches |
| list_active_pptx | PowerPoint | List open PowerPoint presentations. | none |
| get_active_pptx | PowerPoint | Read slide text from an open presentation. | optional filename |
| write_active_pptx | PowerPoint | Edit slide-level text in an open presentation. | optional filename, operation, optional slideIndex, optional title, text, optional findText, optional replaceAllMatches |
| inspect_active_pptx | PowerPoint | Inspect slides and shapes, including IDs, names, types, positions, sizes, text, and basic colors. | optional filename, optional slideIndex |
| edit_active_pptx_object | PowerPoint | Edit a specific shape without selecting it in the UI. | optional filename, slideIndex, shapeId or shapeName, operation |
Supported Operations
| Tool | Operations |
| --- | --- |
| write_active_word | append, replace_text, replace_all |
| write_active_pptx | add_slide, replace_text, replace_slide_text |
| edit_active_pptx_object | set_text, set_position, set_size, set_fill_color, set_line_color, delete |
Common Input Examples
Read a specific Excel sheet:
{
"path": "C:\\Documents\\report.xlsx",
"sheetName": "Sheet1"
}Replace text in an open Word document:
{
"filename": "Document1.docx",
"operation": "replace_text",
"findText": "old phrase",
"text": "new phrase",
"replaceAllMatches": true
}Edit a PowerPoint shape:
{
"filename": "Presentation1.pptx",
"slideIndex": 2,
"shapeId": 5,
"operation": "set_fill_color",
"color": "#FFAA00"
}Example Workflow
- Ask the MCP client to inspect slide 3 with
inspect_active_pptx. - Pick the returned shape ID for the object you want to modify.
- Call
edit_active_pptx_objectwith that shape ID. - Review the open PowerPoint window.
- Save manually if the result is correct.
Prompt Examples
These are examples of prompts you can type into an MCP client after this server is configured.
Excel
Read the Excel file at C:\Documents\sales.xlsx and summarize the first sheet.List all sheets in C:\Documents\sales.xlsx, then read the sheet named "Q2".Create an Excel file at C:\Documents\tasks.xlsx with columns Task, Owner, Status, and DueDate. Add five sample rows.I have an Excel workbook open. Read the active sheet and tell me which rows have missing Status values.Write these rows into the active Excel workbook: Task=Review proposal, Owner=Kim, Status=Done; Task=Send deck, Owner=Lee, Status=In progress.Word
Read C:\Documents\proposal.docx and give me a concise summary with action items.Create a Word document at C:\Documents\meeting-notes.docx titled "Meeting Notes" with sections for Attendees, Decisions, and Next Steps.I have a Word document open. Replace every occurrence of "FY25" with "FY26", but do not save the file.Append this paragraph to the open Word document: "Please review the updated timeline before Friday."Read the currently active Word document and rewrite the executive summary in a more concise tone.PowerPoint
Read C:\Documents\quarterly-review.pptx and summarize each slide in one sentence.Create a PowerPoint file at C:\Documents\project-update.pptx with slides for Overview, Timeline, Risks, and Next Steps.I have a PowerPoint deck open. Replace "Q1" with "Q2" on slide 2 only, without saving the file.Inspect slide 3 of the open PowerPoint deck and show me the shapes with their IDs, names, text, position, and size.On slide 3 of the open PowerPoint deck, find the shape that contains "Revenue" and change its fill color to #FFAA00.Add a new slide to the open PowerPoint deck titled "Next Steps" with three bullets: finalize scope, assign owners, confirm timeline.On slide 5, move the shape named "Title 1" to the top-left corner and make it wider.Cross-Document Tasks
Read the active Excel workbook, summarize the key numbers, and add a new slide to the open PowerPoint deck with the summary.Read C:\Documents\notes.docx and create a PowerPoint deck at C:\Documents\summary.pptx with one slide per major section.Inspect the open PowerPoint deck, find slides that mention "risk", and append a risk summary paragraph to the open Word document.Docker
The Docker image can be used for file-based operations where the target files are mounted into the container.
docker compose up --buildActive desktop Office automation is not available inside the provided Linux container because it depends on Windows Office COM automation.
Publishing
npm run build
npm pack --dry-run
npm publish --access publicThe package includes only:
buildREADME.mdLICENSEpackage.json
Limitations
- Active-document tools are Windows-only.
- Active-document tools require the corresponding Office app to be running.
- Active-document tools modify the open document but do not save automatically.
.docand.pptlegacy formats are not the primary target; use.docxand.pptx.- PowerPoint object editing currently targets shapes by slide and shape identifier/name.
Security Notes
This package does not require API keys or credentials. It can read and modify files or active Office documents that the server process can access, so configure it only in MCP clients and environments you trust.
