mcp-excel
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-excel Read 'Sheet1' in data.xlsx and list all rows."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-excel —— 让 AI 助手直接读写你电脑上的 Excel 文件
支持 .xlsx / .xls / .csv 格式。
它能干什么
读取本地 Excel / CSV 文件,让 AI 直接回答表格内容相关的问题。
新建
.xlsx文件,并创建多张初始工作表。修改单元格、批量写入二维数组、设置 Excel 公式。
设置字体、填充色、边框、对齐、数字格式,合并单元格、调整列宽行高美化表格。
对工作表区域排序、筛选、去重。
把本地
png / jpg / gif图片插入到工作表指定位置。
Related MCP server: Excel MCP Server
安装与配置
需要 Node.js 20 或以上。在 AI 助手的 MCP 配置中加入:
{
"mcpServers": {
"excel": {
"command": "npx",
"args": ["-y", "mcp-excel"]
}
}
}保存配置后,重启 AI 助手即可生效。
使用示例
帮我看看
D:\报表\2026年销售记录.xlsx里“一月”那张表,总销售额是多少?新建一个 Excel,12 张 Sheet,每张是一个月考勤表,第一行写姓名和 1 到 31 号。
把“费用表” B5 的 3000 改成 3500,最后加一行合计。
支持的格式与限制
.xlsx:全功能支持。.xls:仅支持读取;如需修改,请先在 Excel / WPS 中另存为.xlsx。.csv:支持读写单元格值,但仅有一张工作表,不支持样式、合并单元格、图片等。修改含有图表、数据透视表、宏(如
.xlsm中的 VBA)的文件时,这些元素可能在保存过程中丢失。本工具写入的公式不带缓存计算结果,需要在 Excel / WPS 中打开一次后才会显示计算值。
隐私说明
所有处理都在你自己的电脑上完成,不上传任何数据。
License
MIT
Available Tools
15 toolsadd_sheet新增工作表B
在已有文件中追加一张空工作表。
Inputs: filePath (required), sheetName (required).
create_workbook新建 Excel 文件A
从无到有新建一个 .xlsx 文件。可指定初始工作表名列表。文件已存在时会失败(防误覆盖),不会清空已有文件。
Inputs: filePath (required), sheets.
dedupe_range区域去重A
删除区域内 keyColumns 完全相同的重复行,只保留第一次出现的行(会修改文件)。被删的行变为空白行,区域外的内容不会被移动。
Inputs: range (required), filePath (required), sheetName (required), keyColumns (required), +1 more.
delete_sheet删除工作表A
删除指定工作表。不能删除最后一张。
Inputs: filePath (required), sheetName (required).
filter_range筛选区域B
按条件筛选区域中的行并返回结果,不修改文件。多个条件为'并且'关系。
Inputs: range (required), filePath (required), sheetName (required), conditions (required), +1 more.
format_cells设置单元格样式A
设置一个区域的字体、填充色、边框、对齐、数字格式,让表格好看。只传想改的项,没传的不动。csv 文件不支持样式。
Inputs: range (required), style (required), filePath (required), sheetName (required).
insert_image插入图片A
把一张本地图片(png / jpg / gif)插入工作表,图片左上角锚定在 anchorCell。width/height 为像素,不传给默认 300×200——比例不对时请显式传这两个值。csv 不支持插图。
Inputs: filePath (required), imagePath (required), sheetName (required), anchorCell (required), +2 more.
list_sheets列出工作表A
查看一个 Excel 文件里有哪些工作表,各有多少行多少列。动手读/写之前可以先调它确认表名。
Inputs: filePath (required).
merge_cells合并单元格B
把一个矩形区域合并成一个单元格,内容保留左上角的值。常用于标题行。
Inputs: range (required), filePath (required), sheetName (required).
read_range读取区域内容A
读取一张工作表的内容,返回二维数组。不传 range 则读整张表;表很大时建议先传 range 读一部分(如前 50 行)了解结构。空单元格为 null,日期为 ISO 字符串。
Inputs: filePath (required), range, sheetName.
rename_sheet重命名工作表B
修改工作表名称。
Inputs: newName (required), oldName (required), filePath (required).
set_dimensions设置列宽行高A
设置工作表的列宽和/或行高,让表格排版合适。列宽单位是字符数(Excel 默认约 8.43),行高单位是磅(默认约 15)。columns 和 rows 至少传一个。csv 不支持。
Inputs: filePath (required), sheetName (required), rows, columns.
set_formula写入公式A
在指定单元格写入 Excel 公式,如 SUM(A1:A10),可带或不带开头的 =。注意:公式要等用户在 Excel/WPS 里打开文件后才会计算出结果,本工具读该格会得到 null。
Inputs: cell (required), formula (required), filePath (required), sheetName (required).
sort_range排序区域A
对一个区域按某列排序(会修改文件)。区域外的内容不动。有表头时传 hasHeader: true 并用表头名指定列更稳妥。
Inputs: order (required), range (required), filePath (required), keyColumn (required), +2 more.
write_range写入区域数据A
从 startCell 开始写入一个二维数组(先行后列)。一个格子就传 [[值]];一大片就传多行多列。值为 null 会清空对应单元格。字符串不会被套公式——要写公式请用 set_formula。目标工作表必须已存在(没有就先用 add_sheet)。
Inputs: values (required), filePath (required), sheetName (required), startCell (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Most tools target clearly distinct operations: sheet management (list/add/delete/rename), data reading/writing (read_range/write_range), and formatting/structural operations (format/merge/dimensions). One minor ambiguity: sort_range, filter_range, and dedupe_range all operate on ranges and could occasionally be confused, though their purposes are distinct enough.
Tool names follow a consistent verb_noun pattern throughout: list_sheets, add_sheet, delete_sheet, rename_sheet, read_range, write_range, set_formula, create_workbook, format_cells, merge_cells, set_dimensions, sort_range, filter_range, dedupe_range, insert_image. The naming is uniform and predictable.
15 tools is a well-scoped count for an Excel manipulation server. Each tool covers a discrete capability—sheet lifecycle, cell operations, formatting, data transforms, and image insertion—and all earn their place without bloat.
The surface covers core spreadsheet operations comprehensively: workbook creation, sheet CRUD, cell read/write, formulas, formatting, merging, dimensions, sorting, filtering, deduping, and images. Minor gaps include copy/cut/paste operations and number-format-specific quick helpers, but agents can work around these via the format_cells and range tools.
Related MCP Connectors
Open, inspect, filter, edit and convert xlsx and csv files from your AI chat. Processing is local.
Open, inspect, filter, edit and convert xlsx and csv files from your AI chat. Processing is local.
File tools for your AI chat: PDF tables to Excel, merge PDFs, images to PDF, fill PDF forms.
Connect AI assistants to Google Sheets through controlled tools for reading and updating rows.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to read, write, and manipulate Excel files through comprehensive spreadsheet operations. Supports file management, data querying, worksheet operations, formula calculations, and includes security features like path validation and automatic backups.2MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to create, read, and manipulate Excel files without requiring Microsoft Excel installation. Supports comprehensive spreadsheet operations including formulas, formatting, charts, pivot tables, and data validation.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to create, read, write, and manipulate Excel files (.xlsx, .xlsm) without requiring Microsoft Excel, including support for charts, pivot tables, data import/export, and professional formatting across Windows, macOS, and Linux.39 npm34MIT
- AlicenseBqualityDmaintenanceEnables AI assistants to perform Excel file operations (create, read, write, format) without requiring Microsoft Excel installation.175MIT