Token导航 LogoToken导航TokenDH.com
前端设计执行命令github未标认证来源可访问clear审计通过

relational-database-mcp-cloudbaserelational 数据库 MCP cloudbase

Agent Skill

用于辅助数据库表结构、查询语句、迁移脚本和数据维护任务。它适合让 Agent 分析 schema、编写 SQL、排查查询问题、整理索引或生成迁移建议。使用时需要明确数据库类型、连接环境和目标表,区分只读分析与写入变更;涉及删除、更新、迁移和批量导入时,应优先 dry-run、备份或事务保护,避免误操作。

总安装

17,112

周安装

699

GitHub Stars

51

下载量

5,480
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:relational-database-mcp-cloudbase(relational 数据库 MCP cloudbase)
来源仓库:https://github.com/tencentcloudbase/skills
仓库路径:skills/relational-database-mcp-cloudbase
安装命令:
npx skills add https://github.com/tencentcloudbase/skills --skill relational-database-mcp-cloudbase
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/tencentcloudbase/skills --skill relational-database-mcp-cloudbase

简介

四个 MCP 工具,用于在 CloudBase 关系数据库上安全执行 SQL 和安全规则管理。

  • 四个工具涵盖所有代理操作:executeReadOnlySQL
  • 对于 SELECT 查询,执行WriteSQL
  • 对于插入/更新/删除/DDL,readSecurityRule
  • 检查权限,并写入SecurityRule
  • 更新访问控制
  • 仅在代理上下文中使用 MCP 工具;当这些工具可用时,不要初始化 CloudBase SDK
  • 在进行破坏性操作之前,始终先运行只读 SELECT 来验证假设;包含 LIMIT 子句以防止全表扫描
  • 新表必须包含 _openid VARCHAR(64) DEFAULT '' NOT NULL
  • 每用户访问控制列;服务器自动为经过身份验证的用户填充此字段

SKILL.md

Standalone Install Note

If this environment only installed the current skill, start from the CloudBase main entry and use the published cloudbase/references/... paths for sibling skills.

  • CloudBase main entry: https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/SKILL.md
  • Current skill raw source: https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/relational-database-tool/SKILL.md

Keep local references/... paths for files that ship with the current skill directory. When this file points to a sibling skill such as auth-tool or web-development, use the standalone fallback URL shown next to that reference.

Activation Contract

Use this first when

  • The agent must inspect SQL data, execute SQL statements, provision or destroy MySQL, initialize table structure, or manage table security rules through MCP tools.

Read before writing code if

  • The task includes querySqlDatabase, manageSqlDatabase, queryPermissions, or managePermissions.

Then also read

  • Web application integration -> ../relational-database-web/SKILL.md (standalone fallback: https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/relational-database-web/SKILL.md)
  • Raw HTTP database access -> ../http-api/SKILL.md (standalone fallback: https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/http-api/SKILL.md)

Do NOT use for

  • Frontend or backend application code that should use SDKs instead of MCP operations.

Common mistakes / gotchas

  • Initializing SDKs in an MCP management flow.
  • Running write SQL or DDL before checking whether MySQL is provisioned and ready.
  • Treating document database tasks as MySQL management tasks.
  • Skipping _openid and permissions review after creating new SQL tables.
  • Destroying MySQL without explicit confirmation or without checking whether the environment still needs the instance.

When to use this skill

Use this skill when an agent needs to operate on CloudBase Relational Database via MCP tools, for example:

  • Inspecting or querying SQL data
  • Provisioning MySQL for an environment
  • Destroying MySQL for an environment
  • Polling MySQL provisioning status
  • Modifying data or schema (INSERT/UPDATE/DELETE/DDL)
  • Initializing tables and indexes after MySQL is ready
  • Reading or changing table permissions

Do NOT use this skill for:

  • Building Web or Node.js applications that talk to CloudBase Relational Database directly through SDKs
  • Auth flows or user identity management

How to use this skill (for a coding agent)

  1. Recognize MCP context

- If you can call tools like querySqlDatabase, manageSqlDatabase, queryPermissions, managePermissions, you are in MCP context. - In this context, never initialize SDKs for CloudBase Relational Database; use MCP tools instead.

  1. Pick the right tool for the job

- Read-only SQL and provisioning status checks -> querySqlDatabase - MySQL provisioning, MySQL destruction, write SQL, DDL, schema initialization -> manageSqlDatabase - Inspect permissions -> queryPermissions(action="getResourcePermission") - Change permissions -> managePermissions(action="updateResourcePermission")

  1. Always be explicit about safety

- Before destructive operations (DELETE, DROP, etc.), summarize what you are about to run and why. - Prefer querySqlDatabase(action="getInstanceInfo") or a read-only SQL check before writes. - Provisioning or destroying MySQL requires explicit confirmation because both actions have environment-level impact.


Available MCP tools (CloudBase Relational Database)

These tools are the supported way to interact with CloudBase Relational Database via MCP:

1. querySqlDatabase

  • Purpose: Query SQL data and provisioning state.
  • Use for:

- Running SELECT and other read-only SQL queries with action="runQuery" - Checking whether MySQL already exists with action="getInstanceInfo" - Inspecting asynchronous provisioning progress with action="describeCreateResult" or action="describeTaskStatus"

Example flow:

{
  "action": "runQuery",
  "sql": "SELECT id, email FROM users ORDER BY created_at DESC LIMIT 50"
}

2. manageSqlDatabase

  • Purpose: Manage SQL lifecycle and execute mutating SQL.
  • Use for:

- Provisioning MySQL with action="provisionMySQL" - Destroying MySQL with action="destroyMySQL" - Executing INSERT, UPDATE, DELETE, CREATE TABLE, ALTER TABLE, DROP TABLE with action="runStatement" - Initializing tables and indexes with action="initializeSchema"

Important: When creating a new table, you must include the _openid column for per-user access control:

_openid VARCHAR(64) DEFAULT '' NOT NULL

Note: when a user is logged in, _openid is automatically populated by the server from the authenticated session. Do not manually fill it in normal inserts.

Before calling this tool, confirm:

  • The current environment has a ready MySQL instance, or you have just provisioned one.
  • The target tables and conditions are correct.
  • You have run a corresponding read-only query when appropriate.

When destroying MySQL, confirm:

  • The current environment really should lose the SQL instance.
  • You have explicit confirmation for the destructive action.
  • You are prepared to query describeTaskStatus afterward to inspect the destroy result.

3. queryPermissions

  • Purpose: Read permission configuration for a given SQL table.
  • Use for:

- Understanding who can read/write a table - Auditing permissions on sensitive tables - Call shape: queryPermissions(action="getResourcePermission", resourceType="sqlDatabase", resourceId="<tableName>")

4. managePermissions

  • Purpose: Set or update permissions for a given SQL table.
  • Use for:

- Hardening access to sensitive data - Opening up read access while restricting writes - Updating resource-level permission configuration - Call shape: managePermissions(action="updateResourcePermission", resourceType="sqlDatabase", resourceId="<tableName>", permission="READONLY")

Compatibility

  • Canonical plugin name: permissions
  • Legacy plugin aliases security-rule, security-rules, secret-rule, secret-rules, and access-control are still routed to permissions
  • Legacy tools readSecurityRule and writeSecurityRule are removed; always use queryPermissions and managePermissions

Recommended lifecycle flow

Scenario 1: MySQL is not provisioned yet

  1. Call querySqlDatabase(action="getInstanceInfo").
  2. If no instance exists, call manageSqlDatabase(action="provisionMySQL", confirm=true).
  3. Poll provisioning status with:

- querySqlDatabase(action="describeCreateResult") - querySqlDatabase(action="describeTaskStatus")

  1. Only continue when the returned lifecycle status is READY.
  2. For MySQL provisioning, prefer describeCreateResult; reserve describeTaskStatus for destroy flows whose task response carries TaskName.

Scenario 2: Safely inspect data in a table

  1. Use querySqlDatabase(action="runQuery") with a limited SELECT.
  2. Include LIMIT and relevant filters.
  3. Review the result set and confirm it matches expectations before any write operation.

Scenario 3: Apply schema initialization after provisioning

  1. Confirm MySQL is ready.
  2. Prepare ordered DDL statements.
  3. Run them through manageSqlDatabase(action="initializeSchema").
  4. After creating tables, verify permissions with queryPermissions or managePermissions.

Scenario 4: Execute a targeted write or DDL change

  1. Use querySqlDatabase(action="runQuery") to inspect current data or schema if needed.
  2. Run the mutation once with manageSqlDatabase(action="runStatement").
  3. Validate with another read-only query or by checking security rules.

Scenario 5: Destroy MySQL when the environment no longer needs it

  1. Use querySqlDatabase(action="getInstanceInfo") to confirm the current environment still has a SQL instance.
  2. Call manageSqlDatabase(action="destroyMySQL", confirm=true).
  3. Query querySqlDatabase(action="describeTaskStatus") until the destroy task completes or fails.
  4. If the task succeeds, optionally call querySqlDatabase(action="getInstanceInfo") to confirm the instance no longer exists.
  5. If the task fails, treat the returned error as the terminal result and let the caller decide whether to retry.

Key principle: MCP tools vs SDKs

  • MCP tools are for agent operations and database management:

- Provision MySQL. - Destroy MySQL. - Poll lifecycle state. - Run ad-hoc SQL. - Inspect and change resource permissions. - Do not depend on application auth state.

  • SDKs are for application code:

- Frontend Web apps -> Web Relational Database skill. - Backend Node apps -> Node Relational Database quickstart.

When working as an MCP agent, always prefer these MCP tools for CloudBase Relational Database, and avoid mixing them with SDK initialization in the same flow.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

29.99%
按下载量换算1,643

Cursor

21.93%
按下载量换算1,202

Codex

19.05%
按下载量换算1,044

trae

14.05%
按下载量换算770

codebuddy

7.37%
按下载量换算404

trae-cn

3.71%
按下载量换算203

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/tencentcloudbase/skills --skill relational-database-mcp-cloudbase;npx skills add tencentcloudbase/skills --skill "relational-database-mcp-cloudbase" 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills