使用说明
Ronngcloud MCP服务器
📌 项目概述
rongcloud-server-mcp-python 是基于FastMCP框架构建的MCP服务器,集成 荣云 即时通讯服务。它支持用户管理、消息发送、组操作等。
✨ 工具
| 工具 | 说明 |
|---|---|
register_user |
通过融云注册新用户并返回用户令牌 |
get_user_info |
使用RongCloud检索用户信息 |
send_private_text_message |
发送私人消息并返回映射到每个收件人用户ID的生成消息ID |
send_group_text_message |
发送组消息并返回映射到每个目标组ID的生成消息ID |
get_private_messages |
检索指定时间范围内两个用户之间的历史私人消息 |
create_group |
在RongCloud中与指定成员创建新的群聊 |
dismiss_group |
从RongCloud中永久删除群聊 |
get_group_members |
检索RongCloud中现有群聊的完整成员列表 |
join_group |
通过融云将一个或多个用户添加到指定的群聊中 |
quit_group |
从RongCloud群聊中删除一个或多个用户 |
get_current_time_millis |
获取自Unix纪元(1970年1月1日UTC)以来的当前时间(毫秒)。 |
⚙️ 配置
🔧 环境变量
| 变量名称 | 必填 | 默认 | 描述 |
|---|---|---|---|
RONGCLOUD_APP_KEY |
✅ 是 | - | 融云应用程序密钥 |
RONGCLOUD_APP_SECRET |
✅ 是 | - | 融云应用程序密钥 |
RONGCLOUD_API_BASE |
❌ 没有 | https://api-cn.ronghub.com |
融云API基础URL |
RONGCLOUD_API_TIMEOUT |
❌ 没有 | 10 |
API请求超时(秒) |
FASTMCP_LOG_LEVEL |
❌ 没有 | WARNING |
日志级别(例如,调试、信息) |
🧪 配置示例
RONGCLOUD_APP_KEY=your_app_key
RONGCLOUD_APP_SECRET=your_app_secret
RONGCLOUD_API_BASE=https://api-cn.ronghub.com
RONGCLOUD_API_TIMEOUT=10
FASTMCP_LOG_LEVEL=WARNING
💻 Claude桌面配置
-
配置文件路径:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - 窗户:
%APPDATA%/Claude/claude_desktop_config.json
- macOS:
-
配置示例:
{
"mcpServers": {
"rongcloud-server-mcp": {
"command": "uvx",
"args": [
"rongcloud-server-mcp-python"
],
"env": {
"RONGCLOUD_APP_KEY": "your_app_key",
"RONGCLOUD_APP_SECRET": "your_app_secret",
"RONGCLOUD_API_BASE": "https://api-cn.ronghub.com",
"RONGCLOUD_API_TIMEOUT": "10"
}
}
}
}
🧑💻 开发指南
🚀 快速开始
-
克隆存储库并输入项目目录:
git clone https://github.com/your-username/rcloud-server-mcp-python.git cd rcloud-server-mcp-python -
复制示例环境文件并编辑变量:
cp .env.example .env编辑
.env要设置的文件:RONGCLOUD_APP_KEY=your_app_key RONGCLOUD_APP_SECRET=your_app_secret RONGCLOUD_API_BASE=https://api-cn.ronghub.com FASTMCP_LOG_LEVEL=INFO -
创建虚拟环境、安装依赖项并启动开发服务器:
make venv make sync make install make dev
💡 跑
make help查看所有可用命令。
✅ 运行测试
make test # Run all tests
make lint # Check code style and quality
make fix # Auto-fix formatting issues
🤝 贡献指南
欢迎投稿!请按照以下步骤操作:
- 分叉存储库
- 创建要素分支:
git checkout -b feature/YourFeature - 提交您的更改:
git commit -m 'Add YourFeature' - 按下分支:
git push origin feature/YourFeature - 打开拉取请求
提交前请确保以下事项:
- 无错误
make lint- 所有测试均通过
make test- 代码格式正确
make format
📄 许可证
该项目根据 MIT许可证.