Name | cloud-mcp-libro JSON |
Version |
1.0.4
JSON |
| download |
home_page | None |
Summary | Cloud Platform MCP Server - Provides access to backend APIs through MCP protocol |
upload_time | 2025-07-25 08:33:27 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT License Copyright (c) 2025 limo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
ai
api
assistant
cloud
mcp
protocol
server
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Cloud Platform MCP Server
> **📦 Now Available on PyPI!** Install with: `uvx cloud-mcp-libro`
A Model Context Protocol (MCP) server for cloud platform backend APIs. Enables seamless integration with AI assistants and tools through standardized MCP protocol.
## 🚀 Quick Start
### Install and Run (Recommended)
```bash
# Install and run directly with uvx
uvx cloud-mcp-libro
# Or install globally
pip install cloud-mcp-libro
cloud-mcp-server
```
### Environment Configuration
Set required environment variables before running:
```bash
# Windows
set CLOUD_USERNAME=your-email@example.com
set CLOUD_PASSWORD=your-password
set CLOUD_BASE_URL=http://localhost:8080
set CLOUD_TIMEZONE=Asia/Shanghai
set CLOUD_AREA=CN
set CLOUD_COUNTRY=China
# Linux/Mac
export CLOUD_USERNAME=your-email@example.com
export CLOUD_PASSWORD=your-password
export CLOUD_BASE_URL=http://localhost:8080
export CLOUD_TIMEZONE=Asia/Shanghai
export CLOUD_AREA=CN
export CLOUD_COUNTRY=China
```
## 📋 Features
- `authenticate_user`: 用户认证 ✅ **已验证工作正常**
- `get_user_profile`: 获取用户资料 ✅ **已修复,使用正确端点**
- `get_device_list`: 获取绑定设备列表 ✅ **新增功能**
- `manual_feeding`: 手动喂食控制 ✅ **新增功能**
- `add_feeding_plan`: 添加喂食计划 ✅ **新增功能**
- `get_feeding_plan_list`: 查看喂食计划列表 ✅ **新增功能**
- `remove_feeding_plan`: 删除指定喂食计划 ✅ **新增功能**
- `call_api`: 调用任意API接口 ✅ **可用于探索其他API**
## ✅ 认证状态
**认证功能已完全正常工作!**
### 成功的配置
- **URL**: `https://demo-api.dl-aiot.com`
- **必需头部**: `source: IOS`, `version: 1.0.0`, `language: ZH`
- **返回成功码**: `0` (不是200)
- **Token获取**: 成功获取并管理token
### 测试结果
```json
{
"code": 0,
"msg": null,
"data": {
"token": "xxx",
"clientId": "APP_189012631",
"memberId": 189012631,
"account": "limo.yu@designlibro.com",
"email": "limo.yu@designlibro.com",
"country": "China"
}
}
```
## ✅ 编码修复说明
如果之前遇到类似这样的乱码:
```
INFO:cloud-mcp:֤Ӧ״̬: 200
INFO:cloud-mcp:֤Ӧ: {'code': 1002, 'msg': 'ӦIDΪ', 'data': None}
```
现在会正确显示为:
```
INFO:cloud-mcp:认证响应状态: 200
INFO:cloud-mcp:认证响应: {'code': 200, 'msg': '登录成功', 'data': {...}}
```
## 🔍 故障排除
### 编码问题
**当前版本使用英文日志,已解决所有乱码问题**
如果需要中文日志且出现乱码:
1. 使用中文版本:`python server_chinese_backup.py`
2. 设置编码:`chcp 65001 && set PYTHONIOENCODING=utf-8`
3. 或使用启动脚本:`start.bat`
### JSON通信问题
如果遇到JSON解析错误:
1. 确保没有print语句输出到stdout
2. 所有日志和调试信息应输出到stderr
3. 运行 `python verify_fixes.py` 验证修复
## 🧪 验证修复
运行验证脚本确保所有问题已修复:
```bash
python verify_fixes.py
```
应该看到所有测试通过:
```
🎉 所有测试通过!MCP服务器已准备就绪
💡 现在可以安全地启动MCP服务器了
```
## 文件说明
- `server.py`: 主MCP服务器(英文日志,推荐使用)
- `server_chinese_backup.py`: 中文日志版本的备份
- `test_final.py`: 最终测试脚本
- `ENCODING_FIX_FINAL.md`: 完整的问题解决方案文档
## 作者
- **作者**: limo
- **日期**: 2025-01-01
## 版本历史
- v1.0.0: 初始版本,支持基本MCP功能
- v1.1.0: 修复JSON通信问题
- v1.2.0: 完全解决中文乱码问题(使用英文日志)
Raw data
{
"_id": null,
"home_page": null,
"name": "cloud-mcp-libro",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "limo <limo.yu@designlibro.com>",
"keywords": "ai, api, assistant, cloud, mcp, protocol, server",
"author": null,
"author_email": "limo <limo.yu@designlibro.com>",
"download_url": "https://files.pythonhosted.org/packages/0e/e6/b61879cbd35345db628f59e5c847bc3a0126f5fbd97690ec22f551796dc2/cloud_mcp_libro-1.0.4.tar.gz",
"platform": null,
"description": "# Cloud Platform MCP Server\n\n> **\ud83d\udce6 Now Available on PyPI!** Install with: `uvx cloud-mcp-libro`\n\nA Model Context Protocol (MCP) server for cloud platform backend APIs. Enables seamless integration with AI assistants and tools through standardized MCP protocol.\n\n## \ud83d\ude80 Quick Start\n\n### Install and Run (Recommended)\n\n```bash\n# Install and run directly with uvx\nuvx cloud-mcp-libro\n\n# Or install globally\npip install cloud-mcp-libro\ncloud-mcp-server\n```\n\n### Environment Configuration\n\nSet required environment variables before running:\n\n```bash\n# Windows\nset CLOUD_USERNAME=your-email@example.com\nset CLOUD_PASSWORD=your-password\nset CLOUD_BASE_URL=http://localhost:8080\nset CLOUD_TIMEZONE=Asia/Shanghai\nset CLOUD_AREA=CN\nset CLOUD_COUNTRY=China\n\n# Linux/Mac\nexport CLOUD_USERNAME=your-email@example.com\nexport CLOUD_PASSWORD=your-password\nexport CLOUD_BASE_URL=http://localhost:8080\nexport CLOUD_TIMEZONE=Asia/Shanghai\nexport CLOUD_AREA=CN\nexport CLOUD_COUNTRY=China\n```\n\n## \ud83d\udccb Features\n\n- `authenticate_user`: \u7528\u6237\u8ba4\u8bc1 \u2705 **\u5df2\u9a8c\u8bc1\u5de5\u4f5c\u6b63\u5e38**\n- `get_user_profile`: \u83b7\u53d6\u7528\u6237\u8d44\u6599 \u2705 **\u5df2\u4fee\u590d\uff0c\u4f7f\u7528\u6b63\u786e\u7aef\u70b9**\n- `get_device_list`: \u83b7\u53d6\u7ed1\u5b9a\u8bbe\u5907\u5217\u8868 \u2705 **\u65b0\u589e\u529f\u80fd**\n- `manual_feeding`: \u624b\u52a8\u5582\u98df\u63a7\u5236 \u2705 **\u65b0\u589e\u529f\u80fd**\n- `add_feeding_plan`: \u6dfb\u52a0\u5582\u98df\u8ba1\u5212 \u2705 **\u65b0\u589e\u529f\u80fd**\n- `get_feeding_plan_list`: \u67e5\u770b\u5582\u98df\u8ba1\u5212\u5217\u8868 \u2705 **\u65b0\u589e\u529f\u80fd**\n- `remove_feeding_plan`: \u5220\u9664\u6307\u5b9a\u5582\u98df\u8ba1\u5212 \u2705 **\u65b0\u589e\u529f\u80fd**\n- `call_api`: \u8c03\u7528\u4efb\u610fAPI\u63a5\u53e3 \u2705 **\u53ef\u7528\u4e8e\u63a2\u7d22\u5176\u4ed6API**\n\n## \u2705 \u8ba4\u8bc1\u72b6\u6001\n\n**\u8ba4\u8bc1\u529f\u80fd\u5df2\u5b8c\u5168\u6b63\u5e38\u5de5\u4f5c\uff01** \n\n### \u6210\u529f\u7684\u914d\u7f6e\n- **URL**: `https://demo-api.dl-aiot.com`\n- **\u5fc5\u9700\u5934\u90e8**: `source: IOS`, `version: 1.0.0`, `language: ZH`\n- **\u8fd4\u56de\u6210\u529f\u7801**: `0` (\u4e0d\u662f200)\n- **Token\u83b7\u53d6**: \u6210\u529f\u83b7\u53d6\u5e76\u7ba1\u7406token\n\n### \u6d4b\u8bd5\u7ed3\u679c\n```json\n{\n \"code\": 0,\n \"msg\": null,\n \"data\": {\n \"token\": \"xxx\",\n \"clientId\": \"APP_189012631\",\n \"memberId\": 189012631,\n \"account\": \"limo.yu@designlibro.com\",\n \"email\": \"limo.yu@designlibro.com\",\n \"country\": \"China\"\n }\n}\n```\n\n## \u2705 \u7f16\u7801\u4fee\u590d\u8bf4\u660e\n\n\u5982\u679c\u4e4b\u524d\u9047\u5230\u7c7b\u4f3c\u8fd9\u6837\u7684\u4e71\u7801\uff1a\n```\nINFO:cloud-mcp:\u05a4\u04e6\u05f4\u032c: 200\nINFO:cloud-mcp:\u05a4\u04e6: {'code': 1002, 'msg': '\u04e6ID\u03aa', 'data': None}\n```\n\n\u73b0\u5728\u4f1a\u6b63\u786e\u663e\u793a\u4e3a\uff1a\n```\nINFO:cloud-mcp:\u8ba4\u8bc1\u54cd\u5e94\u72b6\u6001: 200\nINFO:cloud-mcp:\u8ba4\u8bc1\u54cd\u5e94: {'code': 200, 'msg': '\u767b\u5f55\u6210\u529f', 'data': {...}}\n```\n\n## \ud83d\udd0d \u6545\u969c\u6392\u9664\n\n### \u7f16\u7801\u95ee\u9898\n**\u5f53\u524d\u7248\u672c\u4f7f\u7528\u82f1\u6587\u65e5\u5fd7\uff0c\u5df2\u89e3\u51b3\u6240\u6709\u4e71\u7801\u95ee\u9898**\n\n\u5982\u679c\u9700\u8981\u4e2d\u6587\u65e5\u5fd7\u4e14\u51fa\u73b0\u4e71\u7801\uff1a\n1. \u4f7f\u7528\u4e2d\u6587\u7248\u672c\uff1a`python server_chinese_backup.py`\n2. \u8bbe\u7f6e\u7f16\u7801\uff1a`chcp 65001 && set PYTHONIOENCODING=utf-8`\n3. \u6216\u4f7f\u7528\u542f\u52a8\u811a\u672c\uff1a`start.bat`\n\n### JSON\u901a\u4fe1\u95ee\u9898\n\u5982\u679c\u9047\u5230JSON\u89e3\u6790\u9519\u8bef\uff1a\n1. \u786e\u4fdd\u6ca1\u6709print\u8bed\u53e5\u8f93\u51fa\u5230stdout\n2. \u6240\u6709\u65e5\u5fd7\u548c\u8c03\u8bd5\u4fe1\u606f\u5e94\u8f93\u51fa\u5230stderr\n3. \u8fd0\u884c `python verify_fixes.py` \u9a8c\u8bc1\u4fee\u590d\n\n## \ud83e\uddea \u9a8c\u8bc1\u4fee\u590d\n\n\u8fd0\u884c\u9a8c\u8bc1\u811a\u672c\u786e\u4fdd\u6240\u6709\u95ee\u9898\u5df2\u4fee\u590d\uff1a\n```bash\npython verify_fixes.py\n```\n\n\u5e94\u8be5\u770b\u5230\u6240\u6709\u6d4b\u8bd5\u901a\u8fc7\uff1a\n```\n\ud83c\udf89 \u6240\u6709\u6d4b\u8bd5\u901a\u8fc7\uff01MCP\u670d\u52a1\u5668\u5df2\u51c6\u5907\u5c31\u7eea\n\ud83d\udca1 \u73b0\u5728\u53ef\u4ee5\u5b89\u5168\u5730\u542f\u52a8MCP\u670d\u52a1\u5668\u4e86\n```\n\n## \u6587\u4ef6\u8bf4\u660e\n\n- `server.py`: \u4e3bMCP\u670d\u52a1\u5668\uff08\u82f1\u6587\u65e5\u5fd7\uff0c\u63a8\u8350\u4f7f\u7528\uff09\n- `server_chinese_backup.py`: \u4e2d\u6587\u65e5\u5fd7\u7248\u672c\u7684\u5907\u4efd\n- `test_final.py`: \u6700\u7ec8\u6d4b\u8bd5\u811a\u672c\n- `ENCODING_FIX_FINAL.md`: \u5b8c\u6574\u7684\u95ee\u9898\u89e3\u51b3\u65b9\u6848\u6587\u6863\n\n## \u4f5c\u8005\n\n- **\u4f5c\u8005**: limo\n- **\u65e5\u671f**: 2025-01-01\n\n## \u7248\u672c\u5386\u53f2\n\n- v1.0.0: \u521d\u59cb\u7248\u672c\uff0c\u652f\u6301\u57fa\u672cMCP\u529f\u80fd\n- v1.1.0: \u4fee\u590dJSON\u901a\u4fe1\u95ee\u9898\n- v1.2.0: \u5b8c\u5168\u89e3\u51b3\u4e2d\u6587\u4e71\u7801\u95ee\u9898\uff08\u4f7f\u7528\u82f1\u6587\u65e5\u5fd7\uff09 ",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2025 limo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Cloud Platform MCP Server - Provides access to backend APIs through MCP protocol",
"version": "1.0.4",
"project_urls": {
"Changelog": "https://github.com/DesignLibro/cloud-mcp-libro/releases",
"Documentation": "https://github.com/DesignLibro/cloud-mcp-libro/blob/master/README.md",
"Homepage": "https://github.com/DesignLibro/cloud-mcp-libro",
"Issues": "https://github.com/DesignLibro/cloud-mcp-libro/issues",
"Repository": "https://github.com/DesignLibro/cloud-mcp-libro"
},
"split_keywords": [
"ai",
" api",
" assistant",
" cloud",
" mcp",
" protocol",
" server"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "04f7e5d4d695d798d6c4c6ba0b32556b808a1ba2e8e55df89512c4b9b7cbb474",
"md5": "1e6913037c3bd2fd99a001ddaeac5b00",
"sha256": "561c7978c7eeb4f6eb68329b20139b11413652877107832930e27782935a9e99"
},
"downloads": -1,
"filename": "cloud_mcp_libro-1.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1e6913037c3bd2fd99a001ddaeac5b00",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 19183,
"upload_time": "2025-07-25T08:33:26",
"upload_time_iso_8601": "2025-07-25T08:33:26.007143Z",
"url": "https://files.pythonhosted.org/packages/04/f7/e5d4d695d798d6c4c6ba0b32556b808a1ba2e8e55df89512c4b9b7cbb474/cloud_mcp_libro-1.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "0ee6b61879cbd35345db628f59e5c847bc3a0126f5fbd97690ec22f551796dc2",
"md5": "ea6fbd27811f19a7430f8c4b68f58897",
"sha256": "920cf502fcedb0610039aa4b65da35a5d5c5910ece7813934b09f95a11f48622"
},
"downloads": -1,
"filename": "cloud_mcp_libro-1.0.4.tar.gz",
"has_sig": false,
"md5_digest": "ea6fbd27811f19a7430f8c4b68f58897",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 10083,
"upload_time": "2025-07-25T08:33:27",
"upload_time_iso_8601": "2025-07-25T08:33:27.364061Z",
"url": "https://files.pythonhosted.org/packages/0e/e6/b61879cbd35345db628f59e5c847bc3a0126f5fbd97690ec22f551796dc2/cloud_mcp_libro-1.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-25 08:33:27",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "DesignLibro",
"github_project": "cloud-mcp-libro",
"github_not_found": true,
"lcname": "cloud-mcp-libro"
}