Relational database mcp cloudbase

From TencentCloudBase/CloudBase-AI-Toolkit · View interactive version

Relational database mcp cloudbase is an AI agent skill from the GitHub repository TencentCloudBase/CloudBase-AI-Toolkit. [Deprecated] Existing CloudBase MySQL only. Do not recommend MySQL for new relational work — use postgresql-development. Read this when the environment already has a MySQL instance and the task is queryMysqlDatabase, manageMysqlDatabase, queryPermissions, or managePermissions (inspect, write SQL, sc

How to use this skill

Skill file

Sibling skills (local only)

Sibling CloudBase skills ship beside this skill. Use local relative paths such as ../auth-tool-cloudbase/SKILL.md.

If a referenced sibling skill file is missing from this environment, ask the user to install the full CloudBase plugin (or the missing skill). Do not HTTP-fetch remote skill or protocol markdown into the agent context.

Activation Contract

Use this first when

Read before writing code if

Then also read

Do NOT use for

Common mistakes / gotchas

When to use this skill

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

Do NOT use this skill for:

How to use this skill (for a coding agent)

  1. Recognize MCP context
  1. Pick the right tool for the job
  1. Always be explicit about safety

Available MCP tools (CloudBase Relational Database)

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

1. `queryMysqlDatabase`

Example flow:

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

Do NOT call getConnectionInfo and then wire pymysql / mysql2 / DATABASE_URL into a cloud function for greenfield apps. Platform-delegated SQL and SDK access are the default.

2. `manageMysqlDatabase`

Provisioning is not available here. provisionMySQL has been removed from the action set: a call carrying it fails schema validation, and a missing instance returns MYSQL_NOT_CREATED with a console entry rather than a create hint.

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:

When destroying MySQL, confirm:

3. `queryPermissions`

4. `managePermissions`

Compatibility


Recommended lifecycle flow

Scenario 1: The environment has no MySQL instance

  1. Call queryMysqlDatabase(action="getInstanceInfo").
  2. If no instance exists, stop. MySQL provisioning is no longer available through MCP: the result is MYSQL_NOT_CREATED with a console entry and no create hint.
  3. New environments should use CloudBase PostgreSQL — see ../postgresql-development-cloudbase/SKILL.md.
  4. An instance created outside the tool can still be observed: poll queryMysqlDatabase(action="describeCreateResult") or queryMysqlDatabase(action="describeTaskStatus"), and only continue once the lifecycle status is READY.
  5. Reserve describeTaskStatus for destroy flows whose task response carries TaskName.

Scenario 2: Safely inspect data in a table

  1. Use queryMysqlDatabase(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 on a ready instance

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

Scenario 4: Execute a targeted write or DDL change

  1. Use queryMysqlDatabase(action="runQuery") to inspect current data or schema if needed.
  2. Run the mutation once with manageMysqlDatabase(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 queryMysqlDatabase(action="getInstanceInfo") to confirm the current environment still has a SQL instance.
  2. Call manageMysqlDatabase(action="destroyMySQL", confirm=true).
  3. Query queryMysqlDatabase(action="describeTaskStatus") until the destroy task completes or fails.
  4. If the task succeeds, optionally call queryMysqlDatabase(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

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.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.