Skip to main content
Glama
softgridinc-pte-ltd

Excel Reader Server

Excel 阅读器服务器

提供读取 Excel (xlsx) 文件工具的模型上下文协议 (MCP) 服务器。

特征

  • 读取 Excel 文件中所有工作表的内容

  • 按名称读取特定工作表中的内容

  • 通过索引读取特定工作表中的内容

  • 以 JSON 格式返回数据

  • 处理空单元格和数据类型转换

Related MCP server: Excel MCP Server

安装

需要 Python 3.10 或更高版本。

# Using pip
pip install excel-reader-server

# Using uv (recommended)
uv pip install excel-reader-server

依赖项

  • mcp >= 1.2.1

  • openpyxl >= 3.1.5

用法

该服务器提供三个主要工具:

1. 读取 Excel

读取 Excel 文件中所有工作表的内容。

{
  "file_path": "path/to/your/excel/file.xlsx"
}

2. 通过工作表名称读取 Excel

根据名称从特定工作表读取内容。如果未提供工作表名称,则读取第一个工作表。

{
  "file_path": "path/to/your/excel/file.xlsx",
  "sheet_name": "Sheet1"  # optional
}

3. 通过工作表索引读取 Excel

根据索引从特定工作表读取内容。如果未提供索引,则读取第一个工作表(索引 0)。

{
  "file_path": "path/to/your/excel/file.xlsx",
  "sheet_index": 0  # optional
}

响应格式

服务器返回以下JSON格式的数据:

{
  "Sheet1": [
    ["Header1", "Header2", "Header3"],
    ["Value1", "Value2", "Value3"],
    ["Value4", "Value5", "Value6"]
  ]
}
  • 每个工作表都表示为顶级对象中的一个键

  • 工作表数据是一个数组数组,其中每个内部数组代表一行

  • 所有值都转换为字符串

  • 空单元格表示为空字符串

错误处理

服务器针对常见问题提供了清晰的错误消息:

  • 未找到文件

  • 工作表名称无效

  • 索引超出范围

  • 常见 Excel 文件读取错误

执照

本项目遵循 Apache 2 许可证。详情请参阅许可证文件。

贡献

欢迎贡献代码!欢迎提交 Pull 请求。

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/softgridinc-pte-ltd/mcp-excel-reader-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server