Excel

haris-musa
4244
无需安装Excel即可通过AI创建、读取和修改Excel文件,支持公式、图表、数据透视表及格式设置等高级操作。

内容

Excel 29

一个用于操作Excel文件的MCP服务器,无需安装Excel。

upload_excel_file

上传Excel文件到服务器进行处理 参数: - file_url: Excel文件的URL地址(支持 .xlsx, .xls 格式) 返回: - file_id: 文件唯一标识,后续操作时使用此ID 使用示例: upload_excel_file(file_url="https://example.com/data.xlsx")

参数 (1)
file_url string 必需

download_excel_file

下载处理完成的Excel文件,获取下载链接 参数: - file_id: 文件唯一标识(通过 upload_excel_file 或 create_workbook 获取) 返回: - 文件下载URL 使用示例: download_excel_file(file_id="a1b2c3d4")

参数 (1)
file_id string 必需

list_excel_files

列出当前用户所有缓存的Excel文件 返回: - 文件列表,包含 file_id 和文件信息 使用示例: list_excel_files()

此工具无需参数

delete_excel_file

删除指定的Excel文件 参数: - file_id: 要删除的文件ID 返回: - 删除结果 使用示例: delete_excel_file(file_id="a1b2c3d4")

参数 (1)
file_id string 必需

apply_formula

在单元格中应用Excel公式 参数: - file_id: 文件ID - sheet_name: 工作表名称 - cell: 单元格地址(如 "A1") - formula: Excel公式(如 "=SUM(A1:A10)") 返回: - 操作结果和file_id

参数 (4)
file_id string 必需

sheet_name string 必需

cell string 必需

formula string 必需

validate_formula_syntax

验证Excel公式语法(不应用) 参数: - file_id: 文件ID - sheet_name: 工作表名称 - cell: 单元格地址 - formula: 要验证的公式

参数 (4)
file_id string 必需

sheet_name string 必需

cell string 必需

formula string 必需

format_range

格式化单元格范围 参数: - file_id: 文件ID - sheet_name: 工作表名称 - start_cell: 起始单元格 - end_cell: 结束单元格(可选) - bold: 是否加粗 - italic: 是否斜体 - underline: 是否下划线 - font_size: 字体大小 - font_color: 字体颜色(如 "FF0000") - bg_color: 背景颜色 - border_style: 边框样式 - border_color: 边框颜色 - number_format: 数字格式 - alignment: 对齐方式 - wrap_text: 是否自动换行 - merge_cells: 是否合并单元格

参数 (18)
file_id string 必需

sheet_name string 必需

start_cell string 必需

end_cell string 可选

bold boolean 可选

italic boolean 可选

underline boolean 可选

font_size string 可选

font_color string 可选

bg_color string 可选

border_style string 可选

border_color string 可选

number_format string 可选

alignment string 可选

wrap_text boolean 可选

merge_cells boolean 可选

protection string 可选

conditional_format string 可选

read_data_from_excel

读取Excel工作表数据 参数: - file_id: 文件ID - sheet_name: 工作表名称 - start_cell: 起始单元格(默认 "A1") - end_cell: 结束单元格(可选,不提供则自动扩展) - preview_only: 是否只返回预览 返回: - JSON格式的单元格数据,包含地址、值、行、列和验证信息

参数 (5)
file_id string 必需

sheet_name string 必需

start_cell string 可选

end_cell string 可选

preview_only boolean 可选

write_data_to_excel

写入数据到Excel工作表 参数: - file_id: 文件ID - sheet_name: 工作表名称 - data: 二维列表数据,子列表为行 - start_cell: 起始单元格(默认 "A1") 使用示例: write_data_to_excel( file_id="a1b2c3d4", sheet_name="Sheet1", data=[["姓名", "年龄"], ["张三", 25], ["李四", 30]], start_cell="A1" )

参数 (4)
file_id string 必需

sheet_name string 必需

data array 必需

start_cell string 可选

create_workbook

创建新的Excel工作簿 参数: - filename: 文件名(默认 "new_workbook.xlsx") 返回: - file_id: 新建文件的唯一标识 使用示例: create_workbook(filename="sales_report.xlsx") 创建完成,使用download_excel_file(file_id)工具,给用户返回下载地址。

参数 (1)
filename string 可选

create_worksheet

在工作簿中创建新的工作表 参数: - file_id: 文件ID - sheet_name: 新工作表名称

参数 (2)
file_id string 必需

sheet_name string 必需

create_chart

在工作表中创建图表 参数: - file_id: 文件ID - sheet_name: 工作表名称 - data_range: 数据范围(如 "A1:D10") - chart_type: 图表类型(bar, line, pie, scatter 等) - target_cell: 图表放置位置 - title: 图表标题 - x_axis: X轴标签 - y_axis: Y轴标签

参数 (8)
file_id string 必需

sheet_name string 必需

data_range string 必需

chart_type string 必需

target_cell string 必需

title string 可选

x_axis string 可选

y_axis string 可选

create_pivot_table

创建数据透视表 参数: - file_id: 文件ID - sheet_name: 工作表名称 - data_range: 数据范围 - rows: 行字段列表 - values: 值字段列表 - columns: 列字段列表(可选) - agg_func: 聚合函数(mean, sum, count 等)

参数 (7)
file_id string 必需

sheet_name string 必需

data_range string 必需

rows array 必需

values array 必需

columns string 可选

agg_func string 可选

create_table

从指定数据范围创建Excel表格 参数: - file_id: 文件ID - sheet_name: 工作表名称 - data_range: 数据范围 - table_name: 表格名称(可选) - table_style: 表格样式(默认 "TableStyleMedium9")

参数 (5)
file_id string 必需

sheet_name string 必需

data_range string 必需

table_name string 可选

table_style string 可选

copy_worksheet

复制工作表 参数: - file_id: 文件ID - source_sheet: 源工作表名称 - target_sheet: 目标工作表名称

参数 (3)
file_id string 必需

source_sheet string 必需

target_sheet string 必需

delete_worksheet

删除工作表 参数: - file_id: 文件ID - sheet_name: 要删除的工作表名称

参数 (2)
file_id string 必需

sheet_name string 必需

rename_worksheet

重命名工作表 参数: - file_id: 文件ID - old_name: 原工作表名称 - new_name: 新工作表名称

参数 (3)
file_id string 必需

old_name string 必需

new_name string 必需

get_workbook_metadata

获取工作簿元数据,包括工作表列表、范围等信息 参数: - file_id: 文件ID - include_ranges: 是否包含范围信息

参数 (2)
file_id string 必需

include_ranges boolean 可选

merge_cells

合并单元格范围 参数: - file_id: 文件ID - sheet_name: 工作表名称 - start_cell: 起始单元格 - end_cell: 结束单元格

参数 (4)
file_id string 必需

sheet_name string 必需

start_cell string 必需

end_cell string 必需

unmerge_cells

取消合并单元格 参数: - file_id: 文件ID - sheet_name: 工作表名称 - start_cell: 起始单元格 - end_cell: 结束单元格

参数 (4)
file_id string 必需

sheet_name string 必需

start_cell string 必需

end_cell string 必需

get_merged_cells

获取工作表中所有合并的单元格 参数: - file_id: 文件ID - sheet_name: 工作表名称

参数 (2)
file_id string 必需

sheet_name string 必需

copy_range

复制单元格范围到另一个位置 参数: - file_id: 文件ID - sheet_name: 源工作表名称 - source_start: 源范围起始单元格 - source_end: 源范围结束单元格 - target_start: 目标起始单元格 - target_sheet: 目标工作表名称(可选,默认为源工作表)

参数 (6)
file_id string 必需

sheet_name string 必需

source_start string 必需

source_end string 必需

target_start string 必需

target_sheet string 可选

delete_range

删除单元格范围并移动剩余单元格 参数: - file_id: 文件ID - sheet_name: 工作表名称 - start_cell: 起始单元格 - end_cell: 结束单元格 - shift_direction: 移动方向("up" 或 "left")

参数 (5)
file_id string 必需

sheet_name string 必需

start_cell string 必需

end_cell string 必需

shift_direction string 可选

validate_excel_range

验证范围是否存在且格式正确 参数: - file_id: 文件ID - sheet_name: 工作表名称 - start_cell: 起始单元格 - end_cell: 结束单元格(可选)

参数 (4)
file_id string 必需

sheet_name string 必需

start_cell string 必需

end_cell string 可选

get_data_validation_info

获取工作表中所有数据验证规则 参数: - file_id: 文件ID - sheet_name: 工作表名称

参数 (2)
file_id string 必需

sheet_name string 必需

insert_rows

插入行 参数: - file_id: 文件ID - sheet_name: 工作表名称 - start_row: 起始行号 - count: 插入行数(默认 1)

参数 (4)
file_id string 必需

sheet_name string 必需

start_row integer 必需

count integer 可选

insert_columns

插入列 参数: - file_id: 文件ID - sheet_name: 工作表名称 - start_col: 起始列号 - count: 插入列数(默认 1)

参数 (4)
file_id string 必需

sheet_name string 必需

start_col integer 必需

count integer 可选

delete_sheet_rows

删除行 参数: - file_id: 文件ID - sheet_name: 工作表名称 - start_row: 起始行号 - count: 删除行数(默认 1)

参数 (4)
file_id string 必需

sheet_name string 必需

start_row integer 必需

count integer 可选

delete_sheet_columns

删除列 参数: - file_id: 文件ID - sheet_name: 工作表名称 - start_col: 起始列号 - count: 删除列数(默认 1)

参数 (4)
file_id string 必需

sheet_name string 必需

start_col integer 必需

count integer 可选