Skip to main content
Glama

excel-mcp-live

在 Microsoft Excel 工作簿打开时对其进行编辑——AI 会附着在你已经打开的窗口上,而不是启动自己的窗口。

实时编辑 · Windows (COM) · 19 个工具


大多数 Excel MCP 服务器(包括本工作区自己的 mcp-server-excel)的工作方式是启动一个全新的、不可见的 Excel 进程,在其中打开你的文件,完成后再次关闭它。这对于脚本化自动化来说很棒,但这意味着 AI 永远不会看到你正在看的同一个窗口。

excel-mcp-live 的做法恰恰相反:它通过 COM 附着到你已经打开的任何 Excel 窗口上,使用与 word-mcp-live 的实时编辑工具相同的"查找正在运行的应用程序"方法。它从不启动 Excel,也从不关闭它——它只操作你自己打开的工作簿。

要求

  • Windows(COM 自动化仅限 Windows——本项目没有 macOS/Linux 模式)

  • 已安装 Microsoft Excel已运行并打开了一个工作簿

  • Python 3.11+

Related MCP server: mcp-server-xlwings

安装

git clone <this-repo-url>
cd excel-mcp-live
pip install -e .

或者使用 uv 直接从源码运行——无需安装步骤:

uv run excel_mcp_server.py

客户端配置(.mcp.json

将你的 MCP 客户端指向项目目录。对于 Claude Code,在项目中添加以下内容到 .mcp.json (或使用 ~/.claude.json 进行用户级配置):

{
  "mcpServers": {
    "excel-live": {
      "command": "uv",
      "args": [
        "--directory",
        "G:/Ai/MCP/excel-mcp-live",
        "run",
        "excel_mcp_server.py"
      ],
      "env": {
        "MCP_AUTHOR": "Your Name"
      }
    }
  }
}

如果你改用 pip install -e . 安装,则可以直接使用控制台脚本:

{
  "mcpServers": {
    "excel-live": {
      "command": "excel-mcp-live",
      "env": {
        "MCP_AUTHOR": "Your Name"
      }
    }
  }
}

MCP_AUTHOR 设置附加到新单元格评论上的作者名称(默认值:"Author")。

支持的函数

每个工具都作用于已在 Excel 中打开的工作簿。workbooksheet 参数几乎在所有地方都是可选的——省略它们即可针对活动工作簿 / 活动工作表。

工具

描述

工作簿

list_open_workbooks

列出所有正在运行的 Excel 窗口中打开的每个工作簿

get_workbook_info

每个工作表的名称、活动工作表及已用区域

save_workbook

就地保存(Ctrl+S)

工作表

list_worksheets

按选项卡顺序列出工作表名称

add_worksheet

添加新工作表,可选命名和定位

delete_worksheet

删除工作表

rename_worksheet

重命名工作表

activate_worksheet

切换活动选项卡

单元格与区域

get_range_values

读取单元格/区域的值

set_range_values

写入一个值、一行或一个二维值块

get_range_formulas

读取公式(A1 样式)

set_cell_formula

在单个单元格上设置公式或字面值

find_replace

在工作表或整个工作簿中查找并替换文本

clear_range

清除内容,可选包括格式

insert_rows / delete_rows

插入或删除行,将其他行向上/向下移动

insert_columns / delete_columns

插入或删除列,将其他列向左/向右移动

sort_range

按某一列对区域排序,可选保持标题行不动

格式

format_range

粗体/斜体/下划线、字体、填充颜色、数字格式、对齐、自动换行

autofit_columns

自动调整列宽

条件格式

add_conditional_format_rule

突出显示满足比较条件的单元格(大于、介于等)

add_color_scale

在区域上应用 2 色或 3 色刻度

list_conditional_format_rules

列出应用于区域的规则

clear_conditional_format_rules

移除区域中的所有规则

命名区域

list_named_ranges

列出用户定义的命名区域

read_named_range

读取命名区域的当前值

write_named_range

将值写入命名区域的左上角单元格

create_named_range

创建新的命名区域

update_named_range

将现有命名区域重新指向新地址

delete_named_range

删除命名区域

数据验证

add_dropdown_validation

将区域限制为值的下拉列表

add_number_validation

将区域限制为满足比较条件的数字

get_validation

读取单元格的验证规则

remove_validation

从区域中移除验证

合并

merge_cells / unmerge_cells

将区域合并为一个单元格,或取消合并

get_merge_info

检查单元格是否为合并区域的一部分

超链接

add_hyperlink

添加超链接(外部 URL 或内部单元格引用)

remove_hyperlink

移除单元格的超链接

list_hyperlinks

列出工作表上的所有超链接

Excel 表格

create_table

从区域创建 Excel 表格(ListObject)

list_tables

列出工作表上的表格

get_table_info

读取表格的列、区域、行数和样式

append_table_rows

在表格末尾添加一行或多行

get_table_data

将表格的数据行读取为二维数组

apply_table_style

应用内置表格样式

delete_table

移除表格的定义,保留底层数据

图表

create_chart

从区域创建图表

list_charts

列出工作表上的图表

set_chart_type

更改图表类型(柱状图、条形图、折线图、饼图、面积图、散点图、环形图)

set_chart_title

设置或清除图表标题

add_series

向图表添加数据系列

delete_chart

删除图表

评论

add_comment

添加单元格评论(批注)

get_comments

列出工作表上的评论

delete_comment

移除单元格的评论

尚未覆盖:数据透视表、Power Query、DAX、VBA——对于这些,请使用 mcp-server-excel,它会启动自己的 Excel 实例,并且操作覆盖范围更广。

示例提示

"I have this budget open in Excel — read A1:F20 and tell me if any totals look wrong."
"Add a new sheet called 'Summary' before the current one."
"Bold row 1 in the sheet I have open and give it a light gray fill."
"Find every 'Q3' in this workbook and replace it with 'Q4'."
"Set B2 to =SUM(B3:B20) and tell me what it calculates to."
"Add a comment on cell D5 asking whether this figure includes tax."

已知限制

  • 仅限 Windows。 Excel COM 自动化在 macOS/Linux 上不存在。

  • 工作簿必须已在 Excel 中打开。 此服务器不创建或打开文件——请参阅 mcp-server-excel 了解相关功能。

  • 无单次撤销分组。 Word 的 COM API 可以将多次编辑包装为一次 Ctrl+Z;Excel 则不能。 执行多次写入的工具调用(例如写入多个单元格)可能需要多次 Ctrl+Z 才能完全撤销。

  • 多个 Excel 窗口: 如果你打开了多个工作簿(可能位于不同的 Excel 进程中),请显式传递 workbook 以定位正确的工作簿——否则工具默认使用首先找到的 Excel 实例中的活动工作簿。

开发

有关架构说明和设计约束,请参阅 CLAUDE.md——特别是为什么此服务器绝不能自行启动或退出 Excel。

Install Server
F
license - not found
A
quality
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables reading and writing of values, formulas, and formatting in Microsoft Excel files including .xlsx and .xlsm formats. It supports sheet management, table creation, and provides Windows-exclusive features like live editing and screen capture.
    14,896
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables AI agents to read, write, format, and execute VBA macros in Microsoft Excel in real-time through the Model Context Protocol, connecting directly to an open Excel window via COM integration.

View all related MCP servers

Related MCP Connectors

  • Formula-backed WorkPaper tools for workbook readback, input edits, and JSON persistence.

  • Real .docx and .xlsx files from structured data, with automatic Hebrew/Arabic RTL.

  • Control Unreal Engine to browse assets, import content, and manage levels and sequences. Automate…

View all MCP Connectors

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/trustypangolin/excel-mcp-live'

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