Negokaz_excel Mcp Server

Negokaz_excel Mcp Server

🚀 Excel MCP 服务器

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

NPM 版本 史密瑟里徽章

🚀 快速开始

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

✨ 主要特性

  • 从 MS Excel 文件中读取文本值
  • 向 MS Excel 文件中写入文本值
  • 从 MS Excel 文件中读取公式
  • 向 MS Excel 文件中写入公式
  • 捕获文件的屏幕图像(仅限 Windows)

更多细节请参见工具部分。

📦 安装指南

系统要求

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

支持的文件格式

  • xlsx(Excel 工作簿)
  • xlsm(带宏的 Excel 工作簿)
  • xltx(Excel 模板)
  • xltm(带宏的 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"
}
}
}
}

通过史密瑟里安装

要自动为 Claude Desktop 安装 Excel MCP Server,请使用 史密瑟里

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

📚 详细文档

read_sheet_names

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

参数:

  • fileAbsolutePath
    • Excel 文件的绝对路径

read_sheet_data

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

参数:

  • fileAbsolutePath
    • Excel 文件的绝对路径
  • sheetName
    • Excel 文件中的工作表名称
  • range(可选)
    • 读取的范围,格式为 "A1:B2"。
    • 默认值:整个工作表
  • returnHeaders(可选)
    • 是否返回列标题,默认为 true。

read_sheet_data_all

按分页读取 Excel 文件中所有工作表的数据。

参数:

  • fileAbsolutePath
    • Excel 文件的绝对路径

write_sheet_data

向 Excel 工作表写入数据。

参数:

  • fileAbsolutePath
    • Excel 文件的绝对路径
  • sheetName
    • 要写入的工作表名称
  • data
    • 要写入的数据,格式为 {row: number, column: string, value: any}
  • headers(可选)
    • 是否在第一行添加标题,默认为 true。

write_sheet_data_all

向 Excel 文件中的所有工作表写入数据。

参数:

  • fileAbsolutePath
    • Excel 文件的绝对路径

配置环境变量

通过以下环境变量调整 MCP 服务器的行为:

EXCEL_MCP_PAGING_CELLS_LIMIT

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

📄 许可证

版权所有 (c) 2025 Kazuki Negoro

Excel MCP Server 根据 MIT License 发布

  • 0 关注
  • 0 收藏,8 浏览
  • system 提出于 2025-09-20 17:06

相似服务问题