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

mcp-excel-assistant

v1.0.0

Published

Enterprise Excel/CSV data processing MCP server - Read, analyze, clean, write and visualize data with Claude

Readme

MCP Excel Assistant

企业级 Excel/CSV 数据处理 MCP 服务器,为 Claude 提供强大的数据分析能力。

功能特性

  • 📊 数据读取 - 支持 Excel (.xlsx, .xls) 和 CSV 文件
  • 🔍 数据分析 - 求和、平均值、计数、最大最小值、分组统计、排序、筛选
  • 🧹 数据清洗 - 去重、填充空值、去除空格、删除空行
  • 💾 数据写入 - 导出处理结果到 Excel/CSV,自动格式化表头
  • 📈 图表生成 - 生成 ASCII 柱状图、折线图、饼图

快速开始

安装依赖

npm install

构建项目

npm run build

配置 Claude Desktop

在 Claude Desktop 配置文件中添加:

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "excel-assistant": {
      "command": "node",
      "args": ["C:\\Users\\Administrator\\Desktop\\AI作品\\MCP2\\build\\index.js"]
    }
  }
}

注意: 将路径替换为你的实际项目路径

使用 npx (推荐)

# 发布到 npm 后可直接使用
npx mcp-excel-assistant

工具列表

1. read_excel - 读取表格

读取 Excel 或 CSV 文件,返回 JSON 格式数据。

参数:

  • filePath (必需): 文件路径
  • sheetName (可选): 工作表名称
  • range (可选): 数据范围,如 "A1:D10"

示例:

"读取 sales.xlsx 的数据"
"读取 data.csv 文件中的所有数据"

2. analyze_data - 数据分析

对数据进行统计分析。

参数:

  • filePath (必需): 文件路径
  • operation (必需): 操作类型
    • sum - 求和
    • average - 平均值
    • count - 计数
    • min - 最小值
    • max - 最大值
    • groupBy - 分组统计
    • sort - 排序
    • filter - 筛选
  • column (必需): 列名
  • groupByColumn (可选): 分组列名
  • sortOrder (可选): 排序方向 (asc/desc)
  • filterCondition (可选): 筛选条件

示例:

"计算 sales.xlsx 中销售额的总和"
"按产品分组统计销售数据"
"筛选出销售额大于 1000 的记录"

3. clean_data - 数据清洗

清洗数据,支持多种操作。

参数:

  • filePath (必需): 文件路径
  • operations (必需): 清洗操作数组
    • removeDuplicates - 去重
    • fillEmpty - 填充空值
    • trimSpaces - 去除空格
    • removeEmptyRows - 删除空行
  • fillValue (可选): 填充值,默认 0
  • uniqueColumn (可选): 去重依据列

示例:

"清洗 data.csv,去除重复行和空行"
"用 0 填充空值,并去除首尾空格"

4. write_excel - 写入文件

将数据写入 Excel 或 CSV 文件。

参数:

  • outputPath (必需): 输出文件路径
  • data (必需): 要写入的 JSON 数组
  • sheetName (可选): 工作表名称
  • preserveFormat (可选): 是否格式化,默认 true

示例:

"将清洗后的数据保存到 output.xlsx"
"导出分析结果到 report.csv"

5. generate_chart - 生成图表

根据数据生成 ASCII 图表。

参数:

  • filePath (必需): 文件路径
  • chartType (必需): 图表类型 (bar/line/pie)
  • xColumn (必需): X 轴列名
  • yColumn (必需): Y 轴列名
  • title (可选): 图表标题
  • maxBars (可选): 最大数据点数,默认 20

示例:

"生成月度销售额柱状图"
"用饼图展示各产品占比"

使用场景

教育行业

  • 学员成绩分析与排名
  • 课程数据统计报表
  • 出勤率数据处理

零售行业

  • 库存盘点数据清洗
  • 销售数据分析与趋势图
  • 产品 TOP 排行统计

文旅行业

  • 客流量数据分析
  • 预订信息整理
  • 季度收入报表生成

技术栈

  • 运行时: Node.js 18+
  • 语言: TypeScript
  • 核心库:
    • @modelcontextprotocol/sdk - MCP 官方 SDK
    • exceljs - Excel 读写
    • papaparse - CSV 解析

项目结构

mcp-excel-assistant/
├── src/
│   ├── index.ts              # MCP 服务入口
│   └── tools/                # 工具实现
│       ├── read.ts           # 读取工具
│       ├── analyze.ts        # 分析工具
│       ├── clean.ts          # 清洗工具
│       ├── write.ts          # 写入工具
│       └── chart.ts          # 图表工具
├── build/                    # 编译输出
├── package.json
├── tsconfig.json
└── README.md

开发

# 安装依赖
npm install

# 开发模式 (监听文件变化)
npm run dev

# 构建
npm run build

注意事项

  • 确保文件路径使用绝对路径或相对于工作目录的路径
  • Excel 文件默认读取第一个 sheet
  • 图表生成为 ASCII 格式,适合终端显示
  • 数据清洗操作按数组顺序依次执行

许可证

MIT


由 Claude Code 构建 🚀