Excel Mcp Server

Excel Mcp Server

🚀 Excel MCP 服务器

一个支持 Model Context Protocol (MCP) 的服务器,可用于读取和写入 Microsoft Excel 数据,为处理 Excel 文件提供便捷途径。

NPM 版本 smithery 徽章

🚀 快速开始

Excel MCP 服务器是一个支持 Model Context Protocol (MCP) 的服务器,专门用于读取和写入 Microsoft Excel 数据。

✨ 主要特性

  • 从 MS Excel 文件中读取文本值
  • 将文本值写入 MS Excel 文件
  • 从 MS Excel 文件中读取公式
  • 将公式写入 MS Excel 文件

🪟仅限 Windows:

  • 实时编辑 MS Excel 文件
  • 捕获文件的屏幕图像

更多详细信息,请参阅 工具 部分。

📦 安装指南

通过 NPM 安装

excel-mcp-server 会自动安装在 MCP 服务器配置中添加以下配置。

对于 Windows:

{
"mcpServers": {
"excel": {
"command": "cmd",
"args": ["/c", "npx", "--yes", "@negokaz/excel-mcp-server"],
"env": {
"EXCEL_MCP_PAGING_CELLS_LIMIT": "4000"
}
}
}
}

对于其他平台:

{
"mcpServers": {
"excel": {
"command": "npx",
"args": ["--yes", "@negokaz/excel-mcp-server"],
"env": {
"EXCEL_MCP_PAGING_CELLS_LIMIT": "4000"
}
}
}
}

通过 Smithery 安装

要自动为 Claude Desktop 安装 Excel MCP Server,请通过 Smithery

npx -y @smithery/cli install @negokaz/excel-mcp-server --client claude

📚 详细文档

要求

  • Node.js 20.x 或更高版本

支持的文件格式

  • xlsx(Excel 工作簿)
  • xlsm(带宏的 Excel 工作簿)
  • xltx(Excel 模板)
  • xltm(带宏的 Excel 模板)

工具

read_sheet_names

列出 Excel 文件中的所有工作表名称。

参数:

  • fileAbsolutePath:Excel 文件的绝对路径

read_sheet_data

按分页读取 Excel 工作表的数据。

参数:

  • fileAbsolutePath:Excel 文件的绝对路径
  • sheetName:Excel 文件中的工作表名称
  • range:要读取的 Excel 工作表范围(例如:"A1:B2")。默认情况下,如果未指定范围,则从第一个单元格开始按分页读取。

read_sheet_data_with_range

按分页读取 Excel 工作表中指定范围的数据。

参数:

  • fileAbsolutePath:Excel 文件的绝对路径
  • sheetName:Excel 文件中的工作表名称
  • startRow:要读取的起始行号
  • endRow:要读取的结束行号
  • 每次最多读取 4000 个单元格。

read_sheet_formula

按分页读取 Excel 工作表中的公式。

参数:

  • fileAbsolutePath:Excel 文件的绝对路径
  • sheetName:Excel 文件中的工作表名称

write_sheet_data

将数据写入 Excel 工作表。

参数:

  • fileAbsolutePath:Excel 文件的绝对路径
  • sheetName:Excel 文件中的工作表名称
  • data:要写入的数据(例如:{A1: "value"}

write_sheet_formula

将公式写入 Excel 工作表。

参数:

  • fileAbsolutePath:Excel 文件的绝对路径
  • sheetName:Excel 文件中的工作表名称
  • formula:要写入的公式(例如:{A1: "=A2+B2"}

配置

你可以通过以下环境变量更改 MCP 服务器的行为:

EXCEL_MCP_PAGING_CELLS_LIMIT

每次分页操作中读取的最大单元格数。[默认值:4000]

📄 许可证

版权所有 (c) 2025 Kazuki Negoro

excel-mcp-server 按照 MIT License 发布

  • 0 关注
  • 0 收藏,19 浏览
  • system 提出于 2025-09-20 16:15

相似服务问题

相关AI产品