setup-cloudbase-openclaw
npx skills add https://github.com/tencentcloudbase/skills --skill setup-cloudbase-openclaw
Agent 安装分布
Skill 文档
Setup CloudBase for OpenClaw/Moltbot
This skill guides you through configuring your OpenClaw/Moltbot installation for CloudBase full-stack development.
Prerequisites
Before starting, ensure you have:
- A Tencent Cloud account with CloudBase enabled
- Access to your CloudBase environment ID and credentials
Quick Setup Overview
| Step | Action | Purpose |
|---|---|---|
| 1 | Check installation dirs | Find where OpenClaw/Moltbot is installed |
| 2 | Locate workspace | Identify the agent workspace directory |
| 3 | Configure MCP | Set up CloudBase MCP with credentials |
| 4 | Update AGENTS.md | Add CloudBase development rules |
| 5 | Install skill-enhancer plugin (optional) | Install plugin to enforce skill usage |
| 6 | Install skills | Install CloudBase-related skills |
| 7 | Copy app template (optional) | Copy CloudBase React template to workspace |
| 8 | Apply changes | Use /new to start a new session |
Step 1: Check Installation Directories
First, identify which directory your installation uses:
# Check for OpenClaw directory
ls -la ~/.openclaw/
# Or check for Moltbot directory
ls -la ~/.clawdbot/
# Or check for standard moltbot config
ls -la ~/.moltbot/
What to look for:
- Configuration file:
moltbot.jsonorconfig.json - Workspace path defined in the config
- Existing
skills/directory
Run the setup script to auto-detect:
npx @cloudbase/setup-openclaw detect
This command automatically downloads and runs the latest version of the setup script from npm.
Step 2: Locate Workspace Directory
The workspace is where your agent reads/writes files and where AGENTS.md lives.
Find it in your config:
# Read config and find workspace
cat ~/.openclaw/moltbot.json | grep '"workspace"'
# or
cat ~/.clawdbot/moltbot.json | grep '"workspace"'
# or
cat ~/.moltbot/moltbot.json | grep '"workspace"'
Common default workspaces:
~/clawd/– Default for many installations~/.openclaw/workspace/– OpenClaw default- Custom path specified in your config
Note this path â you’ll need it for Step 4.
Step 3: Configure CloudBase MCP
3.1 Get Your CloudBase Credentials
You need three values:
- Environment ID (EnvId) – Your CloudBase environment identifier
- SecretId – Tencent Cloud API Secret ID
- SecretKey – Tencent Cloud API Secret Key
How to get them:
-
EnvId: Go to CloudBase Console
- Select your environment
- Copy the Environment ID from the top-left corner
-
SecretId & SecretKey: Go to CAM API Key Management
- Create a new API key or use existing
- Copy both SecretId and SecretKey
3.2 Create or Update mcporter Config
In your workspace directory, create or update config/mcporter.json:
# First, create the config directory if it doesn't exist
mkdir -p <workspace>/config
# Then create the mcporter.json file
nano <workspace>/config/mcporter.json
Add the following configuration:
{
"mcpServers": {
"cloudbase-mcp": {
"description": "CloudBase MCP",
"command": "npx",
"args": ["@cloudbase/cloudbase-mcp@latest"],
"env": {
"TENCENTCLOUD_SECRETID": "your_secret_id_here",
"TENCENTCLOUD_SECRETKEY": "your_secret_key_here",
"CLOUDBASE_ENV_ID": "your_env_id_here"
}
}
}
}
ç¨æ·å¿ é¡»æä¾ä»¥ä¸ä¸é¡¹å¹¶æ¿æ¢å ä½ç¬¦ï¼MCP æè½æ£å¸¸è°ç¨äºå¼åï¼
å¦ä½è·åï¼
- TENCENTCLOUD_SECRETID / TENCENTCLOUD_SECRETKEYï¼ç»å½ è ¾è®¯äºæ§å¶å° â 访é®ç®¡ç API å¯é¥ â åå»ºææ¥çå¯é¥ï¼å¾å° SecretId ä¸ SecretKeyã
- CLOUDBASE_ENV_IDï¼ç»å½ äºå¼åæ§å¶å° â éæ©ç¯å¢ â å¨ãæ¦è§ãæã设置ã䏿¥çãç¯å¢ IDãï¼å½¢å¦
xxx-xxxxxï¼ã
3.3 Verify MCP Configuration
Test that mcporter can load the configuration:
cd <workspace>
npx mcporter list
You should see cloudbase-mcp in the list of available MCP servers.
Step 4: Update AGENTS.md
Add CloudBase development rules to your workspace’s AGENTS.md.
If AGENTS.md doesn’t exist, create it:
nano <workspace>/AGENTS.md
Add the following CloudBase section:
## CloudBase Development
When working with CloudBase projects, the agent MUST:
1. **Read skills first** - Before writing any code, read the relevant CloudBase skills:
- `cloudbase-guidelines` - Essential development guidelines
- `web-development` - For web apps with static hosting
- `miniprogram-development` - For WeChat mini programs
- `cloud-functions` - For cloud function development
- `auth-web-cloudbase` - For web authentication
- `cloudbase-document-database-web-sdk` - For document database operations
2. **Use MCP, not CLI** - All CloudBase operations must go through CloudBase MCP tools:
- Environment queries via MCP
- Database configuration via MCP
- Cloud function deployment via MCP
- Do NOT use the CloudBase CLI (it requires interactive login)
3. **Prefer SDK + security rules** - If the requirement can be satisfied with the document database SDK and security rules alone, do NOT introduce cloud functions.
4. The workspace includes a **CloudBase + React template** (`app/` directory) that you can copy as a starting point for new projects.
5. **Deploy to subdirectory (mandatory)** - When deploying web apps to static hosting, you MUST use a subdirectory path (e.g., `/my-app/`), not the root, unless the user explicitly asks otherwise.
6. **Auto-deploy web apps** - After completing a web application, automatically deploy it to CloudBase static hosting using MCP tools.
Step 5: Install Skill Enhancer Plugin (Optional)
The skill-enhancer plugin automatically instructs the model to list available skills and justify their usage before responding, ensuring skills are properly considered before writing code.
5.1 Install the Plugin
npx @cloudbase/setup-openclaw install-plugin
What it does:
- Detects your OpenClaw/Moltbot installation directory (
~/.openclaw/,~/.clawdbot/, or~/.moltbot/) - Creates
extensions/skill-enhancer/directory in the installation directory - Copies plugin files (
openclaw.plugin.jsonandindex.ts) from the skill package - Creates or updates
openclaw.jsonto enable the plugin - Provides instructions to restart the gateway
5.2 Plugin Behavior
The plugin injects instructions into the model’s context before each turn:
- Lists available Skills that can be used for the request
- States the reason for calling each Skill
- Prevents skipping Skills – requires reading relevant skills before writing code
Example: When working with CloudBase projects, the model will be instructed to read cloudbase-guidelines skill FIRST before writing any code.
5.3 Restart Gateway
After installation, restart the gateway to load the plugin:
# For Moltbot
moltbot gateway restart
# For OpenClaw
openclaw gateway restart
# Or for Clawdbot
clawdbot restart
Verify plugin is loaded:
After restarting, the plugin will automatically inject instructions into the model’s context. You can verify this by asking the agent a question and checking if it lists available skills before responding.
Step 6: Install CloudBase Skills
Install the CloudBase skills package to make all CloudBase-related skills available:
# Option 1: Install to workspace skills (single workspace)
cd <workspace>
npx skills add tencentcloudbase/skills -y
# Option 2: Install to shared skills (all agents on this machine)
npx skills add tencentcloudbase/skills -y --workdir ~/.openclaw/skills
# or
npx skills add tencentcloudbase/skills -y --workdir ~/.clawdbot/skills
Verify installation:
ls skills/ | grep cloudbase
You should see skills like:
cloudbase-guidelinesweb-developmentminiprogram-developmentcloud-functionsauth-web-cloudbase- etc.
Step 7: Apply Changes
Use /new to start a new session so the agent picks up the updated configuration (AGENTS.md, MCP, skills).
Verification
To verify everything is working correctly:
-
Check MCP is available:
Ask the agent: "List available MCP tools" Should see CloudBase-related tools -
Check skills are loaded:
Ask the agent: "What CloudBase skills do you have?" Should list cloudbase-guidelines, web-development, etc. -
Test a CloudBase query:
Ask the agent: "Check my CloudBase environment info" Should use MCP to query environment details -
Verify plugin is working (if installed):
Ask the agent: "Create a simple CloudBase web app" Should list available skills (e.g., cloudbase-guidelines, web-development) before writing code
Troubleshooting
MCP not showing up
- Verify mcporter.json syntax is valid JSON
- Check that credentials are correct (no extra spaces)
- Restart the gateway after config changes
- Run
npx mcporter listto verify MCP servers
Skills not loading
- Check that skills are in the correct directory
- Verify SYMLINKS are created correctly in
<workspace>/skills/ - Restart the gateway after installing skills
- Check file permissions on skill directories
Workspace not found
- Verify the workspace path in your config file
- Ensure AGENTS.md exists in the workspace root
- Check that the agent has read/write permissions
Plugin not working
- Verify plugin files exist in
~/.openclaw/extensions/skill-enhancer/(or equivalent for your installation) - Check that
openclaw.jsonhas the plugin enabled:"skill-enhancer": { "enabled": true } - Restart the gateway after installation
- Check gateway logs for plugin loading errors
- Ensure you’re using a version of OpenClaw that supports plugins
Reference: OpenClaw Skills Loading
OpenClaw loads skills from multiple locations, in priority order:
- Workspace skills (
<workspace>/skills/) – Highest priority, single workspace - Managed skills (
~/.openclaw/skills/or~/.clawdbot/skills/) – All agents - Bundled skills – Installation default, lowest priority
Tip: Install CloudBase skills to managed skills (~/.openclaw/skills/) to make them available to all agents on the system.