office-automation-suite-mcp
A set of Model Context Protocol (MCP) interfaces designed for programmatic manipulation and analysis of Microsoft Office artifacts, specifically leveraging PowerPoint presentations and Excel spreadsheets via native Windows automation.
Author

jenstangen1
Quick Info
Actions
Tags
Integrated Microsoft Office Control Modules (MCP)
This repository furnishes dedicated MCP servers facilitating AI-driven interaction with core Microsoft Office applications, namely PowerPoint and Excel. These tools enable sophisticated content generation, data manipulation, and structural analysis using natural language directives.
Both server modules rely on the pywin32 library for direct Component Object Model (COM) automation, ensuring deep integration with active, running Office processes.
System Requirements
- OS: Windows required for COM interface access.
- Software: Installed copies of Microsoft Office (PowerPoint and/or Excel).
- Runtime: Python version 3.7 or later.
- Package: The
pywin32library must be installed.
Setup Procedure
-
Acquire Codebase: bash git clone https://github.com/jenstangen1/mcp-pptx.git cd mcp-pptx
-
Dependency Installation (Recommended: using
uv): bash uv pip install pywin32 -
COM Initialization: Execute the
pywin32post-installation script with elevated permissions: bash python C:\path\to\your\env\Scripts\pywin32_postinstall.py -install
Configuration for Claude Integration
Integrate these services into your Claude Desktop client by updating your configuration JSON with the following structure, adjusting the cwd to your repository root:
{ "mcpServers": { "powerpoint_mcp_win32": { "command": "uv", "args": [ "run", "mcp_powerpoint_server_win32.py" ], "cwd": "C:\path\to\your\workspace" }, "excel_mcp_win32": { "command": "uv", "args": [ "run", "mcp_excel_server_win32.py" ], "cwd": "C:\path\to\your\workspace" } } }
PowerPoint Interaction Module
This module exposes an extensive API enabling large language models to programmatically construct, refine, and populate PowerPoint deck content, with specialized capabilities for visualizing financial datasets.
Core Capabilities
Presentation Lifecycle Management
- Creation, modification, and persistence of
.pptxfiles. - Slide addition, removal, and structural modification.
- Workspace-relative file loading and saving mechanisms.
- Support for saving standardized presentation layouts as reusable templates.
Graphical Object Manipulation
- Precise control over text boxes, shapes, embedded images, and embedded charts.
- Advanced geometric arrangement, grouping, and layering of visual components.
- Automated rendering of connecting lines between specified geometric elements.
Financial Data Visualization
- Generation of diverse chart types (bar, pie, waterfall, line) populated with financial indicators.
- Data handling for core metrics: Revenue, Profit, EBITDA, Assets, Equity, Margins, and Growth Rates.
- Ability to structure key metrics into tabular formats for cross-entity comparison.
- Note: Currently employs synthetic datasets; future integration targets the Proff API for live Norwegian corporate data.
Aesthetic Control
- Application of complex styling attributes to text runs and shapes (e.g., gradients, borders, fills).
- Global presentation styling adjustments (e.g., slide background properties).
Available Service Calls (Tools)
| Category | Tool Name | Function Description |
|---|---|---|
| File Ops | list_presentations |
Enumerates presentation files in the defined work area. |
upload_presentation |
Ingests a local file into the managed workspace. | |
save_presentation |
Commits current presentation state to disk. | |
| Slide Control | add_slide |
Inserts a new, blank slide. |
delete_slide |
Removes a specified slide index. | |
get_slide_count |
Reports the total slide count. | |
analyze_slide |
Extracts structured content data from a slide. | |
set_background_color |
Defines the canvas color for the active slide. | |
| Element Control | add_text |
Places and formats text onto a slide. |
add_shape |
Draws a basic geometric object. | |
edit_element |
Modifies the positional or inherent properties of an existing object. | |
style_element |
Applies specific visual appearance settings to an object. | |
connect_shapes |
Draws a line object linking two existing shapes. | |
find_element |
Locates objects based on attributes (e.g., text content, type). | |
| Financial Ops | get_company_financials |
Fetches structured financial data (currently mocked). |
create_financial_chart |
Renders a chart object based on provided data/type. | |
create_comparison_table |
Generates a grid summarizing metrics across entities. | |
| Template Mgmt | list_templates |
Lists available saved layout definitions. |
apply_template |
Applies a layout definition to the current presentation. | |
create_slide_from_template |
Generates a new slide based on a specific template asset. | |
save_as_template |
Archives the current slide structure as a reusable template. | |
| Debugging | debug_element_mappings |
Provides introspection into how elements map to COM identifiers. |
Excel Automation Module
This module equips AI agents with the capability to interact deeply with open or newly created Excel workbooks, focusing on data extraction, computational tasks, and structural organization.
Feature Set
Workbook Administration
- Establishing connections to live Excel application processes.
- Retrieving a roster of all actively opened document files.
- Saving workbooks with explicit control over file format extensions (
.xlsx,.xlsm, etc.).
Worksheet Structure
- Listing all sheets within the active workbook.
- Procedures for instantiating new workbook sheets.
- Direct referencing of worksheets via their naming convention or sequential position.
Data Cell Interaction
- Reading the content of a single specified cell.
- Writing a new value to an individual cell address.
- Bulk reading of data spanning defined cell regions (ranges).
- Bulk writing of data arrays into specified cell regions.
- Automatic handling and casting for numerical, date, and currency data types.
Available Service Calls (Tools)
| Category | Tool Name | Function Description |
|---|---|---|
| Workbook | list_open_workbooks |
Displays all Excel files currently in memory. |
save_workbook |
Persists the active workbook state to disk, allowing format selection. | |
| Worksheet | list_worksheets |
Returns names of all sheets in the active workbook. |
add_worksheet |
Creates and names a new sheet tab. | |
get_worksheet |
Retrieves a worksheet object reference by name or index. | |
| Cell/Range | get_cell_value |
Retrieves the primitive value from one cell. |
set_cell_value |
Assigns a new value to one cell. | |
get_range_values |
Extracts a 2D array of data from a specified range. | |
set_range_values |
Overwrites a region with a 2D array of input data. |
Operational Notes
- Platform Lock-in: Both servers are strictly dependent on the Windows OS environment and active Office installation.
- Execution Model: The tools operate by interfacing with live, instantiated Office processes.
- Troubleshooting COM: If errors related to the Component Object Model arise, re-running the
pywin32_postinstall.pyscript is the primary remedy.
Usage Guidance: Interacting with Claude
Once configuration is complete, natural language prompts translate directly into sequential tool executions.
Example Flow (Presentation):
Input: "Design a presentation on market penetration showing Q3 vs Q4 revenue in a bar chart."
Execution Chain: add_slide -> add_text (Title) -> create_financial_chart (Revenue Bar Chart).
Example Flow (Spreadsheet):
Input: "In 'SalesData.xlsx', find the highest value in Column C of the 'Totals' sheet and report it in cell D1 of a new sheet named 'MaxFinder'."
Execution Chain: get_worksheet (Totals) -> get_range_values (Column C) -> set_range_values (New Sheet D1, incorporating calculated max value).
