Excel MCP Server

MIT License
1,658
68
  • Linux
  • Apple

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Excel MCP 服务器

读取和写入 MS Excel 数据的模型上下文协议 (MCP) 服务器。

特征

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

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

要求

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

支持的文件格式

  • xlsx(Excel 手册)
  • xlsm(Excel 宏启用书)
  • xltx(Excel模板)
  • xltm(启用宏的 Excel 模板)

安装

通过 NPM 安装

通过将以下配置添加到 MCP 服务器配置中,excel-mcp-server 会自动安装。

对于 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 安装

要通过Smithery自动为 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
    • Excel 工作表中要读取的单元格范围(例如“A1:C10”)。[默认:第一页范围]
  • knownPagingRanges
    • 已读分页范围列表

read_sheet_formula

从 Excel 表中分页读取公式。

参数:

  • fileAbsolutePath
    • Excel 文件的绝对路径
  • sheetName
    • Excel 文件中的工作表名称
  • range
    • Excel 工作表中要读取的单元格范围(例如“A1:C10”)。[默认:第一页范围]
  • knownPagingRanges
    • 已读分页范围列表

read_sheet_image

**[仅限 Windows]**从带有分页的 Excel 表中读取数据作为图像。

参数:

  • fileAbsolutePath
    • Excel 文件的绝对路径
  • sheetName
    • Excel 文件中的工作表名称
  • range
    • Excel 工作表中要读取的单元格范围(例如“A1:C10”)。[默认:第一页范围]
  • knownPagingRanges
    • 已读分页范围列表

write_sheet_data

将数据写入 Excel 表。

参数:

  • fileAbsolutePath
    • Excel 文件的绝对路径
  • sheetName
    • Excel 文件中的工作表名称
  • range
    • Excel 表中要读取的单元格范围(例如“A1:C10”)。
  • data
    • 要写入 Excel 工作表的数据

write_sheet_formula

将公式写入 Excel 表。

参数:

  • fileAbsolutePath
    • Excel 文件的绝对路径
  • sheetName
    • Excel 文件中的工作表名称
  • range
    • Excel 表中要读取的单元格范围(例如“A1:C10”)。
  • formulas
    • 写入 Excel 工作表的公式(例如“=A1+B1”)

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

EXCEL_MCP_PAGING_CELLS_LIMIT

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

执照

版权所有 (c) 2025 根戈罗一树

excel-mcp-server 根据MIT 许可证发布

-
security - not tested
A
license - permissive license
-
quality - not tested

模型上下文协议服务器,使 AI 助手能够读取和写入 Microsoft Excel 文件,支持 xlsx、xlsm、xltx 和 xltm 等格式。

  1. Features
    1. Requirements
      1. Supported file formats
        1. Installation
          1. Installing via NPM
          2. Installing via Smithery
          3. read_sheet_names
          4. read_sheet_data
          5. read_sheet_formula
          6. read_sheet_image
          7. write_sheet_data
          8. write_sheet_formula
          9. EXCEL_MCP_PAGING_CELLS_LIMIT
        2. License
          ID: hklvuq4p5r