McpOffice
MCP server for Microsoft Office documents (C# + DevExpress.Docs)
Ask AI about McpOffice
Powered by Claude Β· Grounded in docs
I know everything about McpOffice. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
mcpOffice
An MCP (Model Context Protocol) server for Microsoft Office documents, written in C# (.NET 9) and backed by DevExpress Office File API packages. It lets AI agents read, write, and convert Office documents through tool calls instead of one-off scripts.
Status: Word (.docx) and Excel (.xlsx / .xlsm) POCs are complete, including excel_analyze_vba v1 (procedures, event handlers, call graph, object-model references, file/DB/network/automation/shell dependencies). Next: excel_analyze_vba v2 β conversion hints toward Excel-to-C# migration tooling.
Architecture
Source: docs/img/architecture.excalidraw (open in Excalidraw). See ARCHITECTURE.md for the full layer map.
Documents
- Architecture β layer map, domains, tool-adding pattern, error model, VBA pipeline diagram.
- Usage β build, run, MCP client config, sample calls, troubleshooting.
- Word design β Word tool surface, error model.
- Word implementation plan β task-by-task TDD plan.
- Excel design β Excel tool surface and rationale.
- VBA extraction plan β MS-OVBA decompression, OpenMcdf walking.
Current Tools
24 tools shipped: 1 ping + 15 Word + 8 Excel.
Word
word_get_outline(path)word_get_metadata(path)word_read_markdown(path)word_read_structured(path)word_list_comments(path)word_list_revisions(path)word_create_blank(path, overwrite=false)word_create_from_markdown(path, markdown, overwrite=false)word_append_markdown(path, markdown)word_find_replace(path, find, replace, useRegex=false, matchCase=false)word_insert_paragraph(path, atIndex, text, style?)word_insert_table(path, atIndex, headers[], rows[][])word_set_metadata(path, properties)word_mail_merge(templatePath, outputPath, dataJson)word_convert(inputPath, outputPath, format?)
Excel
excel_list_sheets(path)β sheets in order with visibility, used range, dimensions.excel_read_sheet(path, sheetName?, sheetIndex?, range?, includeFormulas=true, includeFormats=false, maxCells=50000)β cell data with formulas + formats.excel_get_metadata(path)β author, title, created/modified, sheet count, document properties.excel_list_defined_names(path)β workbook + sheet-scoped names with refersTo / scope / hidden flag.excel_list_formulas(path, sheetName?, includeValues=false, maxFormulas=10000)β formula cells with optional cached values.excel_get_structure(path, includeSheets=true, includeFormulas=true, includeDefinedNames=true)β workbook rollup sized for huge workbooks.excel_extract_vba(path)β static VBA module source via in-process MS-OVBA decompression (no Excel install required).excel_analyze_vba(path, includeProcedures=true, includeCallGraph=false, includeReferences=false, moduleName?)β structural analysis on top of the extracted source: procedures with signatures, event handlers, call graph (with intra-workbook resolution), Excel object-model references, and external dependencies (file/DB/network/automation/shell). PassmoduleNameto scope the heavy arrays to a single module on large workbooks; the summary stays whole-workbook.
Other
Pingβ health check, returnspong.
All file paths passed to tools must be absolute.
Example
Create a Word document from Markdown, then convert it to PDF:
{
"path": "C:\\Temp\\proposal.docx",
"markdown": "# Proposal\n\nHello **Word**.",
"overwrite": false
}
{
"inputPath": "C:\\Temp\\proposal.docx",
"outputPath": "C:\\Temp\\proposal.pdf"
}
Extract VBA modules from a macro-enabled workbook:
{
"path": "C:\\Workbooks\\AnalysisTool.xlsm"
}
Roadmap
- Word POC β read / write / convert .docx β
- Excel POC β read sheets, list formulas/structure/defined names, extract VBA β
excel_analyze_vbav1 β call graph, event handlers, Excel object-model refs, external dependencies βexcel_analyze_vbav2 β conversion hints (procedure role classification, suggested C# equivalents, DOT/Mermaid call-graph rendering, cross-module coupling score).- PowerPoint (.pptx).
- PDF.
Built With
ModelContextProtocolβ C# MCP SDK.- DevExpress RichEdit / Spreadsheet / Office File API packages β server-side document APIs.
MarkdownToDocxGeneratorβ richer Markdown-to-DOCX import.OpenMcdfβ OLE compound file reader for VBA project extraction.
