mysheet MCP Server

by lgwanai

3 stars
198 downloads
Not rated
GitHub

About

Mysheet-mcp is a MCP Server for converting Excel files into JSON format, particularly useful for data processing when called within large models or Agents.

Details

Author
lgwanai
GitHub stars
3
Downloads
198
Categories
Other

- Converts Excel files to JSON with detailed cell type information (text, number, money, date, file, boolean)
- Supports "row-object" parsing mode where each row becomes a JSON object
- Automatically uploads embedded files to Tencent Cloud COS and replaces local paths with COS URLs
- Uses Java 21 virtual threads for concurrent file uploads, boosting performance on large files
- Provides session management (openFile, foreach, reset) for reading large Excel files in batches
- Implements an MD5‑based cache to avoid re‑parsing identical files; cached data expires after 24 hours

Install Java 21+ and Maven 3.6+, configure Tencent Cloud COS credentials and storage paths in application.yml, then start the server via ./mvnw spring-boot:run. The server exposes MCP tools (excel2Json, openFile, foreach, reset) that an AI agent can invoke to parse Excel files, manage sessions, and retrieve JSON data.

mysheet MCP 服务器

Mysheet-mcp 是一个用于将 Excel 文件转换为 JSON 格式的 MCP 服务器,特别适用于在大型模型或智能体中进行数据处理。本项目支持解析 Excel 文件,并将 Excel 中嵌入的文件自动上传到腾讯云 COS(对象存储)。

主要功能

- Excel 转 JSON:将上传的 Excel 文件转换为 JSON 格式,包含详细的单元格类型信息(文本、数字、货币、日期等)。
- 行对象模式:支持 "row-object" 解析模式,将每一行视为一个对象,支持合并单元格处理。
- 腾讯云 COS 集成:自动将 Excel 中嵌入的文件上传到腾讯云 COS,并在 JSON 输出中使用 COS URL。
- 高性能转换
- 虚拟线程并发:利用 Java 21 虚拟线程 (Virtual Threads) 技术并行上传内嵌文件,大幅提升包含大量图片/文件的 Excel 处理速度。
- 资源优化:重构解析逻辑,确保 Workbook 只打开一次,减少重复 I/O,显著降低大文件转换耗时。
- 会话管理
- 提供 openFileforeachreset 接口,支持大文件分批次读取。
- 会话状态(Session)在内存中保持 24 小时,支持断点续传和指针管理。
- 缓存机制:基于 MD5 的缓存机制,避免重复解析相同文件。
- MCP SSE 支持:提供服务器发送事件(SSE)端点用于 MCP 通信。

系统要求

- Java 21 或更高版本(必须,用于支持虚拟线程)
- Maven 3.6 或更高版本
- 腾讯云 COS 账户(用于文件存储)

安装与编译

1. 克隆项目

git clone <项目地址>
cd mysheet-mcp

2. 安装依赖

./mvnw clean install

3. 编译项目

./mvnw compile

4. 运行测试

./mvnw test

配置说明

配置文件位于 src/main/resources/application.yml,需要根据您的环境进行配置:

```yaml

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.