Skip to content

Commit b4d2367

Browse files
chore: sync from CloudBase-MCP
1 parent 14d1d49 commit b4d2367

9 files changed

Lines changed: 125 additions & 35 deletions

File tree

‎.mcp.json‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"mcpServers": {
3-
"cloudbase-mcp": {
3+
"cloudbase-remote": {
4+
"type": "http",
5+
"url": "https://tcb-api.cloud.tencent.com/mcp/v1"
6+
},
7+
"cloudbase-local": {
48
"command": "npx",
59
"args": ["-y", "@cloudbase/cloudbase-mcp@latest"],
610
"env": {}

‎cloudbase-session.md‎

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,26 @@ CloudBase has 4 scenarios — the detected scenario should guide your primary ap
1717
- **CloudRun** (container/Docker) → `cloudrun-development` + `cloud-functions`
1818
- **Database** (schema design) → `data-model-creation` + `relational-database-mcp-cloudbase` or `postgresql-development-cloudbase`
1919

20+
## Two MCP servers are connected
21+
22+
The plugin wires both a hosted server (`cloudbase-remote`, OAuth over Streamable HTTP) and a local one (`cloudbase-local`, stdio via `npx`). They expose the same tool names, so pick one deliberately instead of mixing calls across them.
23+
24+
Use `cloudbase-remote` by default. Switch to `cloudbase-local` when any one of these applies:
25+
26+
- the account signs in with a CloudBase API key (`CLOUDBASE_API_KEY`) — the hosted endpoint accepts only OAuth or Tencent Cloud SecretId/SecretKey, it has no API-key path
27+
- the session has to cover both the domestic and the international site — a hosted URL is bound to one site, the local server switches with `TCB_SITE`
28+
- the task needs a tool the hosted server does not register: `manageStorage` for uploading or downloading local files, `downloadTemplate`, `manageCloudRun`, or the declarative `deployBuild` / `deployPlan` / `deployApply` set
29+
- `cloudbase-remote` returns `401` and the user cannot finish a browser login
30+
31+
**Deploying functions or apps does not require the local server.** On the hosted one, deploy by two-step upload: `queryFunctions(action="getFunctionUploadUrl")` or `queryApps(action="getUploadUrl")` → `PUT` the zip → `manageFunctions` with the `code` triple or `manageApps(action="deployApp", cosTimestamp=…)`. What the hosted server lacks is the declarative `cloudbaserc` executor and a dry-run before applying.
32+
33+
`cloudbase-remote` has no `auth` tool: the browser OAuth flow (sign in → pick an environment → consent) *is* the login, so do not look for `auth` there and do not ask for API keys. `cloudbase-local` does expose `auth` — use it there.
34+
2035
## Mandatory first step
2136

22-
When CloudBase MCP tools are available in this session, resolve the session in this order — every management tool fails with `AUTH_REQUIRED` / `ENV_REQUIRED` until steps 1 and 2 are done:
37+
When CloudBase MCP tools are available in this session, resolve the session in this order — management tools fail with `ENV_REQUIRED` until an environment is bound:
2338

24-
1. `auth({ action: "status" })` — confirm the login; if not logged in, complete `auth({ action: "start_auth" })` first.
25-
2. `auth({ action: "set_env", envId: "<EnvId>" })` — bind the target environment when none is bound yet.
26-
3. `queryEnv({ action: "info" })` — then resolve:
39+
1. `queryEnv({ action: "info" })` on the server you are using — confirm the bound environment, then resolve:
2740
- `envId` — use in all subsequent config files and code
2841
- `RuntimeMode` — `"postgresql"` or `"nosql"` (determines database skill routing)
2942
- `RuntimeModeHints.RecommendedSkills` — backend-recommended skills for this environment

‎gemini-extension.json‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@
44
"description": "Tencent CloudBase — AI models, auth, NoSQL/PostgreSQL databases, cloud functions, storage, CloudRun, and WeChat Mini Program integration.",
55
"contextFileName": "GEMINI.md",
66
"mcpServers": {
7-
"cloudbase": {
7+
"cloudbase-remote": {
8+
"httpUrl": "https://tcb-api.cloud.tencent.com/mcp/v1"
9+
},
10+
"cloudbase-local": {
811
"command": "npx",
9-
"args": ["npm-global-exec@latest", "@cloudbase/cloudbase-mcp@latest"],
12+
"args": [
13+
"-y",
14+
"@cloudbase/cloudbase-mcp@latest"
15+
],
1016
"env": {
1117
"INTEGRATION_IDE": "Gemini"
1218
}

‎kimi.plugin.json‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@
3030
"sessionStart": {
3131
"skill": "cloudbase"
3232
},
33-
"skillInstructions": "Log in via the plugin's MCP `auth` tool (device-code flow) \u2014 no long-lived API keys are accepted. Prefer this plugin's MCP tools for all CloudBase operations. Domain knowledge is fetched on demand via the routing skill (searchKnowledgeBase mode=skill).",
33+
"skillInstructions": "Two MCP servers are connected: `cloudbase-remote` (hosted, sign in through Kimi's MCP OAuth flow via `/mcp-config login`) and `cloudbase-local` (local stdio, use it when the account signs in with a CloudBase API key or the task needs local files). Prefer the remote one by default. Domain knowledge is fetched on demand via the routing skill (searchKnowledgeBase mode=skill).",
3434
"mcpServers": {
35-
"cloudbase": {
35+
"cloudbase-remote": {
36+
"url": "https://tcb-api.cloud.tencent.com/mcp/v1"
37+
},
38+
"cloudbase-local": {
3639
"command": "npx",
3740
"args": [
3841
"-y",
3942
"@cloudbase/cloudbase-mcp@latest"
40-
],
41-
"env": {
42-
"INTEGRATION_IDE": "Kimi"
43-
}
43+
]
4444
}
4545
},
4646
"hooks": []

‎mcp.json‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"mcpServers": {
3-
"cloudbase-mcp": {
3+
"cloudbase-remote": {
4+
"type": "http",
5+
"url": "https://tcb-api.cloud.tencent.com/mcp/v1"
6+
},
7+
"cloudbase-local": {
48
"command": "npx",
59
"args": [
610
"-y",

‎skills/cloudbase-declarative-deploy/SKILL.md‎

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,29 +46,57 @@ missing constraints (or to install the missing skill). Do **not** HTTP-fetch rem
4646
- In-app SDK integration (web/miniprogram/node) → the matching SDK skill.
4747
- Console UI operations.
4848

49-
## Cloud mode
49+
## Cloud mode: deploy through the two-step upload channel
5050

5151
`deployBuild` / `deployPlan` / `deployApply` in this skill are the **local-form declarative
52-
executor**. In cloud-hosted MCP mode these tools are intentionally not registered
53-
(filtered at tool registration), because that runtime has no local `cwd` /
54-
filesystem-bound execution path.
52+
executor**. In cloud-hosted MCP mode they are intentionally not registered, because that
53+
runtime has no local `cwd` and no filesystem-bound execution path.
5554

56-
If you are in cloud mode and do not see `deployBuild` / `deployPlan` / `deployApply` in the
57-
tool list, this is expected behavior.
55+
This is an **execution-channel switch, not a capability gap**. Everything still deploys, but
56+
the artifact is uploaded first and the build runs in the cloud. If those three tools are
57+
missing from the tool list, that is expected — pick the channel that matches the resource.
5858

59-
Use the cloud upload-channel path instead:
59+
### Cloud functions — two-phase zip
6060

61-
1. `queryApps(action=getUploadUrl)` to get `uploadUrl`, `uploadHeaders`, `unixTimestamp`
62-
2. Upload source/build zip to `uploadUrl` with returned headers
63-
- If cloud build requires private/offline dependencies, package `node_modules` explicitly
64-
- For public dependencies, uploading `package.json` + lockfile is typically enough
65-
3. `manageApps(action=deployApp, cosTimestamp=<unixTimestamp>, installCmd?, buildCmd?, deployCmd?)`
66-
- `installCmd` / `buildCmd` / `deployCmd` are pipeline declarations executed in cloud container
67-
- Agent passes data + declarations; it does not execute local shell commands
61+
1. `queryFunctions(action=getFunctionUploadUrl, functionName?)` returns `uploadUrl`,
62+
`uploadHeaders`, `cosBucketName`, `cosBucketRegion`, `cosObjectName`, `expiresInSeconds`
63+
2. `PUT` the function zip to `uploadUrl` with `uploadHeaders`
64+
3. `manageFunctions(action=createFunction|updateFunctionCode, code={cosBucketName,
65+
cosObjectName, cosBucketRegion?})` — phase B deploys from the environment's own COS bucket
66+
(`deployMode=cos`); pass the triple through unchanged, the schema is strict
67+
68+
`contentPath` (a local directory) is rejected in cloud mode. For layer contents use
69+
`base64Content`; for code use the two-phase path above.
6870

69-
Planned cloud declarative path (incremental roadmap): upload `cloudbaserc` as a data
70-
artifact, then run server-side plan/apply orchestration. `deployApply` remains the
71-
local-form executor of the same declarative spec.
71+
### CloudApp — two-step upload plus a cloud pipeline
72+
73+
1. `queryApps(action=getUploadUrl, serviceName=...)` returns `uploadUrl`, `uploadHeaders`,
74+
`unixTimestamp`
75+
2. Upload the source/build zip to `uploadUrl` with the returned headers
76+
(`Content-Type: application/zip`)
77+
- Public dependencies resolvable from a lockfile: `package.json` plus lockfile is enough
78+
- Private or offline dependencies: package `node_modules` explicitly
79+
3. `manageApps(action=deployApp, cosTimestamp=<unixTimestamp>, installCmd?, buildCmd?, deployCmd?)`
80+
- `installCmd` / `buildCmd` / `deployCmd` are pipeline declarations executed in the cloud
81+
container; you pass data and declarations, you do not run local shell commands
82+
83+
### Static hosting — route through CloudApp
84+
85+
`manageHosting(action=upload)` is blocked in cloud mode because it needs a local path.
86+
Deploy a static site through the CloudApp two-step upload above (upload the prebuilt
87+
artifact, exclude `node_modules`). Uploading or downloading an already-hosted file has no
88+
remote substitute and needs local mode. The other hosting actions (`delete`,
89+
`setWebsiteDocument`, `enableService`, `bindDomain`, `unbindDomain`, `updateDomain`) remain
90+
available.
91+
92+
### What cloud mode does not give you
93+
94+
- **No dry-run.** There is no `deployPlan` against a local `cloudbaserc`. Do not claim a plan
95+
was generated or reviewed in cloud mode; state what is about to be deployed and what the
96+
upload contains. Roadmap: upload `cloudbaserc` as a data artifact, then run server-side
97+
plan/apply orchestration.
98+
- **No local project context.** `mode` / `envOverrides` resolution from a project file does
99+
not apply; pass the target environment explicitly.
72100

73101
For parameter details, see `references/plan-and-apply.md` (`Cloud-hosted upload pipeline path`).
74102

‎skills/cloudbase-mcp/SKILL.md‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,17 @@ The hostname decides the site. Remote URLs do not take a `site` query parameter.
5151
- CI: add `env_id` and headers `X-TencentCloud-SecretId` / `X-TencentCloud-SecretKey`.
5252
- Local stdio for the international site: `TCB_SITE=intl` and `TCB_REGION=ap-singapore`.
5353

54-
Remote mode cannot upload local files or download templates. The international site does not expose NoSQL tools.
54+
Pick the mode by these rules:
55+
56+
- **Remote** — the default. Interactive sign-in (browser OAuth) plus anything that runs entirely in the cloud.
57+
- **Local** — when any one of these applies:
58+
- the account signs in with a CloudBase API key (`CLOUDBASE_API_KEY`); remote has no API-key path, it accepts OAuth or Tencent Cloud SecretId/SecretKey only
59+
- one session has to cover both the domestic and the international site; a remote URL is bound to a single site, while local switches with `TCB_SITE`
60+
- the task needs a tool that remote does not register: `manageStorage` for uploading or downloading local files, `downloadTemplate`, `manageCloudRun`, or the declarative `deployBuild` / `deployPlan` / `deployApply` set
61+
62+
**Deploying functions or apps does not require local mode.** Remote deploys through the two-step upload: `queryFunctions(action="getFunctionUploadUrl")` or `queryApps(action="getUploadUrl")` → `PUT` the zip → `manageFunctions` with the `code` triple or `manageApps(action="deployApp", cosTimestamp=…)`. What remote lacks is the declarative `cloudbaserc` executor and a dry-run before applying.
63+
64+
The international site does not expose NoSQL tools in either mode.
5565

5666
## Calling tools with mcporter
5767

‎skills/cloudbase/SKILL.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ Infer it when you can (console domain, envId, an existing error); otherwise **as
1818
| | 国内站 domestic | 国际站 international |
1919
|---|---|---|
2020
| Remote MCP (preferred) | `https://tcb-api.cloud.tencent.com/mcp/v1` | `https://tcb-api.tencentcloud.com/mcp/v1` |
21-
| Local stdio MCP | default — nothing to set | `TCB_SITE=intl` + `TCB_REGION=ap-singapore` |
21+
| Local stdio MCP | nothing to set (`TCB_SITE` is domestic by default) | `TCB_SITE=intl` + `TCB_REGION=ap-singapore` |
2222
| `tcb` CLI | default | `TCB_IS_INTL=true` (or `tcb config set isIntl true`) |
2323
| Project record `.cloudbase/project.json` | `site` omitted, or `"domestic"` | `"site": "intl"`, `"region": "ap-singapore"` |
2424
| Console | `tcb.cloud.tencent.com` | `tcb.tencentcloud.com` |
2525
| Default region | `ap-shanghai` | `ap-singapore` |
2626
| NoSQL / document DB tools | available | **not available** |
2727

28-
- **International users: connect the international remote MCP endpoint directly** — `https://tcb-api.tencentcloud.com/mcp/v1`. It is a first-class hosted endpoint; OAuth covers the login. The site is decided by the host, so there is no `site` query parameter to pass.
29-
- Domestic remote MCP is the same shape at `https://tcb-api.cloud.tencent.com/mcp/v1` — that stays the default for domestic users.
28+
- **Connect remote by default.** Both hosts are first-class endpoints: OAuth covers the login and the hostname decides the site, so there is no `site` parameter to pass. International: `https://tcb-api.tencentcloud.com/mcp/v1`; domestic: `https://tcb-api.cloud.tencent.com/mcp/v1`.
29+
- **Use local stdio only when something requires it** — an account signing in with a CloudBase API key, one session that must cover both sites (a remote URL is bound to one), or a task that needs a tool the hosted endpoint does not register. Deploying functions or apps is not a reason: that works remotely through the two-step upload. Comparison: `references/mcp-setup.md`.
3030
- `TCB_IS_INTL` (CLI) and `TCB_SITE` (MCP) are **different variable names for different tools**. Set the one matching the tool in use; setting the wrong one silently does nothing.
3131
- On a first run, **settle the site once and persist it** — the CLI switch is machine-global, the MCP switch is per-client, and only `.cloudbase/project.json` is project-scoped and readable by MCP after a restart. Follow `references/site-onboarding.md`; do not re-ask on later sessions.
3232

‎skills/cloudbase/references/mcp-setup.md‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
# CloudBase MCP Setup Reference
22

3+
## Remote versus local
4+
5+
Both connect to the same tools; they differ in where the server runs and therefore in what it can reach.
6+
7+
| | Remote (Streamable HTTP) | Local (stdio, `npx`) |
8+
|---|---|---|
9+
| Login | OAuth in the browser, or `X-TencentCloud-SecretId` / `X-TencentCloud-SecretKey` | `auth` tool: device-code login, or `CLOUDBASE_API_KEY` |
10+
| CloudBase API key | not supported | supported (`CLOUDBASE_API_KEY` + `CLOUDBASE_ENV_ID`) |
11+
| Node.js on the machine | not needed | required (18.15+) |
12+
| `manageStorage` local file upload/download, `downloadTemplate` | not registered | yes |
13+
| Declarative `deployBuild` / `deployPlan` / `deployApply` | not registered — deploy through the two-step upload channel instead | yes |
14+
| `manageHosting` upload / download | blocked | yes |
15+
| Site selection | decided by the hostname | `TCB_SITE`, defaults to domestic |
16+
| NoSQL tools on the international site | not available | available |
17+
18+
Pick remote by default. Switch to local when any one of these applies:
19+
20+
- the account signs in with a CloudBase API key (`CLOUDBASE_API_KEY`) — remote has no API-key path
21+
- one session has to cover both the domestic and the international site — a remote URL is bound to a single site, while local switches with `TCB_SITE`
22+
- the task needs a tool that remote does not register: `manageStorage` for uploading or downloading local files, `downloadTemplate`, `manageCloudRun`, or the declarative `deployBuild` / `deployPlan` / `deployApply` set
23+
24+
**Deploying functions or apps does not require local mode.** Remote deploys through the two-step upload — `queryFunctions(action="getFunctionUploadUrl")` or `queryApps(action="getUploadUrl")` → `PUT` the zip → `manageFunctions` with the `code` triple or `manageApps(action="deployApp", cosTimestamp=…)`. What remote lacks is the declarative `cloudbaserc` executor and a dry-run before applying.
25+
26+
The plugin installs both (`cloudbase-remote` and `cloudbase-local`) so either path stays reachable in the same session.
27+
328
## Site: domestic or international (decide first)
429

530
CloudBase has two independent account systems — 国内站 (`cloud.tencent.com`) and 国际站 (`tencentcloud.com`). Env, console, API keys, and login state do not cross over, and a wrong-site login looks like *"logged in, but no environments"*. Confirm the site before configuring MCP. Ask the user if the console domain / envId does not make it obvious.

0 commit comments

Comments
 (0)