npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tanskong/office-mcp

v2.0.3

Published

Office Suite MCP服务器 - Excel+Word统一办公套件(37个工具) - v2.0.3修复版

Readme

Office MCP - Excel实时办公助手

通过MCP协议让AI助手(Trae)操作Excel文件,实现智能办公自动化。

功能特性

  • 实时操作:Excel保持打开状态,边操作边查看
  • 批量处理:支持批量读写、格式设置、公式操作
  • 图片识别:提取Excel中的图片,支持多模态识别
  • 工作表管理:增删改查工作表
  • 表格美化:自动格式化、颜色设置、对齐方式
  • 许可证认证:密钥激活,绑定设备

快速开始

方式一:使用安装器(推荐)

  1. 下载 智能办公助手v6.0.exe
  2. 双击运行,输入 License Key
  3. 完成安装,重启 Trae
  4. 右键桌面"智能办公助手"文件夹 → 使用 Trae 打开
  5. 开始使用

方式二:手动安装

1. 安装依赖

pip install fastmcp pywin32

2. 激活 License

npm cache clean --force
set OFFICE_MCP_LICENSE=你的KEY && npx -y @tanskong/office-mcp@latest activate

看到 [OK] Activation Successful! 即表示成功。

3. 配置 Trae

在项目文件夹中创建 .trae/mcp.json

{
  "mcpServers": {
    "office-mcp": {
      "command": "npx",
      "args": ["-y", "@tanskong/office-mcp@latest"],
      "env": {
        "OFFICE_MCP_LICENSE": "你的KEY"
      }
    }
  }
}

工具列表(23个)

| 分类 | 工具 | 功能 | |------|------|------| | 工作簿生命周期 | workbook_file | 创建/打开工作簿 | | | save_workbook | 保存工作簿 | | | export_to_pdf | 导出PDF | | 工作表管理 | sheet_manage | 添加/删除工作表 | | | copy_sheet | 复制工作表 | | 数据读取 | read_cell | 读取单元格 | | | get_excel_data | 获取区域数据 | | | get_selection | 获取当前选择 | | 数据写入 | write_data | 写入数据(支持cells/rows模式,自动识别) | | 格式操作 | set_format | 设置区域格式(背景色、字体色、粗体、字号、对齐) | | | get_format | 获取单元格/区域格式 | | | auto_format_table | 自动美化表格 | | | set_dimension | 设置行高/列宽(支持批量) | | 公式 | create_formula | 创建公式(支持单个/批量) | | | fill_formula | 填充公式(向下/向右) | | 结构修改 | modify_rows_columns | 插入/删除行列 | | | merge_cells | 合并/取消合并单元格 | | | create_table | 创建结构化表格 | | 图片与导出 | list_sheet_images | 列出图片 | | | extract_images_from_excel | 提取图片 | | | delete_sheet_image | 删除图片 | | | screen_capture | 截图功能 | | 信息查询 | get_workbook_info | 获取工作簿信息 |

高效使用示例

批量设置格式(一次调用替代多次)

set_format("Sheet1", "A1:D1", 
    color="blue",           # 背景色
    font_color="white",     # 字体色
    bold=True,              # 粗体
    font_size=12,           # 字号
    horizontal="center",    # 水平对齐
    vertical="center"       # 垂直对齐
)

批量写入数据

# rows模式 - 写入多行
data = [["姓名", "年龄"], ["张三", 25], ["李四", 30]]
write_data("Sheet1", data, start_cell="A1", mode="rows")

# cells模式 - 写入特定单元格
cells_data = {"A1": "标题", "B1": 100, "C1": "完成"}
write_data("Sheet1", cells_data, mode="cells")

# 自动识别模式
write_data("Sheet1", {"A1": "标题", "B1": 100})  # 自动识别为cells模式
write_data("Sheet1", [["标题", "数值"], ["数据1", 100]], "A1")  # 自动识别为rows模式

合并/取消合并单元格

merge_cells("Sheet1", "A1:D1", "merge")     # 合并
merge_cells("Sheet1", "A1:D1", "unmerge")   # 取消合并

公式创建与填充

# 创建单个公式
create_formula("Sheet1", "E2", "=C2*D2")

# 批量创建公式
create_formula("Sheet1", {"E2": "=C2*D2", "E3": "=C3*D3", "E4": "=C4*D4"})

# 向下填充公式
fill_formula("Sheet1", "E2", 100, "down")   # 从E2填充到E100

工作簿操作

# 创建工作簿
workbook_file("create", "C:/test.xlsx")

# 打开工作簿
workbook_file("open", "C:/test.xlsx")

# 添加工作表
sheet_manage("add", "Sheet2")

# 删除工作表
sheet_manage("delete", "Sheet2")

开发

# 安装依赖
npm install

# 本地调试
npm run dev

# 发布
npm version patch
npm publish

版本历史

| 版本 | 日期 | 更新内容 | |------|------|----------| | 1.0.83 | 2026-05-30 | 工具合并优化至21个:set_range_*→set_format, batch_write_cells/batch_write_rows→write_data, create_formula/batch_create_formulas→create_formula, fill_formula_down→fill_formula, get_cell_format/get_range_format→get_format | | 1.0.82 | 2026-05-30 | 工具合并优化版 | | 1.0.81 | 2026-05-29 | 安装器重构为项目级配置 | | 1.0.80 | 2026-05-28 | 修复 Unicode 编码错误 | | 1.0.78 | 2026-05-28 | 工具合并优化,42→37个 |

许可证

MIT