Diogenes Database Intelligence & SQL Engine MCP

v1.0.0
io.github.stand-out-of-my-sun/diogenes-database-intelligence-mcp Checked 2 days ago Published 10 days ago

Database intelligence, AST SQL injection auditing, query optimization & schema guards.

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

synthesize_sql_query Deterministic NL-to-SQL Synthesizer & Dialect Query Generator

Translates natural language questions into dialect-accurate, optimized SQL SELECT queries with schema awareness and safety checks. Use when generating reporting queries or automated data analytics pipelines; for analyzing SQL execution performance and EXPLAIN plans, use analyze_query_plan instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'natural_language_request' and 'schema_ddl' ('sql_dialect' defaults to 'postgresql_dialect'), supports '?demo=true' or L402 (15 sats), and returns HTTP 400 if invalid.

ParameterTypeDescription
natural_language_request *stringNatural language question or reporting requirement to transform into SQL.
schema_ddl *stringDatabase schema DDL statements defining available tables, columns, and relations.
read_only_modebooleanWhether to enforce strict read-only SELECT query constraints.
sql_dialectstringTarget SQL dialect specification: PostgreSQL dialect, MySQL dialect, or SQLite dialect.

audit_sql_injection_ast Deterministic SQL AST Injection & Tautology Vulnerability Auditor

Statically parses SQL queries via AST lexical analysis to detect second-order injection, tautology conditions, and stacked queries. Use when auditing dynamic query parameters or untrusted user input before database execution; for sanitizing query strings for telemetry logging, use sanitize_sql_telemetry instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'raw_sql' ('audit_sensitivity' defaults to 'strict_zero_dynamic_taint'), supports '?demo=true' or L402 (10 sats), and returns HTTP 400 if invalid.

ParameterTypeDescription
raw_sql *stringRaw SQL query string to parse and audit for injection vulnerabilities.
allow_commentsbooleanWhether SQL inline comments are allowed or treated as injection vectors.
audit_sensitivitystringAudit sensitivity mode: strict zero dynamic taint, second order injection check, or standard syntax audit.

analyze_query_plan SQL Query Plan EXPLAIN Optimizer & Bottleneck Diagnostics

Analyzes SQL EXPLAIN execution plans to detect sequential table scans, high-cost cartesian joins, and buffer memory bottlenecks. Use when diagnosing slow queries, optimizing database performance, or evaluating query cost; for getting index recommendations, use recommend_database_indexes instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'explain_plan_or_query' ('optimization_target' defaults to 'eliminate_seq_scans'), supports '?demo=true' or L402 (15 sats), and returns HTTP 400 if invalid.

ParameterTypeDescription
explain_plan_or_query *stringRaw text or JSON output of EXPLAIN / EXPLAIN ANALYZE or the candidate SQL query.
database_enginestringDatabase engine name (e.g., 'postgres', 'mysql', 'sqlite').
optimization_targetstringOptimization goal: eliminate sequential scans, reduce memory buffers, or minimize join costs.

detect_breaking_migrations Database Schema Migration Differ & Breaking Change Linter

Compares source and target DDL schemas to identify breaking changes, destructive column drops, and lock-inducing mutations. Use when verifying CI/CD migration scripts before production deployment to prevent downtime; for verifying relational normal form, use validate_schema_normalization instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'current_schema' and 'target_schema' ('risk_tolerance' defaults to 'zero_downtime_strict'), supports '?demo=true' or L402 (15 sats), and returns HTTP 400 if invalid.

ParameterTypeDescription
current_schema *stringCurrent production database DDL schema representing live tables and columns.
target_schema *stringProposed new database DDL schema representing target migration state.
risk_tolerancestringDeployment safety policy: zero downtime strict, allow transient locks, or permissive dev.

transpile_sql_dialect Polyglot SQL Dialect Transpiler (PostgreSQL, MySQL, SQLite)

Transpiles SQL queries and DDL schemas across PostgreSQL, MySQL, and SQLite dialects, rewriting functions and syntax quirks. Use when migrating application queries across database backends or testing against in-memory SQLite; for generating new queries from natural language, use synthesize_sql_query instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'sql_code' and 'source_dialect' ('target_dialect' defaults to 'sqlite'), supports '?demo=true' or L402 (10 sats), and returns HTTP 400 if invalid.

ParameterTypeDescription
source_dialect *stringOriginal SQL dialect of the input code: postgresql, mysql, or sqlite.
sql_code *stringSQL query or DDL statement to convert from source dialect into target dialect.
target_dialect *stringDestination SQL dialect to transpile into: postgresql, mysql, or sqlite.

recommend_database_indexes Database Index Advisor & Composite B-Tree Optimizer

Recommends optimal single-column and composite B-Tree/BRIN indexes based on slow query WHERE, JOIN, and ORDER BY clauses. Use when optimizing database response times and eliminating full-table scans; for inspecting full execution plans, use analyze_query_plan instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'slow_queries_or_workload' ('index_type_preference' defaults to 'btree_and_composite'), supports '?demo=true' or L402 (15 sats), and returns HTTP 400 if invalid.

ParameterTypeDescription
slow_queries_or_workload *stringCollection of slow SQL queries or workload log statements to analyze for index gaps.
index_type_preferencestringTarget indexing strategy: B-tree and composite, BRIN and GIN sparse, or covering indexes with INCLUDE.
max_new_indexesintegerMaximum number of index creation statements to recommend.

validate_schema_normalization Relational Schema Normalization Auditor (3NF, BCNF) & Integrity Guard

Audits database schemas for third normal form (3NF) compliance, transitive dependencies, and missing foreign key constraints. Use when reviewing database architectures, preventing update anomalies, or validating relational integrity; for detecting breaking schema migrations, use detect_breaking_migrations instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'schema_ddl' ('target_normal_form' defaults to 'third_normal_form_3nf'), supports '?demo=true' or L402 (10 sats), and returns HTTP 400 if invalid.

ParameterTypeDescription
schema_ddl *stringDatabase schema DDL statements defining table columns, primary keys, and relations.
strict_keysbooleanWhether to enforce explicit foreign key constraints on all ID references.
target_normal_formstringTarget normalization standard: 3NF, Boyce-Codd BCNF, or denormalized OLAP star.

sanitize_sql_telemetry SQL Query Telemetry PII Scrubber & Parameterization Masker

Masks PII, financial values, and credential literals from raw SQL query logs and slow-query dumps before telemetry storage. Use when scrubbing production database query logs before shipping to APM tools, Datadog, or external log collectors; for auditing SQL injection vulnerabilities, use audit_sql_injection_ast instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'query_logs' ('masking_policy' defaults to 'mask_pii_and_literals'), supports '?demo=true' or L402 (10 sats), and returns HTTP 400 if invalid.

ParameterTypeDescription
query_logs *stringRaw SQL query text or multi-line database query log strings requiring sanitization.
hash_saltstringOptional salt string for deterministic pseudonymization of user IDs.
masking_policystringScrubbing rigor policy: mask PII and literals, anonymize all constants, or strict AST parameterization.

synthesize_seed_fixtures Deterministic Relational Seed Data & SQL Mock Fixture Generator

Generates deterministic relational test seed fixtures respecting foreign key constraints, unique indexes, and data bounds. Use when provisioning mock database datasets for automated testing, staging environments, or sandbox demos; for compiling ORM models from schemas, use generate_orm_models instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'schema_ddl' ('fixture_volume' defaults to 'minimal_smoke_test_5'), supports '?demo=true' or L402 (15 sats), and returns HTTP 400 if invalid.

ParameterTypeDescription
schema_ddl *stringTarget database schema DDL defining tables, column types, and foreign key relations.
deterministic_seedintegerInteger seed for reproducible pseudo-random data generation.
fixture_volumestringMock dataset volume profile: minimal smoke test (5), standard dataset (50), or stress dataset (500).

calculate_pool_headroom Database Connection Pool Sizing & Concurrency Headroom Calculator

Calculates optimal connection pool sizing, idle timeouts, and client headroom based on server RAM and concurrency profile. Use when sizing PgBouncer, HikariCP, or Prisma connection pools to avoid server out-of-memory crashes; for checking transaction isolation hazards, use audit_transaction_isolation instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'server_ram_mb' and 'max_concurrent_clients' ('workload_profile' defaults to 'high_concurrency_oltp'), supports '?demo=true' or L402 (10 sats), and returns HTTP 400 if invalid.

ParameterTypeDescription
max_concurrent_clients *numberPeak anticipated concurrent client connections or serverless worker threads.
server_ram_mb *numberTotal available RAM in megabytes dedicated to the database server instance.
workload_profilestringWorkload operational characteristics: high-concurrency OLTP, heavy analytical OLAP, or serverless edge burst.

audit_transaction_isolation Transaction Concurrency Anomaly & Isolation Level Hazard Auditor

Audits database transaction workflows for concurrency anomalies, dirty reads, non-repeatable reads, and deadlock risks. Use when reviewing financial transfer procedures, inventory decrement operations, or multi-step checkout workflows; for calculating connection pool headroom, use calculate_pool_headroom instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'transaction_steps' ('target_isolation_level' defaults to 'read_committed'), supports '?demo=true' or L402 (15 sats), and returns HTTP 400 if invalid.

ParameterTypeDescription
transaction_steps *stringSequential SQL commands or description of business operations within the transaction.
strict_deadlock_checkbooleanWhether to perform exhaustive cross-table lock acquisition ordering analysis.
target_isolation_levelstringCandidate SQL isolation level: read committed, repeatable read, or serializable.

generate_orm_models SQL DDL to Type-Safe ORM Entity Compiler (Prisma, Drizzle, Zod)

Compiles SQL DDL schemas into type-safe ORM entities and TypeScript validation schemas (Prisma, Drizzle, SQLAlchemy, Zod). Use when scaffolding application models, generating TypeScript data layers, or synchronizing schemas; for translating raw SQL across dialects, use transpile_sql_dialect instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'schema_ddl' ('orm_target' defaults to 'drizzle_orm_typescript'), supports '?demo=true' or L402 (15 sats), and returns HTTP 400 if invalid.

ParameterTypeDescription
schema_ddl *stringDatabase schema DDL statements defining tables, primary keys, and relationships.
include_relationsbooleanWhether to generate explicit foreign key relation decorators and navigation properties.
orm_targetstringTarget ORM framework standard: Prisma schema, Drizzle ORM TypeScript, SQLAlchemy Python 2.0, or Zod types.