cloudbase-platform by tencentcloudbase/skills
npx skills add https://github.com/tencentcloudbase/skills --skill cloudbase-platform当你需要了解 CloudBase 平台知识 时,请使用此技能:
此技能提供适用于所有 CloudBase 项目的基础知识,无论它们是 Web 应用、小程序还是后端服务。
envQuery 工具获取环境 IDauth 工具支持设备码登录,因此可以交互式获取凭证广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
config/mcporter.json 中添加 CloudBase MCP 服务器:如果已存在其他 MCP 服务器,请保留它们,仅添加 cloudbase 条目。
{
"mcpServers": {
"cloudbase": {
"command": "npx",
"args": ["@cloudbase/cloudbase-mcp@latest"],
"description": "CloudBase MCP",
"lifecycle": "keep-alive"
}
}
}
npx mcporter list — 列出已配置的服务器npx mcporter describe cloudbase --all-parameters — 检查 CloudBase 服务器配置并获取包含所有参数的完整工具模式(⚠️ 必须加--all-parameters 才能获取完整参数信息)npx mcporter list cloudbase --schema — 获取所有 CloudBase 工具的完整 JSON 模式npx mcporter call cloudbase.help --output json — 发现可用的 CloudBase 工具及其模式npx mcporter call cloudbase.auth action=status --output jsonnpx mcporter call cloudbase.auth action=start_auth authMode=device --output jsonnpx mcporter call cloudbase.auth action=set_env envId=env-xxx --output jsongetWebsiteConfig 工具获取/ 结尾envQuery 工具查询环境 IDimport cloudbase from "@cloudbase/js-sdk"; const app = cloudbase.init({ env: "xxxx-yyy" });import("@cloudbase/js-sdk") 或带有内部 initPromise 的异步包装器如 initCloudBase()重要:不同平台的身份验证方法完全不同,必须严格区分!
auth.getVerification() 进行短信登录,详情请参考 Web 身份验证相关文档auth.getCurrentUser() 获取用户信息wxContext.OPENIDpackage.json,声明所需的依赖项manageFunctions(action="createFunction") 创建函数manageFunctions(action="updateFunctionCode") 部署云函数functionRootPath 指的是函数目录的父目录,例如 cloudfunctions 目录⚠️ 关键:在编写数据库操作代码之前,务必先配置权限!
ADMINWRITE 或 ADMINONLY 进行写操作创建集合 → 配置安全规则 → 编写代码 → 测试
writeSecurityRule MCP 工具配置权限no-sql-web-sdk/security-rules.md 获取详细示例READONLY(管理员通过云函数管理)CUSTOM 并检查 auth.uid(用户管理自己的购物车)CUSTOM 并进行所有权验证PRIVATE 或 ADMINONLY@cloudbase/wx-cloud-client-sdk,初始化 const client = initHTTPOverCallFunction(wx.cloud),使用 client.models@cloudbase/node-sdk@3.10+,初始化 const app = cloudbase.init({env}),使用 app.models@cloudbase/js-sdk,初始化 const app = cloudbase.init({env}),登录后使用 app.modelsmanageDataModel 工具来:
db.collection('model_name').get()app.models.model_name.list({ filter: { where: {} } })manageDataModel 工具的 docs 方法获取具体的 SDK 用法创建/部署资源后,提供相应的控制台管理页面链接。所有控制台 URL 遵循以下模式:https://tcb.cloud.tencent.com/dev?envId=${envId}#/{path}
https://tcb.cloud.tencent.com/dev?envId=${envId}#/overview
https://tcb.cloud.tencent.com/dev?envId=${envId}#/template
https://tcb.cloud.tencent.com/dev?envId=${envId}#/db/doc
https://tcb.cloud.tencent.com/dev?envId=${envId}#/db/doc/collection/${collectionName}
https://tcb.cloud.tencent.com/dev?envId=${envId}#/db/doc/model/${modelName}
https://tcb.cloud.tencent.com/dev?envId=${envId}#/db/mysql
https://tcb.cloud.tencent.com/dev?envId=${envId}#/db/mysql/table/default/
https://tcb.cloud.tencent.com/dev?envId=${envId}#/scf
https://tcb.cloud.tencent.com/dev?envId=${envId}#/scfhttps://tcb.cloud.tencent.com/dev?envId=${envId}#/scf/detail?id=${functionName}&NameSpace=${envId}
https://tcb.cloud.tencent.com/dev?envId=${envId}#/cloudrun
https://tcb.cloud.tencent.com/dev?envId=${envId}#/storage
https://tcb.cloud.tencent.com/dev?envId=${envId}#/ai
https://tcb.cloud.tencent.com/dev?envId=${envId}#/hosting
https://console.cloud.tencent.com/tcb/hostinghttps://tcb.cloud.tencent.com/dev?envId=${envId}#/identity
https://tcb.cloud.tencent.com/dev?envId=${envId}#/identity/login-manage
https://tcb.cloud.tencent.com/dev?envId=${envId}#/identity/token-management
https://tcb.cloud.tencent.com/dev?envId=${envId}#/weida
https://tcb.cloud.tencent.com/dev?envId=${envId}#/logs
https://tcb.cloud.tencent.com/dev?envId=${envId}#/settings
https://tcb.cloud.tencent.com/dev?envId=${envId}#/{path}${envId} 替换为通过 envQuery 工具查询到的实际环境 ID在引导用户访问控制台页面时:
每周安装数
596
代码仓库
GitHub 星标数
38
首次出现
Jan 22, 2026
安全审计
安装于
opencode522
codex520
gemini-cli512
github-copilot499
kimi-cli488
amp486
Use this skill for CloudBase platform knowledge when you need to:
This skill provides foundational knowledge that applies to all CloudBase projects, regardless of whether they are Web, Mini Program, or backend services.
Understand platform differences
Follow best practices
Use correct SDKs and APIs
envQuery tool to get environment IDUse CloudBase MCP via mcporter (CLI) when IDE MCP is not available
You do not need to hard-code Secret ID / Secret Key / Env ID in config
CloudBase MCP will support device-code login via the auth tool, so credentials can be obtained interactively
Add CloudBase MCP server in config/mcporter.json: If other MCP servers already exist, keep them and only add the cloudbase entry.
{
"mcpServers": {
"cloudbase": {
"command": "npx",
"args": ["@cloudbase/cloudbase-mcp@latest"],
"description": "CloudBase MCP",
"lifecycle": "keep-alive"
}
}
}
Discover tools and schemas:
npx mcporter list — list configured serversnpx mcporter describe cloudbase --all-parameters — inspect CloudBase server config and get full tool schemas with all parameters (⚠️ )Static Hosting vs Cloud Storage :
Static Hosting Domain :
getWebsiteConfig tool/envQuery toolimport cloudbase from "@cloudbase/js-sdk"; const app = cloudbase.init({ env: "xxxx-yyy" });import("@cloudbase/js-sdk") or async wrappers such as initCloudBase() with internal initPromiseImportant: Authentication methods for different platforms are completely different, must strictly distinguish!
auth.getVerification(), for detailed, refer to web auth related docsauth.getCurrentUser()wxContext.OPENID via wx-server-sdkpackage.json, declaring required dependenciesmanageFunctions(action="createFunction") to create functionsmanageFunctions(action="updateFunctionCode") to deploy cloud functionsfunctionRootPath refers to the parent directory of function directories, e.g., cloudfunctions directory⚠️ CRITICAL: Always configure permissions BEFORE writing database operation code!
Permission Model :
Platform Compatibility (CRITICAL):
ADMINWRITE or ADMINONLY for write operationsConfiguration Workflow :
Create collection → Configure security rules → Write code → Test
Get Data Model Operation Object :
@cloudbase/wx-cloud-client-sdk, initialize const client = initHTTPOverCallFunction(wx.cloud), use client.models@cloudbase/node-sdk@3.10+, initialize const app = cloudbase.init({env}), use app.models@cloudbase/js-sdk, initialize const app = cloudbase.init({env}), after login use After creating/deploying resources, provide corresponding console management page links. All console URLs follow the pattern: https://tcb.cloud.tencent.com/dev?envId=${envId}#/{path}
Overview (概览) : https://tcb.cloud.tencent.com/dev?envId=${envId}#/overview
Template Center (模板中心) : https://tcb.cloud.tencent.com/dev?envId=${envId}#/template
Document Database (文档型数据库) : https://tcb.cloud.tencent.com/dev?envId=${envId}#/db/doc
https://tcb.cloud.tencent.com/dev?envId=${envId}#/db/doc/collection/${collectionName}
* Configure authentication methods and user management
* **Login Management** : `https://tcb.cloud.tencent.com/dev?envId=${envId}#/identity/login-manage`
* Enable/disable login methods (SMS, Email, Username/Password, WeChat, Custom Login)
* Configure SMS/Email templates
* Manage security domain whitelist
* **Token Management** : `https://tcb.cloud.tencent.com/dev?envId=${envId}#/identity/token-management`
* Manage API Keys and Publishable Keys
* View and manage access tokens
11. Weida Low-Code (微搭低代码) : https://tcb.cloud.tencent.com/dev?envId=${envId}#/weida
* Access Weida low-code development platform
* Build applications using visual drag-and-drop interface
12. Logs & Monitoring (日志监控): https://tcb.cloud.tencent.com/dev?envId=${envId}#/logs
* View logs from cloud functions, CloudRun services, and other resources
* Monitor resource usage, performance metrics, and error rates
* Set up alerts and notifications
13. Environment Settings (环境配置) : https://tcb.cloud.tencent.com/dev?envId=${envId}#/settings
* Configure environment-level settings
* Manage security domains and CORS settings
* Configure environment variables and secrets
* View environment information and resource quotas
https://tcb.cloud.tencent.com/dev?envId=${envId}#/{path}${envId} with the actual environment ID queried via envQuery toolWhen directing users to console pages:
Weekly Installs
596
Repository
GitHub Stars
38
First Seen
Jan 22, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode522
codex520
gemini-cli512
github-copilot499
kimi-cli488
amp486
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
106,200 周安装
竞争对手研究指南:SEO、内容、反向链接与定价分析工具
231 周安装
Azure 工作负载自动升级评估工具 - 支持 Functions、App Service 计划与 SKU 迁移
231 周安装
Kaizen持续改进方法论:软件开发中的渐进式优化与防错设计实践指南
231 周安装
软件UI/UX设计指南:以用户为中心的设计原则、WCAG可访问性与平台规范
231 周安装
Apify 网络爬虫和自动化平台 - 无需编码抓取亚马逊、谷歌、领英等网站数据
231 周安装
llama.cpp 中文指南:纯 C/C++ LLM 推理,CPU/非 NVIDIA 硬件优化部署
231 周安装
--all-parameters 才能获取完整参数信息npx mcporter list cloudbase --schema — get full JSON schema for all CloudBase toolsnpx mcporter call cloudbase.help --output json — discover available CloudBase tools and their schemasCall CloudBase tools (auth flow examples):
npx mcporter call cloudbase.auth action=status --output jsonnpx mcporter call cloudbase.auth action=start_auth authMode=device --output jsonnpx mcporter call cloudbase.auth action=set_env envId=env-xxx --output jsonwriteSecurityRule MCP tool to configure permissionsno-sql-web-sdk/security-rules.md for detailed examplesCommon Scenarios :
READONLY (admin manages via cloud functions)CUSTOM with auth.uid check (users manage their own)CUSTOM with ownership validationPRIVATE or ADMINONLYCross-Collection Operations :
Cloud Function Optimization :
app.modelsData Model Query :
manageDataModel tool to:
MySQL Data Model Invocation Rules :
db.collection('model_name').get()app.models.model_name.list({ filter: { where: {} } })manageDataModel tool's docs method to get specific SDK usagehttps://tcb.cloud.tencent.com/dev?envId=${envId}#/db/doc/model/${modelName}
MySQL Database (MySQL 数据库) : https://tcb.cloud.tencent.com/dev?envId=${envId}#/db/mysql
https://tcb.cloud.tencent.com/dev?envId=${envId}#/db/mysql/table/default/
Cloud Functions (云函数) : https://tcb.cloud.tencent.com/dev?envId=${envId}#/scf
https://tcb.cloud.tencent.com/dev?envId=${envId}#/scfhttps://tcb.cloud.tencent.com/dev?envId=${envId}#/scf/detail?id=${functionName}&NameSpace=${envId}
CloudRun (云托管) : https://tcb.cloud.tencent.com/dev?envId=${envId}#/cloudrun
Cloud Storage (云存储) : https://tcb.cloud.tencent.com/dev?envId=${envId}#/storage
AI+ : https://tcb.cloud.tencent.com/dev?envId=${envId}#/ai
Static Website Hosting (静态网站托管) : https://tcb.cloud.tencent.com/dev?envId=${envId}#/hosting
https://console.cloud.tencent.com/tcb/hostingIdentity Authentication (身份认证) : https://tcb.cloud.tencent.com/dev?envId=${envId}#/identity