鱼皮AI导航
鱼皮AI导航
  • 主页
  • 社区
  • AI工具
  • AI知识库
  • AI提示词
  • MCP
  • Skills
  • AI学习资源
  • AI资讯
  • GitHub开源
登录/注册

relational-database-mcp-cloudbase

面向 CloudBase 关系型数据库的自动化管理,支持安全执行只读查询、写入与结构变更操作,并可检视及调整表级安全规则,确保在无应用上下文的代理环境中精准控制数据访问与修改权限。

数据库
访问 GitHub
文档Skills.MD
name
relational-database-mcp-cloudbase
description
This is the required documentation for agents operating on the CloudBase Relational Database. It lists the only four supported tools for running SQL and managing security rules. Read the full content to understand why you must NOT use standard Application SDKs and how to safely execute INSERT, UPDATE, or DELETE operations without corrupting production data.
alwaysApplyfalse

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 data in tables
  • Modifying data or schema (INSERT/UPDATE/DELETE/DDL)
  • Reading or changing table security rules

Do NOT use this skill for:

  • Building Web or Node.js applications that talk to CloudBase Relational Database (use the Web/Node Relational Database skills)
  • Auth flows or user identity (use the Auth skills)

How to use this skill (for a coding agent)

  1. Recognize MCP context

    • If you can call tools like executeReadOnlySQL, executeWriteSQL, readSecurityRule, writeSecurityRule, you are in MCP context.
    • In this context, never initialize SDKs for CloudBase Relational Database; use MCP tools instead.
  2. Pick the right tool for the job

    • Reads → executeReadOnlySQL
    • Writes/DDL → executeWriteSQL
    • Inspect rules → readSecurityRule
    • Change rules → writeSecurityRule
  3. Always be explicit about safety

    • Before destructive operations (DELETE, DROP, etc.), summarize what you are about to run and why.
    • Prefer running read-only SELECTs first to verify assumptions.

Available MCP tools (CloudBase Relational Database)

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

1. executeReadOnlySQL

  • Purpose: Run SELECT queries (read-only).
  • Use for:
    • Listing rows, aggregations, joins.
    • Inspecting data before changing it.

Example call (conceptual):

▼
sql
复制代码
SELECT id, email FROM users WHERE active = true ORDER BY created_at DESC LIMIT 50;

Call this through the MCP tool instead of embedding SQL in code.

2. executeWriteSQL

  • Purpose: Run write or DDL statements:
    • INSERT, UPDATE, DELETE
    • CREATE TABLE, ALTER TABLE, DROP TABLE
  • Use for:
    • Data migrations
    • Fixing or seeding data
    • Schema changes

Before calling this tool, confirm:

  • The target tables and conditions are correct.
  • You have run a corresponding SELECT via executeReadOnlySQL when appropriate.

3. readSecurityRule

  • Purpose: Read security rules for a given table.
  • Use for:
    • Understanding who can read/write a table.
    • Auditing permissions on sensitive tables.

Security rule types typically include:

  • READONLY – anyone can read, no one can write
  • PRIVATE – only authenticated users can read/write
  • ADMINWRITE – anyone can read, only admins can write
  • ADMINONLY – only admins can read/write
  • CUSTOM – custom security logic

4. writeSecurityRule

  • Purpose: Set or update security rules for a table.
  • Use for:
    • Hardening access to sensitive data
    • Opening up read access while restricting writes
    • Applying custom rules when needed

When using this tool:

  • Clearly explain the intent (who should read/write what).
  • Prefer standard rule types (READONLY, PRIVATE, etc.) before CUSTOM.

Scenario 1: Safely inspect data in a table

  1. Use executeReadOnlySQL with a limited SELECT:
    • Include a LIMIT clause.
    • Filter by relevant conditions.
  2. Review the result set and confirm it matches expectations.

This pattern prevents accidental full-table scans and gives you context before any write operations.


Scenario 2: Apply a schema change

  1. Use executeReadOnlySQL to inspect the current schema or data (if needed).
  2. Plan the CREATE TABLE / ALTER TABLE statement.
  3. Run it once via executeWriteSQL.
  4. Optionally, validate by running SELECT again.

Always describe:

  • What schema change you are making.
  • Why it is safe in the current context.

Scenario 3: Tighten security rules on a sensitive table

  1. Call readSecurityRule for the table to see current settings.
  2. Decide on the target rule (e.g., from READONLY → PRIVATE).
  3. Explain the change and why it matches the user’s requirements.
  4. Call writeSecurityRule with the new rule.
  5. Optionally, re-read the rule to confirm the update.

Key principle: MCP tools vs SDKs

  • MCP tools are for agent operations and database management:

    • Run ad-hoc SQL.
    • Inspect and change security rules.
    • 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.

数据库

快捷安装

复制到终端去安装 Skill

npxadd-skillMicrock/ordinary-claude-skills--skill"relational-database-mcp-cloudbase"
站长:程序员鱼皮 老鱼简历 商务合作 增值电信业务经营许可证
2026 鱼皮AI导航 | 沪ICP备19026706号-6
站长:程序员鱼皮 老鱼简历 商务合作 增值电信业务经营许可证
2026 鱼皮AI导航 | 沪ICP备19026706号-6
🔥热门工具
朱雀AI检测朱雀AI检测
朱雀AI检测助手朱雀AI检测助手
LovartLovart
老鱼简历老鱼简历
WritePass官网WritePass官网
面多多面多多
CursorCursor
星月写作星月写作
朱雀AI检测助手朱雀AI检测助手
零感AI零感AI
Skills 推荐
database-index-advisor
通过分析数据库查询负载和现有索引配置,自动识别缺失的高效索引以加速慢查询,同时发现长期未被使用的冗余索引以便清理,从而在提升读取性能的同时节省存储空间并优化写入效率。
detecting-sql-injection-vulnerabilities
自动识别和分析应用程序代码及数据库查询中的 SQL 注入风险,覆盖输入点检测、查询构造审查、参数化验证与安全模式推荐,生成结构化安全报告并提供修复建议。
database
规范 NestJS 应用的数据访问层设计,涵盖 ORM 选型、连接池与分片等可扩展架构,强制使用仓库模式隔离数据库逻辑,通过异步配置加载敏感信息,禁用生产环境自动同步,依赖迁移脚本实现零停机演进,并统一要求分页、索引声明与事务保护。
prisma-schema-helper
提供 Prisma 数据模型定义的自动化辅助能力,涵盖模式校验、关系配置、字段类型推导及迁移脚本生成,支持 Node.js 等后端技术栈的数据库层快速搭建与维护。
database-testing
面向数据库全生命周期的质量保障,覆盖结构定义验证、数据约束检查、迁移脚本可靠性测试、事务并发行为验证及查询性能度量,确保数据持久化过程中的准确性、一致性与稳定性。