bmob-cloud-function-development

Solid

Write, upload, verify, and sync Bmob server-side cloud functions using the Bmob MCP server when available. Use when the user asks to 编写云函数, 写云函数, 上传云函数, 部署云函数, 发布云函数, 同步云函数, 同步函数, 拉取云函数, 下载云函数, 验证云函数结果, or mentions `function onRequest(request, response, modules)`.

DevOps & Infrastructure 2 stars 0 forks Updated today MIT

Install

View on GitHub

Quality Score: 78/100

Stars 20%
16
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Bmob 云函数开发 用于**写运行在 Bmob 服务器上的云函数源码**,并在已配置 MCP 时走 **`deploy_cloud_function` → `invoke_cloud_function`** 完成上传与验证,或走 **`list_cloud_functions` → `get_cloud_function`** 将线上函数同步到本地。 ## 先判断走哪条通道 1. **已配置 Bmob MCP**:优先用 `bmob-mcp` - 上传源码:`deploy_cloud_function` - 单独验证:`invoke_cloud_function` - **同步线上 → 本地**:`list_cloud_functions` → `get_cloud_function`(agent 写本地文件) 2. **未配置 MCP**:按 [云函数文档](https://github.com/bmob/BmobDocs/blob/master/mds/cloud_function/web/develop_doc.md) 与 REST `/1/functions/<name>` / 控制台流程给代码与 curl ## 语法基线 默认按 Bmob 云函数文档的 Web/Node 风格写: ```javascript function onRequest(request, response, modules) { response.send("hello"); } ``` - GET 直连参数:`request.query.xxx` - POST / REST 参数:`request.body.xxx` - 返回结果:`response.send(...)` - 数据库 / 文件 / HTTP / 加密:从 `modules` 取 `oData`、`oFile`、`oHttp`、`oCrypto` 等 ## 必须遵守的已知行为 - 通过 REST API 调用时,参数从 **`request.body`** 取,不是 `request.query` - 云函数里很多回调返回的是**字符串**,需要 `JSON.parse(data)` 后再当对象用 - 已知行为:服务端可能把传入 `request.body` 的值转成字符串;涉及数字、布尔、数组、对象时,在云函数内显式 `parseInt` / `=== "true"` / `JSON.parse` - **`modules.oData` 的 `where` 是 JSON 对象,不要 `JSON.stringify`**: - ✅ 云函数内:`db.find({ "table": "Level", "where": { "status": 1 } })` - ❌ 错误:`"where": JSON.stringify(where)` — 会把条件变成字符串,查询失效或行为异常 - 仅 **REST GET 的 query 参数** `where` 才需要 URL 编码的 JSON 字符串(见 `bmob-database-restful`);**不要**把 REST 写法套进 `oData` ## 默认工作流 ### 1. 写源码 - 函数名与用户要调用的名字一致 - 优先写最小可验证版本,再逐步扩展 - 如果要查表 / 改表,先确认表名与字段名;用户已配 MCP 时先读 `get_project_tables` ### 2. 上...

Details

Author
bmob
Repository
bmob/agent-skills
Created
2 months ago
Last Updated
today
Language
Java
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

API & Backend Solid

bmob-mcp

Use when the user has the Bmob MCP server configured (http://mcp.bmobapp.com/mcp) and wants to perform LIVE operations against their Bmob backend cloud project from the IDE. Triggers: 'list bmob tables', 'show bmob schema', 'create bmob table', 'add a row to bmob', 'update bmob record', 'delete bmob data', '生成 bmob curl', 'design bmob schema', '上传云函数', '部署云函数', '发布云函数', '同步云函数', '同步函数', '拉取云函数', '下载云函数', '调用云函数', '执行云函数', 'invoke cloud function', 'run cloud function', '一键部署网站', '静态托管', '部署静态站点', 'deploy static site', 'deploy website'. Provides 12 tools: get_project_tables (ALWAYS call first to discover schema before any write), create_table, add_single_data, update_single_data, delete_single_data, generate_code, deploy_cloud_function, invoke_cloud_function, list_cloud_functions, get_cloud_function, deploy_static_site, mcp_endpoint_mcp_post. NOT for writing client/SDK code that will ship in the user's app — for that use bmob-database-{javascript,android,ios,swift,flutter,restful}. NOT for ACL / role design (us

2 Updated today
bmob
API & Backend Solid

bmob

Use whenever the user mentions Bmob backend cloud (Bmob, BmobApp, bmobapp.com, Bmob 后端云) for ANY task: design data tables, perform CRUD, sign up / login users, upload files, push notifications, send SMS, accept payments, write or invoke cloud functions, configure ACL / roles, debug error codes, or operate the project via the Bmob MCP server. This is the routing entry — it dispatches to platform-specific skills: bmob-database-{javascript,android,ios,swift,flutter,restful}, bmob-auth-*, bmob-storage-*, bmob-cloud-function-*, bmob-mcp, bmob-error-codes, bmob-bql, bmob-acl-and-roles. For operation-level MCP vs SDK vs REST routing, read shared/operation-routing.md. NOT a substitute for those sub-skills — once the platform and feature are clear, read and follow the matching sub-skill before writing code.

2 Updated today
bmob
API & Backend Solid

bmob-database-restful

Use when interacting with Bmob backend cloud over plain HTTP / curl from ANY language that lacks a Bmob SDK — Python (requests/httpx), Go (net/http), PHP (Guzzle), C# (HttpClient), Rust (reqwest), Ruby, Java backend, Bash, Deno, server-side scripting, data migration. Also use when the user explicitly wants curl or the raw REST API URL pattern. API base domain: https://api.codenow.cn (e.g. /1/classes/Token). Triggers: /1/classes/, /1/users, /1/batch, /1/cloudQuery, /1/timestamp, /1/requestSmsCode, X-Bmob-Application-Id, X-Bmob-REST-API-Key, X-Bmob-Safe-Sign, simple auth, encrypted auth, MD5 signature, curl bmob, Bmob REST API, Bmob HTTP. NOT for JavaScript / Node / Web / Mini Program (use bmob-database-javascript), Android (use bmob-database-android), iOS (use bmob-database-ios), or Flutter / Dart (use bmob-database-flutter). If Bmob MCP is configured, generate_code MCP tool can emit ready-to-use curl for 13 operation types — prefer it over hand-writing curl.

2 Updated today
bmob