Excel MCP Skill

VerifiedSafe

MCP tools for reading, writing, and formatting Excel files, featuring two modes: workbook (for open Excel) and path (for closed files).

Sby Skills Guide Bot
Data & AIIntermediate
207/25/2026
Claude Code
#excel#data-manipulation#spreadsheet#automation#mcp

Recommended for

Our review

Provides tools to read, write, and format Excel files via MCP, supporting both open workbooks and closed .xlsx files.

Strengths

  • Supports both live Excel via xlwings and direct .xlsx editing without Excel
  • Offers fine-grained cell formatting including borders, colors, and number formats
  • Allows VBA macro execution on open workbooks

Limitations

  • Path mode only works with .xlsx files (not .xls or .csv)
  • Changes made via path mode are not reflected immediately in an open Excel instance
  • Complex operations may require manual VBA scripting
When to use it

Use when you need to programmatically read, write, or format data in Excel files from an AI agent.

When not to use it

Avoid for real-time collaborative editing or when working with non-Excel spreadsheet formats like CSV.

Security analysis

Safe
Quality score95/100

The skill only documents MCP tools for Excel file manipulation. It does not instruct or imply any execution of arbitrary system commands, network requests, or destructive operations. No obfuscated or risky patterns are present.

No concerns found

Examples

Read a range from a closed file
Read the values and formats of cells A1 to C10 from the Excel file at /path/to/workbook.xlsx. Use the 'path' mode.
Write data and apply formatting
Write the following table to Sheet1!A1:D4 in /data/sales.xlsx and format the header row bold with blue font and thin borders around the table. Use path mode.

Header: Name, Q1, Q2, Q3
Row1: Alice, 100, 150, 200
Row2: Bob, 90, 110, 130
Row3: Charlie, 120, 140, 160
Execute a VBA macro on an open workbook
Run the VBA macro named 'SortData' on the workbook 'Budget.xlsx' that is currently open in Excel. The macro is stored in a module named 'Module1'. Use workbook mode.

Excel MCP Skill

Excel ファイルの読み書き・書式設定を行うための MCP ツール群。

2つのモード

  • workbook — 開いている Excel ブックをリアルタイム操作(xlwings)
  • path — 閉じた .xlsx ファイルを直接編集(Excel 不要、画像・グラフを壊さない)

どちらか一方を指定する。両方指定しない。

基本フロー

閉じたファイルを扱う場合

  1. read_cells で現状を確認(path, range, formats=true)
  2. write_cells で値を書き込む(path, range, value)
  3. format_cells で書式を整える(path, range, format)

開いている Excel を扱う場合

  1. get_excel_info でブック名・シート名を取得
  2. read_cells / write_cells / format_cells を workbook 指定で使う
  3. 複雑な操作は execute_vba で VBA を実行(開いている時のみ)

ツール早見表

| ツール | workbook | path | 必須パラメータ | |--------|:--------:|:----:|---------------| | get_excel_info | - | - | なし | | read_cells | OK | OK | range | | write_cells | OK | OK | range, value | | format_cells | OK | OK | range, format | | execute_vba | OK | ✕ | workbook, code |

value の指定方法

単一値:      "hello"  /  42  /  true
1行:         ["A", "B", "C"]
複数行:      [["A1","B1"], ["A2","B2"]]
1列:         range="A1:A3", value=["x","y","z"]

range のサイズと value の形状を合わせる。単一値を範囲に書くと全セルに同じ値が入る。

format の指定方法

{
  "bold": true,
  "fontSize": 14,
  "fontColor": "#FF0000",
  "backgroundColor": "#FFFF00",
  "textAlign": "center",
  "numberFormat": "#,##0",
  "borders": {
    "outside": { "style": "thin", "color": "#000000" }
  }
}

使えるプロパティ: bold, italic, underline, fontSize, fontName, fontColor, backgroundColor, textAlign (left/center/right), verticalAlign (top/middle/bottom), numberFormat, wrapText, borders

borders の位置: top, bottom, left, right, inside, outside borders の style: thin, medium, thick, double, dotted, dashed, none

注意点

  • path モードは .xlsx 形式のみ対応(.xls, .csv は不可)
  • path モードで編集してもExcelには即反映されない(ファイルを開き直す必要あり)
  • execute_vba は開いているブック専用。閉じたファイルには使えない
  • sheet を省略すると最初のシート(またはアクティブシート)が対象
  • 大きな範囲を一度に読むより、必要な範囲だけ指定する方が高速
Related skills