{ "name": "cloudbase-mcp", "version": "1.8.1", "description": "腾讯云开发 MCP Server,支持静态托管/环境查询/云函数/云数据库等功能", "tools": [ { "name": "auth", "description": "CloudBase(腾讯云开发)开发阶段登录与环境绑定。登录后即可访问云资源;环境(env)是云函数、数据库、静态托管等资源的隔离单元,绑定环境后其他 MCP 工具才能操作该环境。支持:查询状态、发起登录、绑定环境(set_env)、退出登录。", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "status", "start_auth", "set_env", "logout", "get_temp_credentials" ], "description": "动作:status=查询状态,start_auth=发起登录,set_env=绑定环境(传envId),logout=退出登录" }, "authMode": { "type": "string", "enum": [ "device", "web" ], "description": "认证模式:device=设备码授权,web=浏览器回调授权" }, "oauthEndpoint": { "type": "string", "description": "高级可选:自定义 device-code 登录 endpoint。配置后 oauthCustom 默认按 true 处理" }, "clientId": { "type": "string", "description": "高级可选:自定义 device-code 登录 client_id,不传则使用默认值" }, "oauthCustom": { "type": "boolean", "description": "高级可选:自定义 endpoint 返回格式开关。未配置 endpoint 时默认 false;配置 endpoint 后默认 true,且不能设为 false" }, "envId": { "type": "string", "description": "环境ID(CloudBase 环境唯一标识),绑定后工具将操作该环境。action=set_env 时必填" }, "confirm": { "type": "string", "const": "yes", "description": "action=logout 时确认操作,传 yes" }, "reveal": { "type": "boolean", "description": "action=get_temp_credentials 时可选。true=返回明文临时密钥;默认 false 仅返回脱敏结果" } }, "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "envQuery", "description": "查询云开发环境相关信息,支持查询环境列表、指定环境详情和安全域名。(原工具名:listEnvs/getEnvInfo/getEnvAuthDomains,为兼容旧AI规则可继续使用这些名称)当 action=list 时,会按 DescribeEnvs 语义做列表/筛选,标准返回字段为 EnvId、Alias、Status、EnvType、Region、PackageId、PackageName、IsDefault,并支持通过 fields 白名单裁剪这些字段;aliasExact=true 时会按别名精确筛选,避免把前缀相近的环境误当作候选;即使传入 envId,action=list 也只返回摘要,不会返回完整资源明细或 expiry。如需查询某个已知 EnvId 对应环境的详细信息(包括资源字段和计费信息),必须使用 action=info 并传入目标环境的 envId 参数。action=info 会在可用时补充 BillingInfo(如 ExpireTime、PayMode、IsAutoRenew 等计费字段)。", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "list", "info", "domains" ], "description": "查询类型:list=环境列表/摘要筛选(按 DescribeEnvs 语义筛选,支持通过 envId 筛选,返回 EnvId、Alias、Status、EnvType、Region、PackageId、PackageName、IsDefault,不支持 expiry),info=指定环境的详细信息(必须传入 envId,返回资源字段和计费信息),domains=安全域名列表" }, "alias": { "type": "string", "description": "按环境别名筛选。action=list 时可选" }, "aliasExact": { "type": "boolean", "description": "按环境别名精确筛选。action=list 时可选;与 alias 配合使用" }, "envId": { "type": "string", "description": "按环境 ID 筛选。action=list 时可选(仅按 DescribeEnvs 语义做筛选,仍返回摘要);action=info 时必填(返回该环境的详细信息,包含资源字段和计费信息)。如果任务已经给出了明确的 EnvId 并要求查询详情,请直接使用 action=info + envId,而不是 action=list" }, "limit": { "type": "integer", "exclusiveMinimum": 0, "description": "返回数量上限。action=list 时可选" }, "offset": { "type": "integer", "minimum": 0, "description": "分页偏移。action=list 时可选" }, "fields": { "type": "array", "items": { "type": "string", "enum": [ "EnvId", "Alias", "Status", "EnvType", "Region", "PackageId", "PackageName", "IsDefault" ] }, "description": "返回字段白名单。仅支持 EnvId、Alias、Status、EnvType、Region、PackageId、PackageName、IsDefault。action=list 时可选" } }, "required": [ "action" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "envDomainManagement", "description": "管理云开发环境的安全域名(安全域名 / CORS 白名单),支持添加和删除操作。(原工具名:createEnvDomain/deleteEnvDomain,为兼容旧AI规则可继续使用这些名称)当浏览器 Web 应用需要从本地 Vite / dev server 直接访问 CloudBase 资源时,应先用 envQuery(action=domains) 检查当前实际浏览器 origin 对应的 host:port 是否已在白名单中,再按该实际值添加。新增或删除后通常需要继续轮询 envQuery(action=domains) 确认状态收敛;安全域名一般约 10 分钟生效。⚠️ 重要:此工具仅用于 CORS/请求来源验证,不涉及 SSL 证书。如需绑定自定义域名供公网 HTTPS 访问,请使用 manageGateway(action=\"bindCustomDomain\")。", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "create", "delete" ], "description": "操作类型:create=添加安全域名,delete=删除安全域名" }, "domains": { "type": "array", "items": { "type": "string" }, "description": "安全域名数组(格式:host:port,例如 localhost:5173 或 127.0.0.1:4173)。注意:不是自定义域名,不需要证书。" } }, "required": [ "action", "domains" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "readNoSqlDatabaseStructure", "description": "读取 NoSQL 数据库集合与索引结构,支持列出集合、查看集合详情、列出索引以及检查索引是否存在。本工具为服务端管理工具,用于管理端查询数据库结构,不用于编写客户端代码。", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "listCollections", "describeCollection", "checkCollection", "listIndexes", "checkIndex" ], "description": "listCollections: 列出集合列表\ndescribeCollection: 描述集合详情(会返回索引摘要)\ncheckCollection: 检查集合是否存在\nlistIndexes: 列出指定集合的索引列表\ncheckIndex: 检查指定索引是否存在" }, "limit": { "type": "number", "description": "返回数量限制(listCollections 操作时可选)" }, "offset": { "type": "number", "description": "偏移量(listCollections 操作时可选)" }, "collectionName": { "type": "string", "description": "集合名称(describeCollection、listIndexes、checkIndex 操作时必填)" }, "indexName": { "type": "string", "description": "索引名称(checkIndex 操作时必填)" } }, "required": [ "action" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "writeNoSqlDatabaseStructure", "description": "创建、删除和管理 NoSQL 数据库集合(collection)。支持创建新集合、删除现有集合,以及通过 updateCollection 的 updateOptions.CreateIndexes / updateOptions.DropIndexes 添加索引和删除索引。当需要新建集合时,使用 action=createCollection。本工具为服务端管理工具,用于管理端操作集合和索引结构,不用于编写客户端代码。", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "createCollection", "updateCollection", "deleteCollection" ], "description": "createCollection: 创建集合\nupdateCollection: 更新集合配置;添加索引请传 updateOptions.CreateIndexes,删除索引请传 updateOptions.DropIndexes\ndeleteCollection: 删除集合" }, "collectionName": { "type": "string", "description": "集合名称" }, "updateOptions": { "type": "object", "properties": { "CreateIndexes": { "type": "array", "items": { "type": "object", "properties": { "IndexName": { "type": "string", "description": "要创建的索引名称" }, "MgoKeySchema": { "type": "object", "properties": { "MgoIsUnique": { "type": "boolean", "description": "是否唯一索引" }, "MgoIndexKeys": { "type": "array", "items": { "type": "object", "properties": { "Name": { "type": "string", "description": "索引字段名" }, "Direction": { "type": "string", "description": "索引方向,通常 1 表示升序,-1 表示降序" } }, "required": [ "Name", "Direction" ], "additionalProperties": false }, "description": "索引字段列表,支持单字段或复合索引" } }, "required": [ "MgoIsUnique", "MgoIndexKeys" ], "additionalProperties": false, "description": "待创建索引的字段与约束配置" } }, "required": [ "IndexName", "MgoKeySchema" ], "additionalProperties": false }, "description": "要添加的索引列表" }, "DropIndexes": { "type": "array", "items": { "type": "object", "properties": { "IndexName": { "type": "string", "description": "要删除的索引名称" } }, "required": [ "IndexName" ], "additionalProperties": false }, "description": "要删除的索引列表" } }, "additionalProperties": false, "description": "更新选项(updateCollection 时使用)。CreateIndexes 用于添加索引,DropIndexes 用于删除索引。" } }, "required": [ "action", "collectionName" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "readNoSqlDatabaseContent", "description": "查询并获取 NoSQL 数据库数据记录。⚠️ 本工具为服务端管理工具,用于管理端/运维端查询。当任务要求编写客户端应用代码时(例如「用 JS SDK 读取数据」),不应使用本工具,而应在项目代码中编写 @cloudbase/js-sdk 客户端代码(如 db.collection().where().get())。", "inputSchema": { "type": "object", "properties": { "collectionName": { "type": "string", "description": "集合名称" }, "instanceId": { "type": "string", "description": "可选:显式指定数据库实例ID;未传时会自动解析并缓存" }, "query": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": true }, { "type": "string" } ], "description": "查询条件(对象或字符串,推荐对象)" }, "projection": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": true }, { "type": "string" } ], "description": "返回字段投影(对象或字符串,推荐对象)" }, "sort": { "anyOf": [ { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string", "description": "sort 字段名" }, "direction": { "type": "number", "description": "排序方向,1:升序,-1:降序" } }, "required": [ "key", "direction" ], "additionalProperties": true } }, { "type": "string" } ], "description": "排序条件,仅支持数组 [{\"key\":\"createdAt\",\"direction\":-1}] 或对应 JSON 字符串。" }, "limit": { "type": "number", "description": "返回数量限制" }, "offset": { "type": "number", "description": "跳过的记录数" } }, "required": [ "collectionName" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "writeNoSqlDatabaseContent", "description": "修改 NoSQL 数据库数据记录。⚠️ 本工具为服务端管理工具,用于管理端/运维端操作(如后台脚本、数据迁移、批量修改)。当任务要求编写客户端应用代码时(例如「用 JS SDK 登录并插入数据」、「在前端读写数据库」),不应使用本工具,而应在项目代码中编写 @cloudbase/js-sdk 客户端代码(如 app.database().collection().add()、db.collection().where().get() 等)。可按 MongoDB updateOne/updateMany 的心智模型理解:部分更新必须使用 `$set`、`$inc`、`$push` 等更新操作符;如果直接传「字段到值的普通对象」这类内容,底层会把它当作替换内容,存在覆盖整条文档的风险。⚠️ 嵌套对象部分更新务必使用点号路径:要更新 `shipping.city`,应传 `$set: {\"shipping.city\": \"guangzhou\"}`,绝不能传 `$set: {\"shipping\": {\"city\": \"guangzhou\"}}`(后者会丢失 shipping 下的其他字段)。若集合中的角色/档案文档会在前端通过 `db.collection(...).doc(uid)` 读取,请确保文档 `_id` 就是该 `uid`;不要用按 `uid` 条件查询再配合 `upsert=true` 的方式去更新 `users` / `profiles`,否则经常会生成一个不同的 `_id`,导致后续 `doc(uid)` 读取命中不到。", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "insert", "update", "delete" ], "description": "insert: 插入数据(新增文档)\nupdate: 更新数据\ndelete: 删除数据" }, "collectionName": { "type": "string", "description": "集合名称" }, "instanceId": { "type": "string", "description": "可选:显式指定数据库实例ID;未传时会自动解析并缓存" }, "documents": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": true }, "description": "要插入的文档对象数组,每个文档都是对象(insert 操作必填)" }, "query": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": true }, { "type": "string" } ], "description": "查询条件(对象或字符串,推荐对象)(update/delete 操作必填)" }, "update": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": true }, { "type": "string" } ], "description": "更新内容(对象或字符串,推荐对象)(update 操作必填)。按 MongoDB 更新语义传入 MgoUpdate:部分更新请使用 `$set`、`$inc`、`$unset`、`$push` 等操作符,例如使用 `$set` 更新 `status`;不要直接传\"字段到值的普通对象\",否则可能替换整条文档。\n\n⚠️ 嵌套字段必须用点号路径(如 `shipping.city`),禁止整对象替换:\n- ❌ 错误:{ \"$set\": { \"shipping\": { \"city\": \"guangzhou\" } } } — shipping 被整块替换,原有 address/province 等字段全部丢失\n- ✅ 正确:{ \"$set\": { \"shipping.city\": \"guangzhou\" } } — 仅更新 city,shipping 下其他字段保留" }, "isMulti": { "type": "boolean", "description": "是否更新多条记录(update/delete 操作可选)" }, "upsert": { "type": "boolean", "description": "是否在不存在时插入(update 操作可选)" } }, "required": [ "action", "collectionName" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "querySqlDatabase", "description": "Query SQL database information. Supports read-only SQL execution, MySQL provisioning result lookup, MySQL task status lookup, and current instance context discovery.", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "runQuery", "describeCreateResult", "describeTaskStatus", "getInstanceInfo" ], "description": "runQuery=execute read-only SQL; describeCreateResult=query CreateMySQL result; describeTaskStatus=query MySQL task status; getInstanceInfo=get current SQL instance context" }, "sql": { "type": "string", "description": "Read-only SQL used by action=runQuery" }, "request": { "type": "object", "additionalProperties": {}, "description": "Official request payload used by describeCreateResult/describeTaskStatus" }, "dbInstance": { "type": "object", "properties": { "instanceId": { "type": "string" }, "schema": { "type": "string" } }, "additionalProperties": false, "description": "Optional SQL database instance context for runQuery" } }, "required": [ "action" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "manageSqlDatabase", "description": "Manage SQL database resources. Supports MySQL provisioning, MySQL destruction, write SQL/DDL execution, and schema initialization. IMPORTANT: MySQL must be provisioned first (action=provisionMySQL with confirm=true) before any runStatement or initializeSchema call. If MySQL is not yet provisioned, the tool will return MYSQL_NOT_CREATED with a nextAction to provision first.", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "provisionMySQL", "destroyMySQL", "runStatement", "initializeSchema" ], "description": "provisionMySQL=create MySQL instance; destroyMySQL=destroy MySQL instance; runStatement=execute write SQL or DDL; initializeSchema=run ordered schema initialization statements" }, "confirm": { "type": "boolean", "description": "Explicit confirmation required for action=provisionMySQL or action=destroyMySQL" }, "sql": { "type": "string", "description": "SQL statement used by action=runStatement" }, "request": { "type": "object", "additionalProperties": {}, "description": "Official request payload used by action=provisionMySQL or action=destroyMySQL" }, "statements": { "type": "array", "items": { "type": "string" }, "description": "Ordered schema initialization SQL statements used by action=initializeSchema" }, "requireReady": { "type": "boolean", "description": "Whether initializeSchema should block until MySQL is confirmed ready. Defaults to true." }, "statusContext": { "type": "object", "properties": { "createResultRequest": { "type": "object", "additionalProperties": {} }, "taskStatusRequest": { "type": "object", "additionalProperties": {} } }, "additionalProperties": false, "description": "Optional provisioning status requests used to confirm readiness before initializeSchema" }, "dbInstance": { "type": "object", "properties": { "instanceId": { "type": "string" }, "schema": { "type": "string" } }, "additionalProperties": false, "description": "Optional SQL database instance context for runStatement/initializeSchema" } }, "required": [ "action" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "manageDataModel", "description": "数据模型查询工具,支持查询和列表数据模型(只读操作)。通过 action 参数区分操作类型:list=获取模型列表(不含Schema,可选 names 参数过滤),get=查询单个模型详情(含Schema字段列表、格式、关联关系等,需要提供 name 参数),docs=生成SDK使用文档(需要提供 name 参数)", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "get", "list", "docs" ], "description": "操作类型:get=查询单个模型(含Schema字段列表、格式、关联关系,需要提供 name 参数),list=获取模型列表(不含Schema,可选 names 参数过滤),docs=生成SDK使用文档(需要提供 name 参数)" }, "name": { "type": "string", "description": "要查询的数据模型名称。当 action='get' 或 action='docs' 时,此参数为必填项,必须提供已存在的数据模型名称。可通过 action='list' 操作获取可用的模型名称列表" }, "names": { "type": "array", "items": { "type": "string" }, "description": "模型名称数组(list操作时可选,用于过滤)" } }, "required": [ "action" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "modifyDataModel", "description": "基于Mermaid classDiagram创建数据模型。为保持兼容性,工具名仍为 modifyDataModel;当前仅支持创建新模型,不支持更新现有模型结构。内置异步任务监控,自动轮询直至完成或超时。", "inputSchema": { "type": "object", "properties": { "mermaidDiagram": { "type": "string", "description": "Mermaid classDiagram代码,描述数据模型结构。\n示例:\nclassDiagram\n class Student {\n name: string <<姓名>>\n age: number = 18 <<年龄>>\n gender: x-enum = \"男\" <<性别>>\n classId: string <<班级ID>>\n identityId: string <<身份ID>>\n course: Course[] <<课程>>\n required() [\"name\"]\n unique() [\"name\"]\n enum_gender() [\"男\", \"女\"]\n display_field() \"name\"\n }\n class Class {\n className: string <<班级名称>>\n display_field() \"className\"\n }\n class Course {\n name: string <<课程名称>>\n students: Student[] <<学生>>\n display_field() \"name\"\n }\n class Identity {\n number: string <<证件号码>>\n display_field() \"number\"\n }\n\n %% 关联关系\n Student \"1\" --> \"1\" Identity : studentId\n Student \"n\" --> \"1\" Class : student2class\n Student \"n\" --> \"m\" Course : course\n Student \"n\" <-- \"m\" Course : students\n %% 类的命名\n note for Student \"学生模型\"\n note for Class \"班级模型\"\n note for Course \"课程模型\"\n note for Identity \"身份模型\"\n" }, "action": { "type": "string", "enum": [ "create" ], "default": "create", "description": "操作类型:create=创建新模型" }, "publish": { "type": "boolean", "default": false, "description": "是否立即发布模型" }, "dbInstanceType": { "type": "string", "default": "MYSQL", "description": "数据库实例类型" } }, "required": [ "mermaidDiagram" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "queryFunctions", "description": "函数域统一只读入口。通过更自解释的 action 查询 CloudBase 云函数列表、函数详情、执行日志、层、触发器和代码下载地址。\n\n**分页说明**:`listFunctions`、`listLayers` 支持 `limit` 和 `offset` 参数。\n- `limit`: 分页数量,默认值由后端决定\n- `offset`: 分页偏移,从 0 开始\n- 示例:`queryFunctions(action=\"listFunctions\", offset=10, limit=10)`\n\n**查询 CloudBase 云函数日志**:使用 `action=\"listFunctionLogs\"`,需要提供 `functionName` 参数。\n- 示例:`queryFunctions(action=\"listFunctionLogs\", functionName=\"my-function\")`\n- 如需查看日志详情:`queryFunctions(action=\"getFunctionLogDetail\", requestId=\"xxx\")`\n\n**定时任务 / cron / 定时跑**:使用 `listFunctionTriggers` 查询函数的 timer 触发器配置。\n\n**区分 `queryLogs` 工具**:\n- 本工具用于查询特定 CloudBase 云函数的执行日志\n- `queryLogs` 工具用于搜索 CLS 日志服务(跨服务日志聚合)", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "listFunctions", "getFunctionDetail", "listFunctionLogs", "getFunctionLogDetail", "listFunctionLayers", "listLayers", "listLayerVersions", "getLayerVersionDetail", "listFunctionTriggers", "getFunctionDownloadUrl" ], "description": "只读操作类型:\n- `listFunctions`: 列出所有 CloudBase 云函数\n- `getFunctionDetail`: 获取 CloudBase 云函数详情(需要 functionName)\n- `listFunctionLogs`: 查询 CloudBase 云函数执行日志(需要 functionName)\n- `getFunctionLogDetail`: 获取日志详情(需要 requestId)\n- `listFunctionLayers`: 列出函数绑定的层\n- `listLayers`: 列出所有层\n- `listLayerVersions`: 列出层的版本(注意:是 Versions 不是 Version)\n- `getLayerVersionDetail`: 获取层版本详情\n- `listFunctionTriggers`: 列出函数触发器(用于查看定时任务 / cron / timer 配置)\n- `getFunctionDownloadUrl`: 获取函数代码下载地址" }, "functionName": { "type": "string", "description": "CloudBase 云函数名称。`getFunctionDetail`、`listFunctionLogs`、`listFunctionLayers`、`listFunctionTriggers`、`getFunctionDownloadUrl` 时必填" }, "limit": { "type": "number", "description": "分页数量(limit)。列表类 action 可选,默认值由后端决定" }, "offset": { "type": "number", "description": "分页偏移(offset)。列表类 action 可选,默认 0" }, "codeSecret": { "type": "string", "description": "代码保护密钥,用于解密函数代码" }, "startTime": { "type": "string", "description": "日志查询开始时间,格式必须为 YYYY-MM-DD HH:mm:ss(如 2024-01-01 00:00:00)。与 endTime 间隔不能超过一天。不传时默认查询最近一天" }, "endTime": { "type": "string", "description": "日志查询结束时间,格式必须为 YYYY-MM-DD HH:mm:ss(如 2024-01-01 23:59:59)。与 startTime 间隔不能超过一天。不传时默认为当前时间" }, "requestId": { "type": "string", "description": "日志请求 ID。`getFunctionLogDetail` 操作必填,可从 `listFunctionLogs` 结果中获取" }, "qualifier": { "type": "string", "description": "函数版本别名,如 $LATEST、$DEFAULT。日志查询时可选" }, "runtime": { "type": "string", "description": "层查询的运行时筛选,如 Nodejs18.15" }, "searchKey": { "type": "string", "description": "层名称搜索关键字" }, "layerName": { "type": "string", "description": "层名称。`listLayerVersions`、`getLayerVersionDetail` 操作必填" }, "layerVersion": { "type": "number", "description": "层版本号。`getLayerVersionDetail` 操作必填" } }, "required": [ "action" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "manageFunctions", "description": "函数域统一写入口。支持创建函数、更新代码、更新配置、调用函数、管理定时跑 / 定时任务 / scheduled job 的 timer 触发器和层绑定。如果要创建 cron 定时任务,先用 createFunction 创建函数,再用 createFunctionTrigger 创建 timer 触发器(支持7段cron表达式),deleteFunctionTrigger 删除触发器。危险操作需要显式 confirm=true。", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "createFunction", "updateFunctionCode", "updateFunctionConfig", "invokeFunction", "deleteFunction", "createFunctionTrigger", "deleteFunctionTrigger", "createLayerVersion", "deleteLayerVersion", "attachLayer", "detachLayer", "updateFunctionLayers" ], "description": "写操作类型,例如 createFunction、updateFunctionCode、invokeFunction、deleteFunction、createFunctionTrigger(定时任务 / cron / timer)、deleteFunctionTrigger、attachLayer、detachLayer" }, "func": { "type": "object", "properties": { "name": { "type": "string", "description": "函数名称" }, "type": { "type": "string", "enum": [ "Event", "HTTP" ], "description": "函数类型" }, "protocolType": { "type": "string", "enum": [ "HTTP", "WS" ], "description": "HTTP 云函数协议类型" }, "protocolParams": { "type": "object", "properties": { "wsParams": { "type": "object", "properties": { "idleTimeOut": { "type": "number", "description": "WebSocket 空闲超时时间(秒)" } }, "additionalProperties": false } }, "additionalProperties": false }, "instanceConcurrencyConfig": { "type": "object", "properties": { "dynamicEnabled": { "type": "boolean" }, "maxConcurrency": { "type": "number" } }, "additionalProperties": false }, "timeout": { "type": "number", "description": "函数超时时间" }, "envVariables": { "type": "object", "additionalProperties": { "type": "string" }, "description": "环境变量" }, "vpc": { "type": "object", "properties": { "vpcId": { "type": "string" }, "subnetId": { "type": "string" } }, "required": [ "vpcId", "subnetId" ], "additionalProperties": false, "description": "私有网络配置" }, "runtime": { "type": "string", "description": "运行时环境。Event 函数支持多种运行时:\n Nodejs: Nodejs20.19, Nodejs18.15, Nodejs16.13, Nodejs14.18, Nodejs12.16, Nodejs10.15, Nodejs8.9\n Python: Python3.10, Python3.9, Python3.7, Python3.6, Python2.7\n Php: Php8.0, Php7.4, Php7.2\n Java: Java8, Java11\n Golang: Golang1\n\n推荐运行时:\n Node.js: Nodejs18.15\n Python: Python3.9\n PHP: Php7.4\n Java: Java11\n Go: Golang1" }, "triggers": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "触发器名称" }, "type": { "type": "string", "enum": [ "timer" ], "description": "触发器类型" }, "config": { "type": "string", "description": "触发器配置。timer 必须使用 CloudBase 7 段 cron 格式:秒 分 时 日 月 星期 年。⚠️ 不支持标准 5 段 cron(如 */5 * * * * 是错误的)。正确示例:0 */5 * * * * *(每5分钟)、0 0 2 1 * * *(每月1号2点)、0 30 9 * * * *(每天9:30)" } }, "required": [ "name", "type", "config" ], "additionalProperties": false }, "description": "触发器配置数组" }, "handler": { "type": "string", "description": "函数入口" }, "ignore": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ], "description": "忽略文件" }, "isWaitInstall": { "type": "boolean", "description": "是否等待依赖安装" }, "layers": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "version": { "type": "number" } }, "required": [ "name", "version" ], "additionalProperties": false }, "description": "Layer 配置" } }, "required": [ "name" ], "additionalProperties": false, "description": "createFunction 操作的函数配置" }, "functionRootPath": { "type": "string", "description": "创建或更新函数代码时默认推荐的本地目录方式。必须是直接包含函数文件夹的目录绝对路径(如 /abs/path/cloudfunctions 或 /abs/path/functions),不要传项目根目录(如 /abs/path),也不要传到函数名子目录(如 /abs/path/cloudfunctions/hello)。本地应按 cloudfunctions//index.js 或 functions//index.js 布局,此参数传 cloudfunctions 或 functions 目录的绝对路径。SDK 会自动拼接函数名子目录,无需预先压缩 zip 或 base64 编码。" }, "force": { "type": "boolean", "description": "createFunction 时是否覆盖" }, "functionName": { "type": "string", "description": "函数名称。大多数 action 使用该字段作为统一目标" }, "zipFile": { "type": "string", "description": "仅兼容特殊场景:预先准备好的代码包 base64 编码。普通 createFunction/updateFunctionCode 默认不要先压缩 zip,优先使用 functionRootPath。" }, "handler": { "type": "string", "description": "函数入口" }, "timeout": { "type": "number", "description": "配置更新时的超时时间" }, "envVariables": { "type": "object", "additionalProperties": { "type": "string" }, "description": "配置更新时要合并的环境变量" }, "vpc": { "$ref": "#/properties/func/properties/vpc", "description": "配置更新时的 VPC 信息" }, "params": { "type": "object", "additionalProperties": {}, "description": "invokeFunction 的调用参数" }, "triggers": { "type": "array", "items": { "$ref": "#/properties/func/properties/triggers/items" }, "description": "createFunctionTrigger 的触发器列表,用于定时跑 / 定时任务 / scheduled job。timer 触发器使用7段 cron 表达式(秒 分 时 日 月 星期 年),如 \"0 */5 * * * * *\" 表示每5分钟执行一次" }, "triggerName": { "type": "string", "description": "deleteFunctionTrigger 的目标触发器名称" }, "layerName": { "type": "string", "description": "层名称" }, "layerVersion": { "type": "number", "description": "层版本号" }, "contentPath": { "type": "string", "description": "层内容路径,可为目录或 ZIP 文件" }, "base64Content": { "type": "string", "description": "层内容的 base64 编码" }, "runtimes": { "type": "array", "items": { "type": "string" }, "description": "层适用的运行时列表" }, "description": { "type": "string", "description": "层版本描述" }, "licenseInfo": { "type": "string", "description": "层许可证信息" }, "layers": { "type": "array", "items": { "type": "object", "properties": { "layerName": { "type": "string", "description": "层名称" }, "layerVersion": { "type": "number", "description": "层版本号" } }, "required": [ "layerName", "layerVersion" ], "additionalProperties": false }, "description": "updateFunctionLayers 的目标层列表,顺序即最终顺序" }, "codeSecret": { "type": "string", "description": "层绑定时的代码保护密钥" }, "confirm": { "type": "boolean", "description": "危险操作确认开关。deleteFunction、deleteFunctionTrigger、deleteLayerVersion、detachLayer 等删除类操作需要显式传入 confirm=true" } }, "required": [ "action" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "queryHosting", "description": "查询 CloudBase 静态托管的只读信息。适合 AI 先做发现再决定下一步:action=websiteConfig 查询首页/错误页/路由规则与站点域名信息;action=status 查询托管服务状态;action=findFiles 按前缀查找文件;action=listFiles 列出全部托管文件;action=domainStatus 查询自定义域名的当前状态与配置。该工具不会产生任何副作用。", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "websiteConfig", "status", "findFiles", "listFiles", "domainStatus" ], "description": "查询类型:websiteConfig=查询静态托管网站文档配置与站点域名信息,status=查询静态托管服务状态,findFiles=按前缀查找托管文件,listFiles=列出静态托管中的全部文件,domainStatus=查询自定义域名配置与生效状态。该工具严格只读,不会修改任何资源。" }, "prefix": { "type": "string", "description": "文件前缀过滤条件。仅 action=findFiles 时使用,例如 app/ 或 assets/logo。" }, "marker": { "type": "string", "description": "分页起始标记。仅 action=findFiles 时使用,用于续查上一页之后的结果。" }, "maxKeys": { "type": "integer", "exclusiveMinimum": 0, "description": "单次返回的最大文件条数。仅 action=findFiles 时使用。" }, "domains": { "type": "array", "items": { "type": "string" }, "description": "要查询的自定义域名列表。仅 action=domainStatus 时使用,例如 [\"www.example.com\"]。" } }, "required": [ "action" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "manageHosting", "description": "管理 CloudBase 静态托管的变更操作。action=upload 上传本地构建产物;action=delete 删除托管文件或目录(必须 confirm=true);action=setWebsiteDocument 设置首页/错误页/路由规则;action=enableService 开通静态托管;action=bindDomain / unbindDomain / updateDomain 管理自定义域名;action=downloadFile / downloadDirectory 下载托管内容到本地。若任务只是查看配置、文件或域名状态,请改用 queryHosting。", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "upload", "delete", "setWebsiteDocument", "enableService", "bindDomain", "unbindDomain", "updateDomain", "downloadFile", "downloadDirectory" ], "description": "管理类型:upload=上传本地构建产物到静态托管,delete=删除静态托管文件或目录,setWebsiteDocument=设置首页/错误页/路由规则,enableService=开通静态托管服务,bindDomain=绑定自定义域名,unbindDomain=解绑自定义域名,updateDomain=更新域名缓存/防盗链/IP 规则,downloadFile=下载单个托管文件到本地,downloadDirectory=下载托管目录到本地。" }, "localPath": { "type": "string", "description": "本地路径。action=upload 时表示要上传的本地文件/目录路径;action=downloadFile 或 downloadDirectory 时表示下载到本地的目标路径。建议传绝对路径。" }, "cloudPath": { "type": "string", "description": "静态托管中的目标路径。action=upload 时表示上传后的托管路径;action=delete/downloadFile/downloadDirectory 时表示托管侧文件或目录路径。" }, "files": { "type": "array", "items": { "type": "object", "properties": { "localPath": { "type": "string", "description": "单个待上传文件的本地绝对路径。" }, "cloudPath": { "type": "string", "description": "该文件上传到静态托管后的托管路径。" } }, "required": [ "localPath", "cloudPath" ], "additionalProperties": false }, "default": [], "description": "多文件上传配置。仅 action=upload 时可选;传入后会逐项上传,不再依赖单个 localPath/cloudPath。" }, "ignore": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ], "description": "上传时忽略的文件模式。仅 action=upload 时可选,例如 node_modules 或 [\"**/*.map\", \"**/.DS_Store\"]。" }, "isDir": { "type": "boolean", "default": false, "description": "是否把 cloudPath 视为目录。仅 action=delete 时使用;true=删除目录,false=删除单个文件。" }, "confirm": { "type": "boolean", "default": false, "description": "高风险操作确认开关。action=delete 和 action=unbindDomain 时必须显式传 true,避免误删文件或误解绑域名。" }, "indexDocument": { "type": "string", "description": "网站首页文档名称。仅 action=setWebsiteDocument 时必填,例如 index.html。" }, "errorDocument": { "type": "string", "description": "错误页文档名称。仅 action=setWebsiteDocument 时可选,例如 404.html。" }, "routingRules": { "type": "array", "items": { "type": "object", "properties": { "keyPrefixEquals": { "type": "string", "description": "匹配前缀规则,例如 app/ 或 assets/。与 httpErrorCodeReturnedEquals 二选一或按 CloudBase 规则组合使用。" }, "httpErrorCodeReturnedEquals": { "type": "string", "description": "匹配 HTTP 错误码,例如 404。SPA 回退常用 404。" }, "replaceKeyWith": { "type": "string", "description": "把匹配结果替换为固定文件路径,例如 index.html。" }, "replaceKeyPrefixWith": { "type": "string", "description": "把匹配前缀替换成新的前缀路径。" } }, "additionalProperties": false }, "description": "网站路由规则列表。仅 action=setWebsiteDocument 时可选。SPA 常见配置是将 404 重写到 index.html。" }, "domain": { "type": "string", "description": "自定义域名。action=bindDomain / unbindDomain / updateDomain 时使用,例如 www.example.com。" }, "certId": { "type": "string", "description": "证书 ID。仅 action=bindDomain 时必填。" }, "domainId": { "type": "number", "description": "域名 ID。仅 action=updateDomain 时必填,用于精确更新指定域名配置。" }, "domainConfig": { "type": "object", "properties": { "Refer": { "type": "object", "properties": { "Switch": { "type": "string", "description": "Referer 防盗链开关,例如 on/off。" }, "RefererRules": { "type": "array", "items": { "type": "object", "properties": { "RefererType": { "type": "string", "description": "Referer 规则类型。" }, "Referers": { "type": "array", "items": { "type": "string" }, "description": "Referer 规则值列表。" }, "AllowEmpty": { "type": "boolean", "description": "是否允许空 Referer。" } }, "required": [ "RefererType", "Referers", "AllowEmpty" ], "additionalProperties": false }, "description": "Referer 规则列表。" } }, "required": [ "Switch" ], "additionalProperties": false, "description": "Referer 防盗链配置。" }, "Cache": { "type": "array", "items": { "type": "object", "properties": { "RuleType": { "type": "string", "description": "缓存规则类型,例如 fileType/path。" }, "RuleValue": { "type": "string", "description": "规则匹配值。" }, "CacheTtl": { "type": "number", "description": "缓存 TTL,单位秒。" } }, "required": [ "RuleType", "RuleValue", "CacheTtl" ], "additionalProperties": false }, "description": "CDN 缓存规则列表。" }, "IpFilter": { "type": "object", "properties": { "Switch": { "type": "string", "description": "IP 访问控制开关,例如 on/off。" }, "FilterType": { "type": "string", "description": "过滤类型,例如 blacklist/whitelist。" }, "Filters": { "type": "array", "items": { "type": "string" }, "description": "IP 规则列表。" } }, "required": [ "Switch" ], "additionalProperties": false, "description": "IP 访问控制配置。" }, "IpFreqLimit": { "type": "object", "properties": { "Switch": { "type": "string", "description": "IP 频控开关,例如 on/off。" }, "Qps": { "type": "number", "description": "每个 IP 的 QPS 上限。" } }, "required": [ "Switch" ], "additionalProperties": false, "description": "IP 频控配置。" } }, "additionalProperties": false, "description": "域名配置。仅 action=updateDomain 时必填,支持缓存、Referer、防盗链、IP 规则与频控。" } }, "required": [ "action" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "queryStorage", "description": "查询云存储信息,支持列出目录文件、获取文件信息、获取临时下载链接等只读操作。返回的文件信息包括文件名、大小、修改时间、下载链接等。注意:action=url 返回的 temporaryUrl 是临时签名链接,有效期由 maxAge 参数决定(默认1小时),不要当作永久公网地址使用。工具还会基于 DescribeEnvs 返回的 Storages[0].CdnDomain 推导出 publicUrl,⚠️ 警告:publicUrl 仅在存储桶 ACL 为公有读(所有用户可读)时才能被匿名访问;默认私有读写存储桶返回的 publicUrl 会 403,此时请继续使用 temporaryUrl 或先通过控制台/SDK 将目标路径设置为公有读。", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "list", "info", "url", "read" ], "description": "查询操作类型:list=列出目录下的所有文件,info=获取指定文件的详细信息,url=获取文件的临时下载链接,read=读取文本文件内容" }, "cloudPath": { "type": "string", "description": "云端文件路径,例如 files/data.txt 或 files/(目录)" }, "maxAge": { "type": "number", "minimum": 1, "maximum": 86400, "default": 3600, "description": "临时链接有效期,单位为秒,取值范围:1-86400,默认值:3600(1小时)" } }, "required": [ "action", "cloudPath" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "manageStorage", "description": "管理云存储文件,仅用于 COS/Storage 对象,不用于静态网站托管。支持上传文件/目录、下载文件/目录、删除文件/目录等操作。删除操作需要设置force=true进行确认,防止误删除重要文件。注意:上传后返回的 temporaryUrl 是临时签名链接,1小时后过期,不要当作永久公网地址写入配置或持久化存储。工具还会基于 DescribeEnvs 返回的 Storages[0].CdnDomain 推导 publicUrl,⚠️ 警告:publicUrl 仅在存储桶 ACL 为公有读(所有用户可读)时才能被匿名访问;默认私有读写存储桶返回的 publicUrl 会 403,此时请继续使用 temporaryUrl 或先通过控制台/SDK 将目标路径设置为公有读。", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "upload", "download", "delete" ], "description": "管理操作类型:upload=上传文件或目录,download=下载文件或目录,delete=删除文件或目录" }, "localPath": { "type": "string", "description": "本地文件路径,建议传入绝对路径,例如 /tmp/files/data.txt" }, "cloudPath": { "type": "string", "description": "云端文件路径,例如 files/data.txt" }, "force": { "type": "boolean", "default": false, "description": "强制操作开关,删除操作时建议设置为true以确认删除,默认false" }, "isDirectory": { "type": "boolean", "default": false, "description": "是否为目录操作,true=目录操作,false=文件操作,默认false" } }, "required": [ "action", "localPath", "cloudPath" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "downloadTemplate", "description": "自动下载并部署CloudBase项目模板。\n**Note**: Call this tool when the user requests to create a new project using a CloudBase template.\n\n支持的模板:\n- react: React + CloudBase 全栈应用模板\n- vue: Vue + CloudBase 全栈应用模板\n- miniprogram: 微信小程序 + 云开发模板 \n- uniapp: UniApp + CloudBase 跨端应用模板\n- rules: 只包含AI编辑器配置文件(包含Cursor、WindSurf、CodeBuddy等所有主流编辑器配置),适合在已有项目中补充AI编辑器配置\n\n支持的IDE类型:\n- all: 下载所有IDE配置\n- cursor: Cursor AI编辑器\n- 其他IDE类型见下方列表\n\n注意:如果未传入 ide 参数且无法从环境变量检测到 IDE,将提示错误并要求传入 ide 参数\n- windsurf: WindSurf AI编辑器\n- codebuddy: CodeBuddy AI编辑器\n- claude-code: Claude Code AI编辑器\n- cline: Cline AI编辑器\n- gemini-cli: Gemini CLI\n- opencode: OpenCode AI编辑器\n- qwen-code: 通义灵码\n- baidu-comate: 百度Comate\n- openai-codex-cli: OpenAI Codex CLI\n- augment-code: Augment Code\n- github-copilot: GitHub Copilot\n- roocode: RooCode AI编辑器\n- tongyi-lingma: 通义灵码\n- trae: Trae AI编辑器\n- qoder: Qoder AI编辑器\n- antigravity: Google Antigravity AI编辑器\n- vscode: Visual Studio Code\n- kiro: Kiro AI编辑器\n- aider: Aider AI编辑器\n\n特别说明:\n- rules 模板会自动包含当前 mcp 版本号信息(版本号:2.19.4),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)", "inputSchema": { "type": "object", "properties": { "template": { "type": "string", "enum": [ "react", "vue", "miniprogram", "uniapp", "rules" ], "description": "要下载的模板类型" }, "ide": { "type": "string", "enum": [ "all", "cursor", "windsurf", "codebuddy", "claude-code", "cline", "gemini-cli", "opencode", "qwen-code", "baidu-comate", "openai-codex-cli", "augment-code", "github-copilot", "roocode", "tongyi-lingma", "trae", "qoder", "antigravity", "vscode", "kiro", "aider", "iflow-cli" ], "description": "指定要下载的IDE类型。" }, "overwrite": { "type": "boolean", "description": "是否覆盖已存在的文件,默认为false(不覆盖)" } }, "required": [ "template", "ide" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "searchWeb", "description": "使用联网来进行信息检索,如查询最新的新闻、文章、股价、天气等。支持自然语言查询,也可以直接输入网址获取网页内容", "inputSchema": { "type": "object", "properties": { "query": { "type": "string", "description": "搜索关键词、问题或网址,支持自然语言" } }, "required": [ "query" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "searchKnowledgeBase", "description": "云开发知识库智能检索工具,支持向量查询 (vector)、固定技能文档 (skill)、OpenAPI 文档 (openapi) 和 CloudBase 官方文档 (docs) 查询。\n\n 强烈推荐始终优先使用固定技能文档 (skill)、OpenAPI 文档 (openapi) 或 CloudBase 官方文档 (docs) 模式进行检索,仅当固定文档无法覆盖你的问题时,再使用向量查询 (vector) 模式。\n\n ⚠️ 重要:当 CloudBase skills 处于禁用状态或当前 IDE 不支持 skill 文件读取时,必须使用 searchKnowledgeBase(mode=skill, skillName=...) 来获取 CloudBase 技能文档内容,而不是尝试直接读取 skill 文件。直接读取可能返回 400 错误。示例:\n - 需要 auth-tool 指南时:searchKnowledgeBase(mode=skill, skillName=auth-tool)\n - 需要 auth-web 指南时:searchKnowledgeBase(mode=skill, skillName=auth-web)\n - 需要 cloudbase-agent 指南时:searchKnowledgeBase(mode=skill, skillName=cloudbase-agent)\n\n 固定技能文档 (skill) 查询当前支持 24 个固定文档,分别是:\n 文档名:ai-model-nodejs 文档介绍:\"Use this skill for Node.js backend AI via @cloudbase/node-sdk (>=3.16.0) — cloud functions, CloudRun, Express, Koa, NestJS, serverless APIs, scheduled jobs, LLM proxies. Only SDK supporting image generation (ai.createImageModel + generateImage). Text models via ai.createModel with groups cloudbase, hunyuan-exp, or custom-*. Model IDs (deepseek-v4-flash, deepseek-v3.2, hunyuan-2.0-instruct-20251111, glm-5, kimi-k2.6) go in the model field of generateText/streamText. MUST run two-step preflight before code — see body. Keywords: backend, 云函数, 云托管, serverless, LLM proxy, agent orchestration, generateText, streamText, generateImage, createModel, hunyuan-image, Token Credits, TokenHub, Hunyuan, DeepSeek, GLM, Kimi, MiniMax. NOT for browser/Web (use ai-model-web) or Mini Program (use ai-model-wechat).\"\n文档名:ai-model-web 文档介绍:\"Use this skill when a browser/Web app (React, Vue, Angular, Next, Nuxt, static sites, SPAs, dashboards, AI chat UI) needs AI models via @cloudbase/js-sdk. Default routing for page/页面/Web/前端/frontend/网页/H5 AI — call directly from browser, do NOT propose a Node.js proxy. Covers generateText and streamText. Models via ai.createModel with groups cloudbase, hunyuan-exp, or custom-*. Model IDs (deepseek-v4-flash, deepseek-v3.2, hunyuan-2.0-instruct-20251111, glm-5, kimi-k2.6) go in the model field. MUST run two-step preflight before code — see body. Keywords: 页面, Web, 前端, React, Vue, Next, Nuxt, SPA, AI chat UI, generateText, streamText, createModel, hunyuan-exp, Token Credits, TokenHub, Hunyuan, DeepSeek, GLM, Kimi, MiniMax. NOT for Node.js backend (use ai-model-nodejs), Mini Program (use ai-model-wechat), or image generation (Node SDK only).\"\n文档名:ai-model-wechat 文档介绍:\"Use this skill for WeChat Mini Program AI via wx.cloud.extend.AI (小程序, 企业微信小程序, wx.cloud apps). Features generateText and streamText with callbacks (onText, onEvent, onFinish). Models via wx.cloud.extend.AI.createModel with groups hunyuan-exp (小程序成长计划), cloudbase (main managed), or custom-*. Model IDs (deepseek-v4-flash, deepseek-v3.2, hunyuan-2.0-instruct-20251111, glm-5, kimi-k2.6) go in the data wrapper model field. API differs from JS/Node SDK — streamText needs data wrapper, generateText returns raw response. MUST run two-step preflight before code — see body. Keywords: Mini Program AI, wx.cloud.extend.AI, 小程序成长计划, ai_miniprogram_inspire_plan, Token Credits 资源包, generateText, streamText, createModel, hunyuan-exp, TokenHub, Hunyuan, DeepSeek, GLM, Kimi, MiniMax. NOT for browser/Web (use ai-model-web), Node.js backend (use ai-model-nodejs), or image generation (use ai-model-nodejs).\"\n文档名:auth-nodejs 文档介绍:CloudBase Node SDK auth guide for server-side identity, user lookup, and custom login tickets. This skill should be used when Node.js code must read caller identity, inspect end users, or bridge an existing user system into CloudBase; not when configuring providers or building client login UI.\n文档名:auth-tool 文档介绍:CloudBase auth provider configuration and login-readiness guide. This skill should be used when users need to inspect, enable, disable, or configure auth providers, publishable-key prerequisites, login methods, SMS/email sender setup, or other provider-side readiness before implementing a client or backend auth flow.\n文档名:auth-web 文档介绍:CloudBase Web Authentication Quick Guide for frontend integration after auth-tool has already been checked. Provides concise and practical Web authentication solutions with multiple login methods and complete user management.\n文档名:auth-wechat 文档介绍:CloudBase WeChat Mini Program native authentication guide. This skill should be used when users need mini program identity handling, OPENID/UNIONID access, or `wx.cloud` auth behavior in projects where login is native and automatic.\n文档名:cloud-functions 文档介绍:CloudBase function runtime guide for building, deploying, and debugging your own Event Functions or HTTP Functions. This skill should be used when users need application runtime code on CloudBase, not when they are merely calling CloudBase official platform APIs.\n文档名:cloud-storage-web 文档介绍:Complete guide for CloudBase cloud storage using Web SDK (@cloudbase/js-sdk) - upload, download, temporary URLs, file management, and best practices.\n文档名:cloudbase-agent 文档介绍:Build and deploy AI agents with CloudBase Agent SDK (TypeScript & Python). Implements the AG-UI protocol for streaming agent-UI communication. Use when deploying agent servers, using LangGraph/LangChain/CrewAI adapters, building custom adapters, understanding AG-UI protocol events, or building web/mini-program UI clients. Supports both TypeScript (@cloudbase/agent-server) and Python (cloudbase-agent-server via FastAPI).\n文档名:cloudbase-cli 文档介绍:CloudBase CLI (tcb, 云开发CLI, Tencent CloudBase命令行) resource management skill. This skill should be used when users need to deploy cloud functions, manage CloudRun apps, upload files to storage, query NoSQL/MySQL databases, deploy static hosting, set access permissions, or configure CORS/domains/routing via tcb commands. Also use for CI/CD pipeline scripting, batch operations, terminal-based CloudBase management, or when the user prefers CLI over SDK/MCP.\n文档名:cloudbase-platform 文档介绍:CloudBase platform overview and routing guide. This skill should be used when users need high-level capability selection, platform concepts, console navigation, or cross-platform best practices before choosing a more specific implementation skill.\n文档名:cloudrun-development 文档介绍:CloudBase Run backend development rules (Function mode/Container mode). Use this skill when deploying backend services that require long connections, multi-language support, custom environments, or AI agent development.\n文档名:data-model-creation 文档介绍:Optional advanced tool for complex data modeling. For simple table creation, use relational-database-tool directly with SQL statements.\n文档名:http-api 文档介绍:CloudBase official HTTP API client guide. This skill should be used when backends, scripts, or non-SDK clients must call CloudBase platform APIs over raw HTTP instead of using a platform SDK or MCP management tool.\n文档名:miniprogram-development 文档介绍:WeChat Mini Program development skill for building, debugging, previewing, testing, publishing, and optimizing mini program projects. This skill should be used when users ask to create, develop, modify, debug, preview, test, deploy, publish, launch, review, or optimize WeChat Mini Programs, mini program pages, components, `tabBar`, routing, navigation, icon assets, project structure, project configuration, `project.config.json`, `appid` setup, device preview, real-device validation, WeChat Developer Tools workflows, `miniprogram-ci` preview/upload flows, or mini program release processes. It should also be used when users explicitly mention CloudBase, `wx.cloud`, Tencent CloudBase, 腾讯云开发, or 云开发 in a mini program project.\n文档名:no-sql-web-sdk 文档介绍:Use CloudBase document database Web SDK to query, create, update, and delete data. Supports complex queries, pagination, aggregation, realtime, and geolocation queries.\n文档名:no-sql-wx-mp-sdk 文档介绍:Use CloudBase document database WeChat MiniProgram SDK to query, create, update, and delete data. Supports complex queries, pagination, aggregation, and geolocation queries.\n文档名:ops-inspector 文档介绍:AIOps-style one-click inspection skill for CloudBase resources. Use this skill when users need to diagnose errors, check resource health, inspect logs, or run a comprehensive health check across cloud functions, CloudRun services, databases, and other CloudBase resources.\n文档名:relational-database-tool 文档介绍:This is the required documentation for agents operating on the CloudBase Relational Database through MCP. It defines the canonical SQL management flow with `querySqlDatabase`, `manageSqlDatabase`, `queryPermissions`, and `managePermissions`, including MySQL provisioning, destroy flow, async status checks, safe query execution, schema initialization, and permission updates.\n文档名:relational-database-web 文档介绍:Use when building frontend Web apps that talk to CloudBase Relational Database via @cloudbase/js-sdk – provides the canonical init pattern so you can then use Supabase-style queries from the browser.\n文档名:spec-workflow 文档介绍:Use when medium-to-large changes need explicit requirements, technical design, and task planning before implementation, especially for multi-module work, unclear acceptance criteria, or architecture-heavy requests.\n文档名:ui-design 文档介绍:Use when users need visual direction, interface hierarchy, layout decisions, design specifications, or prototypes before implementing a Web or mini program UI.\n文档名:web-development 文档介绍:Use when users need to implement, integrate, debug, build, deploy, or validate a Web frontend after the product direction is already clear, especially for React, Vue, Vite, browser flows, or CloudBase Web integration.\n\n OpenAPI 文档 (openapi) 查询当前支持 7 个 API 文档,分别是:\n API名:mysqldb API介绍:关系型数据库 RESTful API (MySQL/PostgreSQL) - 云开发关系型数据库 HTTP API\nAPI名:functions API介绍:Cloud Functions API - 云函数 HTTP API\nAPI名:auth API介绍:Authentication API - 身份认证 HTTP API\nAPI名:cloudrun API介绍:CloudRun API - 云托管服务 HTTP API\nAPI名:storage API介绍:Storage API - 云存储 HTTP API\nAPI名:nosql API介绍:NoSQL RESTful API - 文档型数据库 HTTP API\nAPI名:ai_model API介绍:AI 大模型接入 API - 统一 AI 模型 HTTP API", "inputSchema": { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "vector", "skill", "openapi", "docs" ] }, "skillName": { "type": "string", "enum": [ "ai-model-nodejs", "ai-model-web", "ai-model-wechat", "auth-nodejs", "auth-tool", "auth-web", "auth-wechat", "cloud-functions", "cloud-storage-web", "cloudbase-agent", "cloudbase-cli", "cloudbase-platform", "cloudrun-development", "data-model-creation", "http-api", "miniprogram-development", "no-sql-web-sdk", "no-sql-wx-mp-sdk", "ops-inspector", "relational-database-tool", "relational-database-web", "spec-workflow", "ui-design", "web-development" ], "description": "mode=skill 时指定。技能名称。" }, "apiName": { "type": "string", "enum": [ "mysqldb", "functions", "auth", "cloudrun", "storage", "nosql", "ai_model" ], "description": "mode=openapi 时指定。API 名称。" }, "action": { "type": "string", "enum": [ "listModules", "listModuleDocs", "findByName", "readDoc", "searchDocs" ], "description": "mode=docs 时指定。CloudBase 文档操作类型:listModules=列出所有文档模块,listModuleDocs=获取指定模块的目录结构,findByName=按名称/路径/URL 智能查找,readDoc=读取指定文档 Markdown,searchDocs=全文搜索官方文档。" }, "moduleName": { "type": "string", "description": "mode=docs 且 action=listModuleDocs 时指定。模块名称。" }, "input": { "type": "string", "description": "mode=docs 且 action=findByName 时指定。支持模块名、文档标题、层级路径或 URL。" }, "docPath": { "type": "string", "description": "mode=docs 且 action=readDoc 时指定。文档相对路径或完整 URL。" }, "query": { "type": "string", "description": "mode=docs 且 action=searchDocs 时指定。全文检索关键词。" }, "threshold": { "type": "number", "default": 0.5, "description": "mode=vector 时指定。相似性检索阈值" }, "id": { "type": "string", "enum": [ "cloudbase", "scf", "miniprogram" ], "default": "cloudbase", "description": "mode=vector 时指定。知识库范围,默认 cloudbase。cloudbase=云开发全量知识,scf=云开发的云函数知识, miniprogram=小程序知识(不包含云开发与云函数知识)" }, "content": { "type": "string", "description": "mode=vector 时指定。检索内容" }, "options": { "type": "object", "properties": { "chunkExpand": { "type": "array", "items": { "type": "number" }, "minItems": 2, "maxItems": 2, "default": [ 3, 3 ], "description": "指定返回的文档内容的展开长度,例如 [3,3]代表前后展开长度" } }, "additionalProperties": false, "description": "mode=vector 时指定。其他选项" }, "limit": { "type": "number", "default": 5, "description": "mode=vector 时指定。指定返回最相似的 Top K 的 K 的值" } }, "required": [ "mode" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "queryCloudRun", "description": "查询云托管服务信息,支持获取服务列表、查询服务详情、获取可用模板列表和部署日志。返回的服务信息包括服务名称、状态、访问类型、配置详情以及最近部署上下文。", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "list", "detail", "templates", "getDeployLog" ], "description": "查询操作类型:list=获取云托管服务列表(支持分页和筛选),detail=查询指定服务的详细信息(包含服务配置和最新部署状态),templates=获取可用的项目模板列表(用于初始化新项目),getDeployLog=获取指定服务最近一次或指定构建的部署日志" }, "pageSize": { "type": "number", "minimum": 1, "maximum": 100, "default": 10, "description": "分页大小,控制每页返回的服务数量。取值范围:1-100,默认值:10。建议根据网络性能和显示需求调整" }, "pageNum": { "type": "number", "minimum": 1, "default": 1, "description": "页码,用于分页查询。从1开始,默认值:1。配合pageSize使用可实现分页浏览" }, "serverName": { "type": "string", "description": "服务名称筛选条件,支持模糊匹配。例如:输入\"test\"可匹配\"test-service\"、\"my-test-app\"等服务名称。留空则查询所有服务" }, "serverType": { "type": "string", "enum": [ "function", "container" ], "description": "服务类型筛选条件:function=函数型云托管(仅支持Node.js,有特殊的开发要求和限制,适合简单的API服务),container=容器型服务(推荐使用,支持任意语言和框架如Java/Go/Python/PHP/.NET等,适合大多数应用场景)" }, "detailServerName": { "type": "string", "description": "要查询详细信息或部署日志的服务名称。当action为detail或getDeployLog时建议提供,必须是已存在的服务名称。可通过list操作获取可用的服务名称列表" }, "buildId": { "type": "number", "description": "构建ID,仅在action=getDeployLog时使用。不传时默认返回最近一次部署的构建日志" } }, "required": [ "action" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "manageCloudRun", "description": "管理云托管服务,按开发顺序支持:初始化项目(可从模板开始,模板列表可通过 queryCloudRun 查询)、下载服务代码、本地运行(仅函数型服务)、部署代码、删除服务。部署可配置CPU、内存、实例数、访问类型等参数。删除操作需要确认,建议设置force=true。", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "init", "download", "run", "deploy", "delete", "createAgent" ], "description": "云托管服务管理操作类型:init=从模板初始化新的云托管项目代码(在targetPath目录下创建以serverName命名的子目录,支持多种语言和框架模板),download=从云端下载现有服务的代码到本地进行开发,run=在本地运行函数型云托管服务(用于开发和调试,仅支持函数型服务),deploy=将本地代码部署到云端云托管服务(支持函数型和容器型),delete=删除指定的云托管服务(不可恢复,需要确认),createAgent=创建函数型Agent(基于函数型云托管开发AI智能体)" }, "serverName": { "type": "string", "description": "云托管服务名称,用于标识和管理服务。命名规则:支持大小写字母、数字、连字符和下划线,必须以字母开头,长度3-45个字符。在init操作中会作为在targetPath下创建的子目录名,在其他操作中作为目标服务名" }, "targetPath": { "type": "string", "description": "本地代码路径,必须是绝对路径。在deploy操作中指定要部署的代码目录,在download操作中指定下载目标目录,在init操作中指定云托管服务的上级目录(会在该目录下创建以serverName命名的子目录)。建议约定:项目根目录下的cloudrun/目录,例如:/Users/username/projects/my-project/cloudrun" }, "serverConfig": { "type": "object", "properties": { "OpenAccessTypes": { "type": "array", "items": { "type": "string", "enum": [ "OA", "PUBLIC", "MINIAPP", "VPC" ] }, "description": "公网访问类型配置,控制服务的访问权限:OA=办公网访问,PUBLIC=公网访问(默认,可通过HTTPS域名访问),MINIAPP=小程序访问,VPC=VPC访问(仅同VPC内可访问)。可配置多个类型" }, "Cpu": { "type": "number", "exclusiveMinimum": 0, "description": "CPU规格配置,单位为核。可选值:0.25、0.5、1、2、4、8等。注意:内存规格必须是CPU规格的2倍(如CPU=0.25时内存=0.5,CPU=1时内存=2)。影响服务性能和计费" }, "Mem": { "type": "number", "exclusiveMinimum": 0, "description": "内存规格配置,单位为GB。可选值:0.5、1、2、4、8、16等。注意:必须是CPU规格的2倍。影响服务性能和计费" }, "MinNum": { "type": "number", "minimum": 0, "description": "最小实例数配置,控制服务的最小运行实例数量。设置为0时支持缩容到0(无请求时不产生费用),设置为大于0时始终保持指定数量的实例运行(确保快速响应但会增加成本)。建议设置为1以降低冷启动延迟,提升用户体验" }, "MaxNum": { "type": "number", "minimum": 1, "description": "最大实例数配置,控制服务的最大运行实例数量。当请求量增加时,服务最多可以扩展到指定数量的实例,超过此数量后将拒绝新的请求。建议根据业务峰值设置" }, "PolicyDetails": { "type": "array", "items": { "type": "object", "properties": { "PolicyType": { "type": "string", "enum": [ "cpu", "mem", "cpu/mem" ], "description": "扩缩容类型:cpu=基于CPU使用率扩缩容,mem=基于内存使用率扩缩容,cpu/mem=基于CPU和内存使用率扩缩容" }, "PolicyThreshold": { "type": "number", "minimum": 1, "maximum": 100, "description": "扩缩容阈值,单位为百分比。如60表示当资源使用率达到60%时触发扩缩容" } }, "required": [ "PolicyType", "PolicyThreshold" ], "additionalProperties": false }, "description": "扩缩容配置数组,用于配置服务的自动扩缩容策略。可配置多个扩缩容策略" }, "CustomLogs": { "type": "string", "description": "自定义日志配置,用于配置服务的日志收集和存储策略" }, "Port": { "type": "number", "minimum": 1, "maximum": 65535, "description": "服务监听端口配置。函数型服务固定为3000,容器型服务可自定义。服务代码必须监听此端口才能正常接收请求" }, "EnvParams": { "type": "string", "description": "环境变量配置,JSON字符串格式。用于传递配置信息给服务代码,如'{\"DATABASE_URL\":\"mysql://...\",\"NODE_ENV\":\"production\"}'。敏感信息建议使用环境变量而非硬编码" }, "Dockerfile": { "type": "string", "description": "Dockerfile文件名配置,仅容器型服务需要。指定用于构建容器镜像的Dockerfile文件路径,默认为项目根目录下的Dockerfile" }, "BuildDir": { "type": "string", "description": "构建目录配置,指定代码构建的目录路径。当代码结构与标准不同时使用,默认为项目根目录" }, "InternalAccess": { "type": "string", "description": "内网访问开关配置,控制是否启用内网访问。true=启用内网访问(可通过云开发SDK直接调用),false=关闭内网访问(仅公网访问)" }, "InternalDomain": { "type": "string", "description": "内网域名配置,用于配置服务的内网访问域名。仅在启用内网访问时有效" }, "EntryPoint": { "type": "array", "items": { "type": "string" }, "description": "Dockerfile EntryPoint参数配置,仅容器型服务需要。指定容器启动时的入口程序数组,如[\"node\",\"app.js\"]" }, "Cmd": { "type": "array", "items": { "type": "string" }, "description": "Dockerfile Cmd参数配置,仅容器型服务需要。指定容器启动时的默认命令数组,如[\"npm\",\"start\"]" } }, "additionalProperties": false, "description": "服务配置项,用于部署时设置服务的运行参数。包括资源规格、访问权限、环境变量等配置。不提供时使用默认配置" }, "template": { "type": "string", "default": "helloworld", "description": "项目模板标识符,用于指定初始化项目时使用的模板。可通过queryCloudRun的templates操作获取可用模板列表。常用模板:helloworld=Hello World示例,nodejs=Node.js项目模板,python=Python项目模板等" }, "runOptions": { "type": "object", "properties": { "port": { "type": "number", "minimum": 1, "maximum": 65535, "default": 3000, "description": "本地运行端口配置,仅函数型服务有效。指定服务在本地运行时监听的端口号,默认3000。确保端口未被其他程序占用" }, "envParams": { "type": "object", "additionalProperties": { "type": "string" }, "description": "本地运行时的附加环境变量配置,用于本地开发和调试。格式为键值对,如{\"DEBUG\":\"true\",\"LOG_LEVEL\":\"debug\"}。这些变量仅在本地运行时生效" }, "runMode": { "type": "string", "enum": [ "normal", "agent" ], "default": "normal", "description": "运行模式:normal=普通函数模式,agent=Agent模式(用于AI智能体开发)" }, "agentId": { "type": "string", "description": "Agent ID,在agent模式下使用,用于标识特定的Agent实例" } }, "additionalProperties": false, "description": "本地运行参数配置,仅函数型云托管服务支持。用于配置本地开发环境的运行参数,不影响云端部署" }, "agentConfig": { "type": "object", "properties": { "agentName": { "type": "string", "description": "Agent名称,用于生成BotId" }, "botTag": { "type": "string", "description": "Bot标签,用于生成BotId,不提供时自动生成" }, "description": { "type": "string", "description": "Agent描述信息" }, "template": { "type": "string", "default": "blank", "description": "Agent模板类型,默认为blank(空白模板)" } }, "required": [ "agentName" ], "additionalProperties": false, "description": "Agent配置项,仅在createAgent操作时使用" }, "force": { "type": "boolean", "default": false, "description": "强制操作开关,用于跳过确认提示。默认false(需要确认),设置为true时跳过所有确认步骤。删除操作时强烈建议设置为true以避免误操作" }, "serverType": { "type": "string", "enum": [ "function", "container" ], "description": "服务类型配置:function=函数型云托管(仅支持Node.js,有特殊的开发要求和限制,适合简单的API服务),container=容器型服务(推荐使用,支持任意语言和框架如Java/Go/Python/PHP/.NET等,适合大多数应用场景)。不提供时自动检测:1)现有服务类型 2)有Dockerfile→container 3)有@cloudbase/aiagent-framework依赖→function 4)其他情况→container" } }, "required": [ "action", "serverName" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "queryGateway", "description": "网关域统一只读入口。通过 action 查询网关域名、访问入口和目标暴露情况。", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "getAccess", "listDomains", "listRoutes", "getRoute", "listCustomDomains" ], "description": "只读操作类型,例如 getAccess、listDomains" }, "targetType": { "type": "string", "enum": [ "function" ], "description": "目标资源类型。当前支持 function,后续可扩展" }, "targetName": { "type": "string", "description": "目标资源名称。getAccess 时必填" }, "routeId": { "type": "string", "description": "路由 ID。getRoute 时可选" } }, "required": [ "action" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "manageGateway", "description": "网关域统一写入口。通过 action 创建目标访问入口,后续承接更通用的网关配置能力。为已存在的 HTTP 云函数补默认域名访问时,通常使用 createAccess 并提供 targetType=\"function\"、targetName、type=\"HTTP\" 与期望 path。注意 createAccess 只创建网关入口,不会自动修改函数资源权限。⚠️ 如需绑定带 SSL 证书的自定义域名供公网 HTTPS 访问,使用 action=\"bindCustomDomain\"(需要 domain 和 certificateId 参数);如需配置 CORS/安全域名(无证书),请使用 envDomainManagement 工具。", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "createAccess", "createRoute", "updateRoute", "deleteRoute", "bindCustomDomain", "deleteCustomDomain", "deleteAccess", "updatePathAuth" ], "description": "写操作类型,例如 createAccess。为已有函数补默认域名访问入口时使用 createAccess;若 action=createAccess 且 targetType=function,必须显式提供 type。" }, "targetType": { "type": "string", "enum": [ "function" ], "description": "目标资源类型。当前支持 function,后续可扩展" }, "targetName": { "type": "string", "description": "目标资源名称。createAccess 到云函数时填写函数名" }, "path": { "type": "string", "description": "访问路径,默认 /{targetName}。例如为 HTTP 函数暴露 /api/hello 时传 /api/hello。该参数只创建网关入口,不会自动放开函数资源权限。" }, "type": { "type": "string", "enum": [ "Event", "HTTP" ], "description": "目标函数的运行时类型,不是接入协议。createAccess 到已创建的 HTTP 云函数时传 HTTP;给 Event 函数补网关访问时传 Event 或省略。省略会默认按 Event 路由处理,可能让 HTTP 云函数访问后返回 FUNCTION_PARAM_INVALID。" }, "auth": { "type": "boolean", "description": "是否开启网关路径鉴权。若要走默认域名做匿名或浏览器访问,通常设为 false;该开关仅控制网关入口本身,不会修改函数资源权限,仍需检查并按需调整函数安全规则。" }, "route": { "type": "object", "properties": { "routeId": { "type": "string" }, "path": { "type": "string" }, "serviceType": { "type": "string" }, "serviceName": { "type": "string" }, "auth": { "type": "boolean" } }, "additionalProperties": false, "description": "HTTP 路由配置对象" }, "domain": { "type": "string", "description": "自定义域名" }, "certificateId": { "type": "string", "description": "证书 ID" }, "accessName": { "type": "string", "description": "访问入口名称,保留字段" } }, "required": [ "action" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "queryAppAuth", "description": "应用侧认证配置只读入口。用于查询登录方式、provider、publishable key、API key、client 配置和静态域名等认证准备状态。⚠️ 本工具为管理端配置查询工具,不执行用户登录。当任务要求编写客户端登录代码时(例如「用 JS SDK 登录」),应先通过本工具确认配置状态,再在项目代码中编写 @cloudbase/js-sdk 客户端登录代码(如 auth.signInWithPassword()),而非使用本工具完成登录。若业务要接受普通用户名样式标识符,先查询 action=getLoginConfig;若 usernamePassword=false,下一步应立即调用 manageAppAuth(action=patchLoginStrategy, patch={ usernamePassword: true }),不要直接写 email 登录 API。", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "getLoginConfig", "listProviders", "getProvider", "getClientConfig", "getPublishableKey", "getStaticDomain", "listApiKeys" ] }, "providerId": { "type": "string", "description": "provider 标识,如 email、google" }, "clientId": { "type": "string", "description": "OAuth client_id / DescribeClient 的 Id;省略时默认使用当前环境 ID(默认客户端)" }, "keyType": { "type": "string", "enum": [ "publish_key", "api_key" ], "description": "API key 类型过滤,可选 publish_key 或 api_key" }, "pageNumber": { "type": "integer", "exclusiveMinimum": 0, "description": "API key 列表页码,从 1 开始" }, "pageSize": { "type": "integer", "exclusiveMinimum": 0, "description": "API key 列表每页条数" } }, "required": [ "action" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "manageAppAuth", "description": "应用侧认证配置写入口。用于修改登录方式、provider、client 配置,确保 publishable key,以及创建或删除 API key、自定义登录密钥。⚠️ 本工具为管理端配置工具,不执行用户登录。当任务要求编写客户端登录代码时(例如「用 JS SDK 登录」),应先通过本工具完成配置(如启用 usernamePassword、获取 publishable key),再在项目代码中编写 @cloudbase/js-sdk 客户端登录代码(如 auth.signInWithPassword()),而非使用本工具完成登录。若前端要接受普通用户名样式标识符,应先执行 action=patchLoginStrategy 并传入 patch={ usernamePassword: true },再实现对应前端登录逻辑。", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "patchLoginStrategy", "addProvider", "updateProvider", "deleteProvider", "updateClientConfig", "ensurePublishableKey", "createApiKey", "deleteApiKey", "createCustomLoginKeys" ] }, "patch": { "type": "object", "additionalProperties": {}, "description": "patchLoginStrategy 使用的简化登录策略 patch,如 { usernamePassword: true }" }, "providerId": { "type": "string", "description": "provider 标识,如 email、google;addProvider 时也可作为自定义 provider Id" }, "providerType": { "type": "string", "description": "addProvider 时的 provider 协议类型,如 OAUTH、OIDC、EMAIL" }, "displayName": { "anyOf": [ { "type": "string" }, { "type": "object", "additionalProperties": {} } ], "description": "addProvider 时的展示名称,可传字符串或多语言对象" }, "clientId": { "type": "string", "description": "updateClientConfig 时的客户端 Id;省略时默认使用当前环境 ID" }, "config": { "type": "object", "additionalProperties": {}, "description": "provider / client 的配置对象" }, "keyType": { "type": "string", "enum": [ "publish_key", "api_key" ], "description": "createApiKey 时的 API key 类型,默认 publish_key" }, "keyName": { "type": "string", "description": "createApiKey 时的 API key 名称" }, "expireIn": { "type": "integer", "minimum": 0, "description": "createApiKey 时的有效期,单位秒;0 表示不过期" }, "keyId": { "type": "string", "description": "deleteApiKey 时的 API key 唯一标识" } }, "required": [ "action" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "queryApps", "description": "CloudApp 域统一只读入口。可先查应用/版本,再在重新部署后用 listAppVersions 或 getAppVersion 按 serviceName 验证是否生成了新版本与最新构建状态。", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "listApps", "getApp", "listAppVersions", "getAppVersion" ] }, "serviceName": { "type": "string", "description": "CloudApp 服务名。getApp / listAppVersions / getAppVersion 时必填;重新部署后复用同一个 serviceName 查询版本历史。" }, "searchKey": { "type": "string", "description": "按应用服务名模糊搜索关键词,仅 action=listApps 时使用。" }, "pageNo": { "type": "number", "description": "分页页码,从 1 开始。" }, "pageSize": { "type": "number", "description": "分页大小。" }, "versionName": { "type": "string", "description": "版本名称。getAppVersion 时可与 buildId 二选一;已知版本号时优先传该值。" }, "buildId": { "type": "string", "description": "构建 ID。getAppVersion 时可与 versionName 二选一;部署返回 BuildId 后可直接用它轮询状态。" } }, "required": [ "action" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "manageApps", "description": "CloudApp 域统一写入口。action=deployApp 会先 uploadCode 再 createApp;首次调用创建应用,后续复用同一个 serviceName 会直接触发重新部署并生成新版本,无需先删除旧应用。", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "deployApp", "deleteApp", "deleteAppVersion" ] }, "serviceName": { "type": "string", "description": "CloudApp 服务名。deployApp 时复用现有 serviceName 会新增一个部署版本并触发重新部署,而不是删除重建。" }, "filePath": { "type": "string", "description": "要上传并部署的本地项目根目录或 zip 文件绝对路径。deployApp 时必填;通常传源码所在目录而不是 build 产物目录,构建产物目录请用 buildPath 指定。" }, "appPath": { "type": "string", "description": "应用线上访问路径(hosting mount path),例如 /my-web-app。不是本地目录路径;省略时默认为 /serviceName。" }, "buildPath": { "type": "string", "description": "构建产物目录,相对于 filePath,例如 dist 或 build。纯静态 HTML 如果入口文件直接在项目根目录,可省略。" }, "framework": { "type": "string", "enum": [ "vue", "react", "next", "nuxt", "vite", "angular", "static" ], "description": "前端框架类型。可选值:vue、react、next、nuxt、vite、angular、static;纯 HTML/静态站点请传 static。" }, "nodeJsVersion": { "type": "string", "description": "构建时使用的 Node.js 版本;不传时由 CloudApp 使用默认值。" }, "installCmd": { "type": "string", "description": "依赖安装命令,例如 npm install;静态资源无需安装依赖时可省略。" }, "buildCmd": { "type": "string", "description": "构建命令,例如 npm run build;纯静态 HTML 无构建步骤时可省略。" }, "deployCmd": { "type": "string", "description": "自定义部署命令。通常无需填写,只有在默认部署步骤不满足要求时才传。" }, "ignore": { "type": "array", "items": { "type": "string" }, "description": "上传时忽略的文件/目录 glob 模式,例如 **/node_modules/**。" }, "versionName": { "type": "string", "description": "要删除的历史版本名,仅 action=deleteAppVersion 时必填。" } }, "required": [ "action", "serviceName" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "queryPermissions", "description": "权限域统一只读入口。支持查询资源权限、角色列表/详情、应用用户列表/详情。", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "getResourcePermission", "listResourcePermissions", "listRoles", "getRole", "listUsers", "getUser" ] }, "resourceType": { "type": "string", "enum": [ "noSqlDatabase", "sqlDatabase", "function", "storage" ] }, "resourceId": { "type": "string" }, "resourceIds": { "type": "array", "items": { "type": "string" } }, "roleId": { "type": "string" }, "roleIdentity": { "type": "string" }, "roleName": { "type": "string" }, "uid": { "type": "string" }, "username": { "type": "string" }, "pageNo": { "type": "number" }, "pageSize": { "type": "number" } }, "required": [ "action" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "managePermissions", "description": "权限域统一写入口。支持修改资源权限、角色管理、成员与策略增删、应用用户 CRUD。`createUser` / `updateUser` 是环境侧应用用户管理能力,适合测试账号、管理员或预置用户,不应替代浏览器里的 Web SDK 注册表单;前端用户名密码注册应使用 `auth.signUp({ username, password })`,登录应使用 `auth.signInWithPassword({ username, password })`。注意:`securityRule` 的详细语义取决于 `resourceType`;`doc._openid`、`auth.openid`、查询条件子集校验,以及 `create` / `update` / `delete` JSON 模板仅适用于 `resourceType=\"noSqlDatabase\"` 的文档数据库安全规则。配置 `function` 或 `storage` 时,请参考各自官方安全规则文档,而不是复用 NoSQL 模板。", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "updateResourcePermission", "createRole", "updateRole", "deleteRoles", "addRoleMembers", "removeRoleMembers", "addRolePolicies", "removeRolePolicies", "createUser", "updateUser", "deleteUsers" ] }, "resourceType": { "type": "string", "enum": [ "noSqlDatabase", "sqlDatabase", "function", "storage" ], "description": "目标资源类型。`securityRule` 的具体语义依赖这个值;`noSqlDatabase` 使用集合安全规则,`function` 与 `storage` 也有各自独立的安全规则语义,不要套用 NoSQL 规则语法。" }, "resourceId": { "type": "string" }, "permission": { "type": "string", "enum": [ "READONLY", "PRIVATE", "ADMINWRITE", "ADMINONLY", "CUSTOM" ] }, "securityRule": { "type": "string", "description": "资源类型特定的规则内容,详细语义依赖 `resourceType`。当 `resourceType=\"noSqlDatabase\"` 且 `permission=\"CUSTOM\"` 时,应传文档数据库安全规则 JSON(文档型数据库规则:`https://docs.cloudbase.net/database/security-rules`);键通常为 `read` / `create` / `update` / `delete`,值为表达式。重要:`create` 规则验证写入数据,此时文档尚不存在,不能使用 `doc.*`;`read` / `update` / `delete` 规则可使用 `doc.*` 引用已有文档字段。不要把 `doc._openid`、`auth.openid`、查询条件子集校验或 `create` / `update` / `delete` 模板误用于 `function`、`storage` 或 `sqlDatabase`。如需配置 `function` 或 `storage`,请改查官方安全规则文档:云函数 `https://docs.cloudbase.net/cloud-function/security-rules`,云存储 `https://docs.cloudbase.net/storage/security-rules`。示例:{\"read\":\"auth.uid != null\",\"create\":\"auth.uid != null && auth.loginType != \"ANONYMOUS\"\",\"update\":\"auth.uid != null && doc._openid == auth.openid\",\"delete\":\"auth.uid != null && doc._openid == auth.openid\"}" }, "roleId": { "type": "string" }, "roleIds": { "type": "array", "items": { "type": "string" } }, "roleName": { "type": "string" }, "roleIdentity": { "type": "string" }, "description": { "type": "string" }, "memberUids": { "type": "array", "items": { "type": "string" } }, "policies": { "type": "array", "items": { "type": "object", "additionalProperties": {} } }, "uid": { "type": "string" }, "uids": { "type": "array", "items": { "type": "string" } }, "username": { "type": "string" }, "password": { "type": "string" }, "userStatus": { "type": "string", "enum": [ "ACTIVE", "BLOCKED" ] } }, "required": [ "action" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "queryLogs", "description": "日志域统一只读入口。支持检查日志服务状态并搜索 CLS 日志。\n\n**重要区分**:\n- 查询云函数日志:使用 `queryFunctions(action=\"listFunctionLogs\", functionName=\"xxx\")`\n- 查询 CLS 日志(跨服务日志聚合):使用本工具 `queryLogs(action=\"searchLogs\")`\n\n**适用场景**:\n- 检查 CLS 日志服务是否开通:`action=\"checkLogService\"`\n- 跨服务日志搜索(如搜索所有 ERROR 日志):`action=\"searchLogs\"`\n- 按 CLS 语法检索特定服务的日志:`action=\"searchLogs\", service=\"tcb|tcbr\"`", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "checkLogService", "searchLogs" ], "description": "操作类型:\n- `checkLogService`: 检查 CLS 日志服务是否开通\n- `searchLogs`: 搜索 CLS 日志(需要提供 queryString)" }, "queryString": { "type": "string", "description": "CLS 查询语句,**action=\"searchLogs\" 时必填**,需严格遵循 CLS(Cloud Log Service)语法规范,详见 https://cloud.tencent.com/document/api/876/128127\n\n**云函数相关查询**:\n- 云函数日志:`(src:app OR src:system) AND log:\"START RequestId\"`\n- 聚合云函数请求状态:`| select request_id, max(status_code) as status where ((request_id='44738f94-16dd-11f1-****' AND retry_num=0) AND retry_num=0) AND status_code!=202 group by request_id, retry_num`\n\n**云数据库 / 文档型**:\n- 云数据库(文档型):`module:database`\n- 云数据库(文档型)事件:`module:database AND eventType:(MongoSlowQuery)`(MongoSlowQuery 为文档型数据库慢查询事件)\n\n**云数据库 / SQL 型**:\n- 云数据库(SQL 型):`module:rdb`\n- 云数据库(SQL 型)事件:`module:rdb AND eventType:(MysqlFreeze OR MysqlRecover OR MysqlSlowQuery)`(MysqlFreeze 冻结、MysqlRecover 恢复、MysqlSlowQuery 慢查询)\n\n**其它服务**:\n- 审批流:`module:workflow`\n- 模型:`module:model`\n- 用户权限:`module:auth`\n- 大模型:`module:llm AND logType:llm-tracelog`\n- 网关服务调用:`logType:accesslog`\n- 应用发布/删除事件:`module:app AND eventType:(AppProdPub OR AppProdDel)`(AppProdPub 发布事件、AppProdDel 删除事件)\n\n以上仅为示例,实际使用时请根据具体日志内容调整。\n\n**注意**:查询特定云函数的执行日志时,优先使用 `queryFunctions(action=\"listFunctionLogs\", functionName=\"xxx\")`。" }, "service": { "type": "string", "enum": [ "tcb", "tcbr" ], "description": "日志来源服务:\n- `tcb`: 云函数、数据库、存储等基础服务日志\n- `tcbr`: CloudRun 容器服务日志" }, "startTime": { "type": "string", "description": "查询开始时间,格式:`YYYY-MM-DD HH:mm:ss`,如 `2024-01-01 00:00:00`" }, "endTime": { "type": "string", "description": "查询结束时间,格式:`YYYY-MM-DD HH:mm:ss`,如 `2024-01-01 23:59:59`" }, "limit": { "type": "number", "description": "返回日志条数限制,默认 20" }, "context": { "type": "string", "description": "翻页上下文,用于继续上一次查询" }, "sort": { "type": "string", "enum": [ "asc", "desc" ], "description": "按时间排序:`asc` 升序,`desc` 降序" } }, "required": [ "action" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "queryAgents", "description": "Agent 域统一只读入口。支持列表、详情与日志查询。", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "listAgents", "getAgent", "getAgentLogs" ] }, "agentId": { "type": "string" }, "pageNumber": { "type": "number" }, "pageSize": { "type": "number" }, "params": { "type": "object", "additionalProperties": {} } }, "required": [ "action" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "manageAgents", "description": "Agent 域统一写入口。支持创建、更新和删除远端 Agent。", "inputSchema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "createAgent", "updateAgent", "deleteAgent" ] }, "agentId": { "type": "string" }, "params": { "type": "object", "additionalProperties": {} } }, "required": [ "action" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "downloadRemoteFile", "description": "下载远程文件到项目根目录下的指定相对路径。例如:小程序的 Tabbar 等素材图片,必须使用 **png** 格式,可以从 Unsplash、wikimedia【一般选用 500 大小即可、Pexels、Apple 官方 UI 等资源中选择来下载。", "inputSchema": { "type": "object", "properties": { "url": { "type": "string", "description": "远程文件的 URL 地址" }, "relativePath": { "type": "string", "description": "相对于项目根目录的路径,例如:'assets/images/logo.png' 或 'docs/api.md'。不允许使用 ../ 等路径遍历操作。" } }, "required": [ "url", "relativePath" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "activateInviteCode", "description": "云开发 AI编程激励计划,通过邀请码激活用户激励。", "inputSchema": { "type": "object", "properties": { "InviteCode": { "type": "string", "description": "待激活的邀请码" } }, "required": [ "InviteCode" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } }, { "name": "callCloudApi", "description": "通用的云 API 调用工具,主要用于 CloudBase / 腾讯云管控面与依赖资源相关 API 调用。调用前请先确认 service、Action 与 Param,避免猜测 Action 名称。如果你的目标是通过 HTTP 协议直接集成 auth/functions/cloudrun/storage/mysqldb 等 CloudBase 业务 API,请不要优先使用 callCloudApi,而应优先查看对应 OpenAPI / Swagger。现有 OpenAPI / Swagger 能力不是通用的管控面 Action 集合;管控面 API 请优先参考 CloudBase API 概览 https://cloud.tencent.com/document/product/876/34809 与云开发依赖资源接口指引 https://cloud.tencent.com/document/product/876/34808。对于 tcb service,常用 Action 分类如下:\n\n**环境管理**: `CreateEnv`、`ModifyEnv`、`DescribeEnvs`、`DestroyEnv`\n**用户管理**: `CreateUser`、`ModifyUser`、`DescribeUserList`、`DeleteUsers`\n**认证配置**: `EditAuthConfig`、`DescribeAuthDomains`\n**云函数**: `DescribeFunctions`、`CreateFunction`、`UpdateFunctionCode`、`DeleteFunction`\n**数据库**: `CreateMySQLInstance`、`DescribeMySQLInstances`、`DestroyMySQLInstance`\n\n销毁环境时,常见做法是至少带上 `EnvId` 和 `BypassCheck: true`,如果环境已经处于隔离期再按文档补 `IsForce: true`。", "inputSchema": { "type": "object", "properties": { "service": { "type": "string", "enum": [ "tcb", "scf", "sts", "cam", "lowcode", "cdn", "vpc" ], "description": "选择要访问的服务。可选:tcb、scf、sts、cam、lowcode、cdn、vpc。对于 tcb / scf / lowcode 等 CloudBase 管控面 Action,请优先查官方文档,不要直接猜测 Action。" }, "action": { "type": "string", "minLength": 1, "description": "具体 Action 名称,需符合对应服务的官方 API 定义。若不确定正确 Action,请先查官方文档;不要用近义词或历史命名进行猜测。tcb 常用 Action:环境管理 CreateEnv/ModifyEnv/DescribeEnvs/DestroyEnv、用户管理 CreateUser/ModifyUser/DescribeUserList/DeleteUsers、认证配置 EditAuthConfig、云函数 DescribeFunctions/CreateFunction、数据库 CreateMySQLInstance 等。" }, "params": { "type": "object", "additionalProperties": {}, "description": "Action 对应的参数对象,键名需与官方 API 定义一致。某些 Action 需要携带 EnvId 等信息;如不确定参数结构,请先查官方文档。tcb 示例:`{ \"service\": \"tcb\", \"action\": \"DestroyEnv\", \"params\": { \"EnvId\": \"env-xxx\", \"BypassCheck\": true } }`,如果环境已经处于隔离期,可再补 `IsForce: true`;更新环境别名则可用 `{ \"service\": \"tcb\", \"action\": \"ModifyEnv\", \"params\": { \"EnvId\": \"env-xxx\", \"Alias\": \"demo\" } }`。若你的场景是通过 HTTP 协议直接集成 auth/functions/cloudrun/storage/mysqldb 等 CloudBase 业务 API,请优先使用 OpenAPI / Swagger 或 searchKnowledgeBase(mode=\"openapi\"),而不是优先使用 callCloudApi。" } }, "required": [ "service", "action" ], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" } } ] }