data-api-builder icon indicating copy to clipboard operation
data-api-builder copied to clipboard

[Enh]: 🚧 Add MCP DDL tools for MSSQL

Open JerryNixon opened this issue 5 months ago • 0 comments

NOTE: This is a preliminary specification.

What?

MCP data DDL tools

MCP Tools

  • read_all_schema — JSON SCHEMA SNAPSHOT
  • table_data_profile — JSON SCHEMA SNAPSHOT
  • schema_create(name) — CREATE SCHEMA X
  • schema_drop(name) — DROP SCHEMA X
  • table_create(name, [cols]) — CREATE TABLE X (COLS)
  • table_alter_add(name, [alter_spec]) — ALTER TABLE X ADD COL Y
  • table_alter_drop(name, [alter_spec]) — ALTER TABLE X DROP COLUMN Y
  • table_drop(name) — DROP TABLE X
  • index_create(name, table, [cols]) — CREATE INDEX IX ON X(COL)
  • index_drop(name, table) — DROP INDEX IX ON X
  • relate_add(name, table1, [cols1], table2, [cols2]) — ALTER TABLE T1 ADD CONSTRAINT
  • relate_drop(name, table1) — ALTER TABLE T1 DROP CONSTRAINT C

Why?

To enable the other DDL (Data Definition Language) tools.

How?

This will require DAB to execute mssql-specific canned queries with parameters.

Configuration

{
  "ai": {
    "mcp": {
      // Option A: single flag for all ddl-tools
      "ddl-tools": true // default false

      // Option B: object for fine-grained control
      "ddl-tools": {
        "schema_create": true,     // default false
        "schema_drop": true,       // default false
        "table_create": true,      // default false
        "table_alter_add": true,   // default false
        "table_alter_drop": true,  // default false
        "table_drop": true,        // default false
        "index_create": true,      // default false
        "index_drop": true,        // default false
        "relate_add": true,        // default false
        "relate_drop": true        // default false
      }
    }
  }
}

Command line

dab configure --ai.mcp.ddl-tools.schema_create.enabled true
dab configure --ai.mcp.ddl-tools.schema_drop.enabled true
dab configure --ai.mcp.ddl-tools.table_create.enabled true
dab configure --ai.mcp.ddl-tools.table_alter_add.enabled true
dab configure --ai.mcp.ddl-tools.table_alter_drop.enabled true
dab configure --ai.mcp.ddl-tools.table_drop.enabled true
dab configure --ai.mcp.ddl-tools.index_create.enabled true
dab configure --ai.mcp.ddl-tools.index_drop.enabled true
dab configure --ai.mcp.ddl-tools.relate_add.enabled true
dab configure --ai.mcp.ddl-tools.relate_drop.enabled true

JerryNixon avatar Aug 21 '25 04:08 JerryNixon