DBShield Database Guardrail & Sandboxing MCP Server

v0.2.1
io.github.RitualDev-Lab/dbshield Checked 12 hours ago Published 24 days ago

Safety-first Database Guardrail & Sandboxing MCP Server for AI Coding Agents

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

db_status

Check DBShield security gateway status, active safety tier, and database connection.

db_describe_schema

Safely introspect database tables, column types, nullable flags, primary keys, and foreign key relationships.

ParameterTypeDescription
tableNamestringOptional specific table name to inspect. If omitted, returns all tables.

db_query

Safely execute a SQL query through DBShield guardrails. Destructive DDL and unconstrained mutations without WHERE clauses are automatically intercepted and blocked.

ParameterTypeDescription
sql *stringThe SQL query to execute.
intentstringStated user-facing instruction or business justification for the SQL query. Required in STRICT tier when modifying sensitive fields.
paramsarrayOptional parameterized query values.

db_dry_run

Simulate a database mutation inside an auto-rollback transaction sandbox. Calculates blast radius, affected row count, and returns a short-lived authorization token if safe.

ParameterTypeDescription
sql *stringThe SQL mutation (UPDATE, INSERT, DELETE) to simulate.
intentstringOptional stated prompt intent or business justification for the mutation.
paramsarrayOptional parameterized query values.

db_commit

Permanently execute and commit a mutation previously authorized by 'db_dry_run'. Requires a valid, single-use commitToken.

ParameterTypeDescription
commitToken *stringThe single-use authorization token obtained from 'db_dry_run'.
sql *stringThe exact SQL query that was dry-run and authorized.
paramsarrayOptional parameterized query values.

db_explain_query

Analyze query execution plan (EXPLAIN) to detect sequential full-table scans, missing indexes, and performance bottlenecks.

ParameterTypeDescription
sql *stringThe SQL query to explain.
paramsarrayOptional parameterized query values.

db_audit_log

Retrieve the security and compliance query audit trail, including blocked operations, risk scores, and PII redactions.

ParameterTypeDescription
limitintegerNumber of entries to retrieve (default: 20).
minRiskScorenumberFilter for queries with riskScore >= minRiskScore.
statusstringFilter by status: SUCCESS, BLOCKED, DRY_RUN_APPROVED, DRY_RUN_REJECTED, COMMITTED, ERROR.

db_validate_migration

Analyze DDL migrations against zero-downtime safety rules, detect table-level locking risks (e.g. non-concurrent index creation), dangerous NOT NULL columns, and destructive column/table drops.

ParameterTypeDescription
sql *stringThe DDL SQL statement or multi-statement migration script to validate.

db_check_schema_drift

Inspect database schema health, identify unindexed foreign keys causing cascade locks, and detect schema drift.

db_check_semantic_intent

Compare stated user prompt intent against SQL AST target columns to detect unauthorized modification of sensitive privilege, financial, or credential columns.

ParameterTypeDescription
sql *stringThe SQL query to check.
intentstringThe stated prompt intent or instruction.

db_distributed_dry_run

Simulate atomic mutations across multi-store environments (e.g. PostgreSQL + Redis + SQLite) and receive a single distributed commit token.

ParameterTypeDescription
operations *array

db_distributed_commit

Execute two-phase distributed commit across multi-store environments using an authorized distributed dry-run token.

ParameterTypeDescription
operations *array
token *string