excel-cli
Excel CLI automation skill for Windows workbooks. Use when a coding agent needs…
Excel MCP Server skill for Windows workbook automation. Use when an assistant needs rich MCP tools to create, inspect, modify, format, or analyze Excel files. Supports Power Query (M), Data Model/DAX, PivotTables, Tables, Ranges, Charts, Slicers, formatting, screenshots, VBA
$ npx -y skills add sbroenne/mcp-server-excel --skill excel-mcp --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/excel-mcpContext preview
The summary Claude sees to decide when to auto-load this skill.
Excel MCP Server skill for Windows workbook automation. Use when an assistant needs rich MCP tools to create, inspect, modify, format, or analyze Excel files. Supports Power Query (M), Data Model/DAX, PivotTables, Tables, Ranges, Charts, Slicers, formatting, screenshots, VBA
name: excel-mcp description: > Excel MCP Server skill for Windows workbook automation. Use when an assistant needs rich MCP tools to create, inspect, modify, format, or analyze Excel files. Supports Power Query (M), Data Model/DAX, PivotTables, Tables, Ranges, Charts, Slicers, formatting, screenshots, VBA macros, connections, and calculation mode. Triggers: Excel, spreadsheet, workbook, xlsx, xlsm, Power Query, DAX, PivotTable, chart, dashboard, VBA, MCP. compatibility: Requires Windows, Microsoft Excel 2016 or later, and network access for first-run runtime download.
Provides 326 Excel operations via Model Context Protocol. The MCP Server hosts the ExcelMCP Service in-process and calls it directly for low-latency Excel automation. Tools are auto-discovered - this documents quirks, workflows, and gotchas.
| Step | Tool | Action | When | |------|------|--------|------| | 1. Open file | `file` | `open` or `create` | Always first | | 2. Create sheets | `worksheet` | `create`, `rename` | If needed | | 3. Write data | `range` | `set-values` | Always (2D arrays) | | 4. Format | `range` | `set-number-format` | After writing | | 5. Structure | `table` | `create` | Convert data to tables | | 6. Save & close | `file` | `close` with `save: true` | Always last |
Use `calculation_mode` for **bulk write performance optimization**. When writing many values or formulas, disable auto-recalc to avoid recalculating after every cell:
1. calculation_mode(action: 'set-mode', mode: 'manual') → Disable auto-recalc 2. Perform all writes (range set-values, set-formulas) 3. calculation_mode(action: 'calculate', scope: 'workbook') → Recalculate once 4. calculation_mode(action: 'set-mode', mode: 'automatic') → Restore default
**Note:** You do NOT need manual mode to read formulas - `range get-formulas` returns formula text regardless of calculation mode.
**STOP.** If you're about to ask "Which file?", "What table?", "Where should I put this?" - DON'T.
| Bad (Asking) | Good (Discovering) | |--------------|-------------------| | "Which Excel file should I use?" | `file(list)` → use the open session | | "What's the table name?" | `table(list)` → discover tables | | "Which sheet has the data?" | `worksheet(list)` → check all sheets | | "Should I create a PivotTable?" | YES - create it on a new sheet |
**You have tools to answer your own questions. USE THEM.**
**NEVER end your turn with only a tool call.** After completing all operations, always provide a brief text message confirming what was done. Silent tool-call-only responses are incomplete.
Always apply number formats after setting values:
| Data Type | Format Code | Result | |-----------|-------------|--------| | USD | `$#,##0.00` | $1,234.56 | | EUR | `€#,##0.00` | €1,234.56 | | Percent | `0.00%` | 15.00% | | Date (ISO) | `yyyy-mm-dd` | 2025-01-22 |
Write format codes in US notation (`,` grouping, `.` decimal) regardless of the machine's locale — Excel translates them. The **rendered** separators follow the user's Windows regional settings, so `$#,##0.00` shows `$1.234,56` on a German system. Don't "fix" that by swapping the separators in the format code; it would break on every other locale.
**Workflow:**
1. range set-values (data is now in cells) 2. range set-number-format (apply format) 3. range_format auto-fit-columns (formatted values are wider than raw ones)
Step 3 is not optional. A column sized for `45678` is too narrow once that value renders as `2025-01-22` or `$1,234.56`, and Excel displays `#####` instead of the number.
Always convert tabular data to Excel Tables:
1. range set-values (write data including headers) 2. table(action: 'create', table_name: 'SalesData', range_address: 'A1:D100')
**Why:** Structured references, auto-expand, required for Data Model/DAX.
1. file(action: 'open', path: '...') → capture response.session_id as sessionId 2. workbook(action: 'get-info', session_id: sessionId) 3. file(action: 'close', session_id: sessionId, save: true) → saves and closes
Pass that same value as `session_id` on every session-based follow-up call. `sessionId` above is a local variable, not an MCP argument name. When reusing a session from `file(list)`, copy the matching entry's `sessionId` value into `session_id`. Never guess or substitute a session.
**Unclosed sessions leave Excel processes running, locking files.**
DAX operations require tables in the Data Model:
Step 1: Create table → Table exists Step 2: table(action: 'add-to-data-model') → Table in Data Model Step 3: datamodel(action: 'create-measure') → NOW this works
**BEST PRACTICE: Test-First Workflow**
1. powerquery(action: 'evaluate', m_code: '...') → Test WITHOUT persisting 2. powerquery(action: 'create', ...) → Store validated query 3. powerquery(action: 'refresh', ...) → Load data
**Why evaluate first:**
**Common mistake:** Creating/updating without evaluate → pollutes workbook with broken queries
Website · Installation · Features · Troubleshooting · Automate real Microsoft Excel with AI. Excel MCP Server lets GitHub Copilot, Claude, ChatGPT, and other agents control Excel through natural-language requests—using either MCP or a token-efficient CLI.
Repo: sbroenne/mcp-server-excel