Excel MCP 服务器

Excel MCP 服务器

一个读写 MS Excel 数据的 Model Context Protocol (MCP) 服务器。

快速入门

功能

  • 读取和写入 Excel 文件中的文本值和公式
  • 支持屏幕截图(仅限 Windows)

安装

通过 NPM 安装,添加以下配置到 MCP 服务器设置:

Windows:

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

其他平台类似,只需将 command 替换为 npx

或者使用 Smithery 自动安装:

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

工具

支持以下工具函数:

  • read_sheet_names: 列出 Excel 文件的所有工作表名称。
  • read_sheet_data: 分页读取 Excel 表格数据。
  • write_sheet_data: 写入数据到 Excel 表格。
  • read_sheet_formula: 读取 Excel 公式。
  • write_sheet_formula: 写入公式到 Excel。
  • read_sheet_image: 截取 Excel 表格范围为图片(仅限 Windows)。

更多详情请查看 README。