derek2000139

ExcelForge

Community derek2000139
Updated

Open-source server tool based on Model Context Protocol (MCP). Supports full Excel operations, with data processing, formulas, formatting, charts, pivot tables. Flexible integration for systems & models, ideal for office automation and data services.心好累

ExcelForge

ExcelForge 是一个基于 MCP (Model Context Protocol) 的 Excel 操作工具集,让 AI 助手能够安全、高效地操作 Excel 文件。

功能特性

  • 工作簿管理 - 打开、保存、关闭 Excel 文件
  • 工作表操作 - 创建、删除、重命名、查看结构
  • 范围操作 - 读写数据、复制、清除、排序
  • 公式支持 - 验证表达式、填充范围
  • 格式设置 - 设置单元格样式、自动调整列宽
  • 备份恢复 - 文件级备份、快照回滚
  • VBA 读写访问 - 查看工程、扫描代码、同步模块、执行宏
  • 命名范围 - 列出和读取命名区域
  • 数据验证和条件格式 - 读取工作表规则

版本

当前版本: v1.0.1

系统要求

  • Windows 操作系统
  • Microsoft Excel (已安装)
  • Python 3.11+
  • pywin32

安装

pip install -e .

配置

编辑 config.yaml 文件配置:

  • server.version - 服务器版本
  • excel.visible - Excel 是否可见
  • paths.allowed_roots - 允许访问的目录
  • paths.allowed_extensions - 允许打开的文件扩展名
  • limits.* - 各种操作限制

使用

# 启动服务器
python -m excelforge serve

# 查看帮助
python -m excelforge --help

工具列表

v1.0.1 提供两种 Profile:

  • Default Profile:约 30 个工具(Trae IDE 推荐)
  • Extended Profile:约 36 个工具(全功能)

工作簿工具

  • workbook.open_file - 打开 Excel 文件
  • workbook.inspect - 列出已打开工作簿/获取工作簿信息
  • workbook.save_file - 保存工作簿
  • workbook.close_file - 关闭工作簿
  • workbook.create_file - 创建新工作簿

工作表工具

  • sheet.inspect_structure - 检查工作表结构
  • sheet.create_sheet - 创建工作表
  • sheet.rename_sheet - 重命名工作表
  • sheet.delete_sheet - 删除工作表(含预览确认)
  • sheet.set_auto_filter - 设置自动筛选
  • sheet.get_rules - 获取条件格式和数据验证

范围工具

  • range.read_values - 读取范围值
  • range.write_values - 写入范围值
  • range.clear_contents - 清除范围内容
  • range.copy_range - 复制范围
  • range.manage_rows - 插入/删除行
  • range.manage_columns - 插入/删除列
  • range.sort_data - 排序数据
  • range.merge_cells - 合并单元格
  • range.unmerge_cells - 取消合并单元格
  • range.manage_merge - 管理合并

公式工具

  • formula.fill_range - 填充公式范围
  • formula.set_single - 设置单个公式
  • formula.get_dependencies - 获取公式依赖
  • formula.repair_references - 修复引用

格式工具

  • format.manage - 设置样式/自动调整列宽

VBA 工具

  • vba.inspect_project - 检查 VBA 工程
  • vba.get_module_code - 获取模块代码
  • vba.scan_code - 安全扫描 VBA 代码
  • vba.sync_module - 同步 VBA 模块
  • vba.remove_module - 删除 VBA 模块
  • vba.execute - 执行 VBA 宏
  • vba.compile - 编译 VBA 项目

Extended Profile 额外工具

  • rollback.manage - 管理快照
  • backups.manage - 管理备份
  • audit.list_operations - 列出操作记录
  • names.inspect - 列出/读取命名范围
  • names.create - 创建命名范围
  • names.delete - 删除命名范围

服务器工具

  • server.get_status - 获取服务器状态

VBA 安全策略

  • 写入 VBA 代码必须通过安全扫描
  • 默认阻止 CRITICAL 和 HIGH 风险代码
  • MsgBox 自动替换为 Debug.Print
  • InputBox 被禁用以避免弹窗阻塞

版本历史

版本 日期 主要更新
v0.1 2026-03-22 基础读写、快照
v0.2 2026-03-23 COM 恢复、格式化
v0.3 2026-03-23 结构操作、VBA 只读
v0.4 2026-03-24 .xls 支持、排序、合并
v0.5 2026-03-24 VBA 写入、安全扫描、命名范围
v1.0.0 2026-03-24 工具组配置、简化工具链、Trae兼容
v1.0.1 2026-03-24 工具合并(workbook.inspect/format.manage)、Profile机制、健康检查

配置示例

server:
  version: "1.0.1"

excel:
  visible: true
  force_disable_macros: false

paths:
  allowed_roots:
    - "D:/ExcelForge"

tools:
  profile: "default"  # default | extended
  groups:
    core: true
    vba: true
    recovery: false
    names: false

MCP Server · Populars

MCP Server · New

    kastelldev

    Kastell

    Provision, secure, backup, and manage self-hosted servers — full lifecycle, one CLI.

    Community kastelldev
    beelzebub-labs

    Beelzebub

    A secure low code honeypot framework, leveraging AI for System Virtualization.

    Community beelzebub-labs
    onllm-dev

    onUI

    Annotate/Draw any web UI for AI agents and export structured context, no app code changes required.

    Community onllm-dev
    raphasouthall

    neurostack

    Your second brain, starting today. CLI + MCP server that helps you build, maintain, and search a knowledge vault that gets better every day. Works with any AI provider. Local-first, zero-prereq install.

    Community raphasouthall
    iamtouchskyer

    memex

    Zettelkasten-based persistent memory for AI coding agents. Works with Claude Code, Cursor, VS Code Copilot, Codex, Windsurf & any MCP client. No vector DB — just markdown + git sync.

    Community iamtouchskyer