Skip to main content

一个基于 FastMCP 和 Openpyxl 实现的 Excel MCP 服务器,提供了一系列操作 Excel 文件的工具,可以被 LLM 应用程序调用。

Project description

xlsx MCP Server

一个基于 FastMCP 和 Openpyxl 实现的 Excel MCP 服务器,提供了一系列操作 Excel 文件的工具,可以被 LLM 应用程序调用。

功能特性

  • 读取 Excel 文件数据
  • 写入数据到 Excel 文件
  • 创建新的 Excel 文件
  • 获取 Excel 文件的元数据

运行服务器

服务器将通过 stdio 启动。

{
    "mcpServers":{
        "xlsxServer":{
         "cmd": "uvx",
         "args": [
            "xlsx_mcp_server"
        ]
        }
    }
}

可用工具

1. open_workbook

打开一个已有的 Excel 文件。

参数:

  • workbook_id: 工作簿ID
  • file_path: Excel 文件路径

返回:

  • 操作结果

2. create_workbook

创建一个新的 Excel 工作簿。

参数:

  • workbook_id: 工作簿ID
  • sheets: 工作表名称列表(可选)

返回:

  • 操作结果

3. list_sheets

列出工作簿中的所有工作表。

参数:

  • workbook_id: 工作簿ID

返回:

  • 工作表名称列表

4. read_cell

读取指定单元格的值。

参数:

  • workbook_id: 工作簿ID
  • sheet_name: 工作表名称
  • cell: 单元格地址(如 "A1")

返回:

  • 单元格的值

5. write_cell

写入数据到指定单元格。

参数:

  • workbook_id: 工作簿ID
  • sheet_name: 工作表名称
  • cell: 单元格地址
  • value: 要写入的值

返回:

  • 操作结果

6. read_range

读取指定范围的单元格数据。

参数:

  • workbook_id: 工作簿ID
  • sheet_name: 工作表名称
  • start_cell: 起始单元格地址
  • end_cell: 结束单元格地址(可选)

返回:

  • 范围数据

7. write_dataframe

将数据框写入工作表。

参数:

  • workbook_id: 工作簿ID
  • sheet_name: 工作表名称
  • data: 数据框(字典列表)
  • start_cell: 起始单元格地址(默认为 "A1")

返回:

  • 操作结果

8. create_sheet

创建新的工作表。

参数:

  • workbook_id: 工作簿ID
  • sheet_name: 工作表名称

返回:

  • 操作结果

9. delete_sheet

删除工作表。

参数:

  • workbook_id: 工作簿ID
  • sheet_name: 工作表名称

返回:

  • 操作结果

10. save_workbook_file

保存工作簿到文件。

参数:

  • workbook_id: 工作簿ID
  • file_path: 文件路径

返回:

  • 操作结果

11. close_workbook

关闭工作簿并从缓存中移除。

参数:

  • workbook_id: 工作簿ID

返回:

  • 操作结果

12. list_workbooks

列出所有已打开的工作簿。

参数: 无

返回:

  • 工作簿ID列表

13. get_sheet_info

获取工作表信息。

参数:

  • workbook_id: 工作簿ID
  • sheet_name: 工作表名称

返回:

  • 工作表信息

14. set_formula

设置单元格公式。

参数:

  • workbook_id: 工作簿ID
  • sheet_name: 工作表名称
  • cell: 单元格地址
  • formula: 公式字符串

返回:

  • 操作结果

技术栈

  • FastMCP: 用于构建 MCP 服务器
  • Openpyxl: 用于操作 Excel 文件

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xlsx_mcp_server-0.1.1.tar.gz (48.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xlsx_mcp_server-0.1.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file xlsx_mcp_server-0.1.1.tar.gz.

File metadata

  • Download URL: xlsx_mcp_server-0.1.1.tar.gz
  • Upload date:
  • Size: 48.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for xlsx_mcp_server-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8a583c32f5ff63c2d8f0aed92a182564b2b798bc6cc3ac434825b662f6a1059f
MD5 5f7f7c72e2b1adb105a644c9310d96ef
BLAKE2b-256 b3cefa772f8e262f32c4de5e5f48911ee5d2bd77efb83f740452aaed60f56c38

See more details on using hashes here.

File details

Details for the file xlsx_mcp_server-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for xlsx_mcp_server-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7ab2561292c017ebdd243a5b5c5a23bcf9fefaeaa24f804fa60d56a1bb2b7b6f
MD5 1421574aa63b7c51f9f185ad0ff43ed3
BLAKE2b-256 6ff273d931ddeb2c9287977e0c4395b2ec3a714b079f418f38b5c9d990a8287d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page