Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Claude Stats MCPshow me the top users this month"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Claude Stats MCP - AI 使用统计分析工具
基于 MCP (Model Context Protocol) 的 Claude Code 使用统计分析工具。提供 Node.js 和 Python 两种实现方式。
🚀 快速启动(推荐)
启动 Node.js 版本
特点:
✅ 自动检查 Node.js 环境
✅ 自动安装依赖
✅ 适合本地开发
✅ STDIO 模式,可直接在 Cursor 中配置
启动 Python 版本
特点:
✅ 自动检查 Python 环境
✅ 自动创建虚拟环境
✅ 自动安装依赖
✅ 支持 STDIO 和 HTTP 两种模式
✅ 适合远程部署
启动后可选择:
STDIO 模式 - 本地使用,配合 Cursor
HTTP 模式 - 远程访问,地址:
http://localhost:8000/mcp
📦 NPX/PIPX 快速使用(推荐分发)
Node.js 版本(NPX):
Python 版本(PIPX):
详细说明: 查看 使用指南.md
📁 项目结构
🛠️ 在 Cursor 中配置
Node.js 版本配置
编辑 ~/.cursor/mcp.json 或 ~/.config/cursor/config.json:
Python 版本配置
STDIO 模式(本地)
HTTP 模式(远程)
🔧 8个可用工具
工具名称 | 功能描述 | 示例问题 |
| 查询今日统计 | "今天总共花了多少钱?" |
| 查询本月统计 | "本月使用情况怎么样?" |
| 查询特定用户 | "查询江俊锋的使用情况" |
| Top用户排行 | "使用率最高的是谁?" |
| 对比用户 | "对比江俊锋和陈雷" |
| 趋势分析 | "分析使用趋势" |
| 异常检测 | "有没有超出限额的?" |
| 生成报告 | "生成今日报告" |
✅ 快速验证
启动服务后,在 Cursor 中重启,然后尝试:
📖 详细文档
快速开始指南 - 5分钟快速体验
使用指南 - ⭐ NPX/PIPX 完整使用说明
MCP开发入门与实战 - 完整教程
部署指南 - 生产环境部署
Node.js Demo 文档 - Node.js 版详细说明
Python Demo 文档 - Python 版详细说明
🐛 故障排查
Node.js 脚本问题
Python 脚本问题
配置文件问题
确保 keys.json 文件存在且格式正确:
🔄 手动启动(不使用脚本)
Node.js
Python
🎯 技术栈
Node.js 版本
FastMCP (TypeScript)
Axios
TypeScript
Zod (类型验证)
Python 版本
FastMCP (Python)
HTTPX
Pydantic
python-dotenv
📚 相关链接
🤝 贡献
欢迎提交 Issue 和 Pull Request!
📄 License
MIT
开发愉快! 🚀
有问题?查看快速开始指南或各 Demo 的 README!