# table_reader **Repository Path**: thomacai/table_reader ## Basic Information - **Project Name**: table_reader - **Description**: 分析表格mcp - **Primary Language**: Python - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2025-11-04 - **Last Updated**: 2025-11-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # table_reader #### 介绍 Table Reader MCP 服务 - 一个基于 FastMCP 的表格文件读取和分析工具 该服务提供了强大的表格文件读取功能,支持多种常见格式(CSV、Excel、JSON),能够高效地读取指定行范围的数据和获取表格基本信息。 #### 软件架构 - **核心框架**: 基于 FastMCP 构建的 MCP (Model Context Protocol) 服务 - **数据处理**: 使用 pandas 库进行表格数据读取和处理 - **文件格式支持**: CSV、Excel (.xlsx, .xls)、JSON - **日志系统**: 内置完整的日志记录,支持文件和控制台输出 - **错误处理**: 完善的异常处理和参数验证机制 #### 安装教程 1. 确保已安装 Python 3.12+ 和 uv 包管理器 2. 克隆项目到本地 ```bash git clone https://gitee.com/thomacai/table_reader.git cd table_reader ``` 3. 安装依赖(使用 uv) ```bash uv sync ``` 4. 运行 MCP 服务 ```bash uv run python table_reader.py ``` #### 使用说明 **MCP 配置(用于 Claude Desktop 等环境):** ```json { "mcpServers": { "table-reader": { "autoApprove": [ "get_table_info", "read_table_rows" ], "disabled": false, "timeout": 60, "type": "stdio", "command": "uv", "args": [ "run", "table_reader.py" ], "cwd": "/home/dell/thomascai/codes/table_reader" } } } ``` **可用工具:** 1. **read_table_rows** - 读取表格文件的指定行范围数据 - 参数: - `file_path`: 表格文件路径 - `start_row`: 起始行号(从 0 开始) - `end_row`: 结束行号(包含该行) - 返回:指定行范围的数据内容和统计信息 2. **get_table_info** - 获取表格文件的基本信息 - 参数: - `file_path`: 表格文件路径 - 返回:文件大小、行列数、列名数据类型、前 5 行预览 **支持的文件格式:** - CSV 文件 (.csv) - Excel 文件 (.xlsx, .xls) #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)