Excel Power Pivot MCP Server
A Model Context Protocol (MCP) server that enables AI assistants to interact with Excel Power Pivot data models. Create and manage DAX measures, relationships, and more through natural language.
Features
Workbook Discovery & Connection - Discover and connect to open Excel workbooks with Power Pivot data models
DAX Query Execution - Run DAX queries and preview table data
Measure Management - Create, update, and delete DAX measures with auto-formatting
Relationship Management - Create, delete, and activate/deactivate table relationships
Model Exploration - List tables, columns, measures, relationships, hierarchies, KPIs, and dependencies
Data Profiling - Analyze column statistics (min, max, distinct count, nulls, sample values)
Power Query Discovery - List Power Queries (M code) in the workbook
Table Management - Add Excel tables to the data model, refresh tables/model
Use at your own risk. This tool modifies your Excel Power Pivot data models directly. The author is not responsible for any data loss, corruption, or damage to your workbooks. Always maintain backups of your Excel files before using this tool.
Requirements
Windows 10/11 (required for Excel COM interop)
Microsoft Excel 2013+ with Power Pivot enabled
Installation
Download the latest ExcelPowerPivotMcp.exe from the Releases page.
No installation required - just download and configure your MCP client.
MCP Client Configuration
Claude Desktop
Add to your claude_desktop_config.json:
Windows: %APPDATA%\Claude\claude_desktop_config.json
Cursor
Add to your Cursor MCP settings:
Antigravity (VS Code)
Add to your .vscode/mcp.json:
Usage
1. Open Excel with Power Pivot
Open your Excel workbook that contains a Power Pivot data model.
2. Connect via MCP
The AI assistant will first discover and connect to your workbook:
3. Explore and Modify
Available Tools
Connection
Tool | Description |
| Find open Excel workbooks with Power Pivot models |
| Connect to a specific workbook |
| Check current connection status |
| Save the connected workbook |
| Refresh the entire data model |
Model Metadata
Tool | Description |
| Comprehensive model overview |
| List all tables with row counts |
| List columns in a table |
| List measures with expressions |
| Show table relationships |
| List user-defined hierarchies |
| List Key Performance Indicators |
| Show calculation dependencies |
| List Power Queries (M code) |
| List Excel tables (ListObjects) |
DAX Queries
Tool | Description |
| Execute DAX queries or preview table data |
| Get column statistics and sample values |
Measure CRUD
Tool | Description |
| Create a new DAX measure |
| Update expression/name/description |
| Delete a measure |
Relationship CRUD
Tool | Description |
| Create a table relationship |
| Delete a relationship |
| Activate/deactivate a relationship |
Table Operations
Tool | Description |
| [DESTRUCTIVE] Add Excel table to data model |
| Refresh a single table |
Prompts
Prompt | Description |
| Describe the data model in plain English |
| Guided workflow to create a measure |
| Analyze model structure and suggest improvements |
| Test DAX before creating permanent measures |
| Debug and fix a broken measure |
| Guided workflow to add a relationship |
| Recover from a lost Excel connection |
Resources
URI | Description |
| Current Power Pivot data model schema (JSON) |
| Check for unsaved changes |
| Recent server diagnostic logs |
| Guidelines for working with Power Pivot |
| Measure best practices guide |
| DAX query guide for Excel |
| Common workflow reference |
Performance Tips
Fast Measure Creation
Use autoFormat: false to skip DAX formatting for faster measure creation (~1.5s savings):
Limitations
Excel Power Pivot Limitations
These features are not available in Excel Power Pivot (unlike Power BI):
Feature | Excel Power Pivot |
Calculation Groups | ❌ Not supported |
Perspectives | ❌ Not supported |
Row-Level Security (RLS) | ❌ Not supported |
DEFINE COLUMN in DAX queries | ❌ Not supported |
MCP Server Limitations
These exist in Excel but cannot be managed via this MCP due to COM API restrictions:
Feature | Status |
Create/Update/Delete Calculated Columns | ❌ Use Power Pivot window |
Set Column Descriptions | ❌ Use Power Pivot window |
Troubleshooting
Error | Solution |
"Excel is not running" | Open Excel with your workbook |
"Workbook not found" | Ensure the workbook is open in Excel |
"No data model" | Create a Power Pivot data model first |
"Not connected" | Call
first |
License
MIT License - see LICENSE file.
Contributing
Contributions welcome! Please open an issue or pull request.
Acknowledgments
Model Context Protocol by Anthropic
DAX Formatter by SQLBI