Skip to content
MCP Servers
Skill

/excel-cli

Excel CLI automation skill for Windows workbooks. Use when a coding agent needs token-efficient, scriptable, or unattended Excel automation via excelcli commands. Best for CI/CD, scheduled jobs, batch processing, PowerShell workflows, and bulk workbook edits. Supports Power

BOOST
From plugin
mcp-server-excel
7892 skills
Install
$ npx -y skills add sbroenne/mcp-server-excel --skill excel-cli --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/excel-cli

Context preview

The summary Claude sees to decide when to auto-load this skill.

Excel CLI automation skill for Windows workbooks. Use when a coding agent needs token-efficient, scriptable, or unattended Excel automation via excelcli commands. Best for CI/CD, scheduled jobs, batch processing, PowerShell workflows, and bulk workbook edits. Supports Power

SKILL.md

excel-cli.SKILL.md
name: excel-cli
description: >
  Excel CLI automation skill for Windows workbooks. Use when a coding agent needs
  token-efficient, scriptable, or unattended Excel automation via excelcli commands.
  Best for CI/CD, scheduled jobs, batch processing, PowerShell workflows, and bulk
  workbook edits. Supports Power Query, DAX, PivotTables, Tables, Ranges, Charts,
  VBA, Data Models, screenshots, and formatting. Triggers: excelcli, Excel CLI,
  command line, batch, script, automation, CI/CD, scheduled, PowerShell, unattended,
  coding agent, workbook processing.
compatibility: Requires Windows, Microsoft Excel 2016 or later, and network access for first-run runtime download.

Excel Automation with excelcli

Preconditions

  • Windows host with Microsoft Excel installed (2016+)
  • Uses COM interop — does NOT work on macOS or Linux
  • **Every command below invokes `excelcli` directly, so it must resolve on PATH.**

Installing the `excel-cli` plugin does *not* put it there — the global shim is opt-in. Run `com.github.copilot\bin\install-global.ps1` from the installed plugin folder once (it writes `excelcli.cmd` / `excelcli.ps1` into `~\.copilot\bin` and adds that to your user PATH), or install the runtime independently via the standalone release zip or `dotnet tool install --global Sbroenne.ExcelMcp.CLI`. If `excelcli` is not found, report that and stop — do not guess at a path.

  • In an Agent Plugins host, the runtime is downloaded and cached under

`PLUGIN_DATA\runtime`; release freshness is checked once per Copilot session. The optional global shim falls back to `~\.copilot\plugin-runtime\mcp-server-excel\excel-cli` and checks for updates at most once every 24 hours.

Workflow Checklist

| Step | Command | When | |------|---------|------| | 1. Session | `session create/open` | Always first | | 2. Sheets | `sheet create/rename` | If needed | | 3. Write data | See below | If writing values | | 4. Save & close | `session close --save` | Always last |

> **10+ commands?** Use `excelcli -q batch --input commands.json` — sends all commands in one process with automatic session management. See Rule 8.

**Writing Data (Step 3):**

  • `--values` takes a JSON 2D array string: `--values '[["Header1","Header2"],[1,2]]'`
  • Write **one row at a time** for reliability: `--range A1:B1 --values '[["Name","Age"]]'`
  • Strings MUST be double-quoted in JSON: `"text"`. Numbers are bare: `42`
  • Always wrap the entire JSON value in single quotes to protect special characters

CRITICAL RULES (MUST FOLLOW)

> **⚡ Building dashboards or bulk operations?** Skip to **Rule 8: Batch Mode** — it eliminates per-command process overhead and auto-manages session IDs.

Rule 1: NEVER Ask Clarifying Questions

Execute commands to discover the answer instead:

| DON'T ASK | DO THIS INSTEAD | |-----------|-----------------| | "Which file should I use?" | `excelcli -q session list` | | "What table should I use?" | `excelcli -q table list --session <id>` | | "Which sheet has the data?" | `excelcli -q sheet list --session <id>` |

**You have commands to answer your own questions. USE THEM.**

Rule 2: Always End With a Text Summary

**NEVER end your turn with only a command execution.** After completing all operations, always provide a brief text message confirming what was done. Silent command-only responses are incomplete.

Rule 3: Session Lifecycle

**Creating vs Opening Files:**

# NEW file - use session create
excelcli -q session create C:\path\newfile.xlsx  # Creates file + returns session ID

# EXISTING file - use session open
excelcli -q session open C:\path\existing.xlsx   # Opens file + returns session ID

**CRITICAL: Use `session create` for new files. `session open` on non-existent files will fail!**

**CRITICAL: ALWAYS use the session ID returned by `session create` or `session open` in subsequent commands. NEVER guess or hardcode session IDs. The session ID is in the JSON output (e.g., `{"sessionId":"abc123"}`). Parse it and use it.**

# Example: capture session ID from output, then use it
excelcli -q session create C:\path\file.xlsx     # Returns JSON with sessionId
excelcli -q range set-values --session <returned-session-id> ...
excelcli -q session close --session <returned-session-id> --save

**Unclosed sessions leave Excel processes running, locking files.**

Rule 4: Data Model Prerequisites

DAX operations require tables in the Data Model:

excelcli -q table add-to-data-model --session <id> --table-name Sales  # Step 1
excelcli -q datamodel create-measure --session <id> ...               # Step 2 - NOW works

Rule 5: Power Query Development Lifecycle

**BEST PRACTICE: Test M code before creating permanent queries**

# Step 1: Create/open a session and capture the session ID
$session = excelcli -q session create C:\path\file.xlsx | ConvertFrom-Json
$sessionId = $session.sessionId

# Step 2: Test M code without persisting (catches errors early)
excelcli -q powerquery evaluate --session $sessionId --m-code-file query.m

# Step 3: Create permanent query with validated code
excelcli -q powerquery create --session $sessionId --query-name Q1 --m-code-file query.m

# Step 4: Load data to destination
excelcli -q powerquery refresh --session $sessionId --query-name Q1

# Step 5: Close session
excelcli -q session close --session $sessionId --save

Rule 6: Report File Errors Immediately

If you see "File not found" or "Path not found" - STOP and report to user. Don't retry.

Rule 7: Use Calculation Mode for Bulk Writes

When writing many values/formulas (10+ cells), disable auto-recalc for performance:

# 1. Create/open a session and capture the session ID
$session = excelcli -q session create C:\path\file.xlsx | ConvertFrom-Json
$sessionId = $session.sessionId

# 2. Set manual mode
excelcli -q calculationmode set-mode --session $sessionId --mode manual

# 3. Write data row by row for reli
Read more
Ships withmcp-server-excel

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.

Get the whole plugin
Stats
791
Stars
89
Forks
Active
Maintenance
C#
Language
MIT
License
29m ago
Last commit
11mo ago
Created

Repo: sbroenne/mcp-server-excel

Other skills on mcp-server-excel.