dynamic-db-mcp-server

v0.1.0
dynamic-db-mcp-server Checked 2 days ago Published 5 months ago

Dynamic MySQL-compatible database MCP server - register connections at runtime, execute SQL with destructive statement interception

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

register_instance

Register a MySQL-compatible database connection at runtime. Tests the connection with SELECT 1 before caching. If a connection with the same name already exists, it is closed and replaced. Args: name: A human-readable identifier for this instance (used as instance_id). host: Database host or IP address. port: Database port (e.g. 3306). user: Database username. password: Database password. database: Optional default database/schema. charset: Connection charset, defaults to utf8mb4. Returns: JSON string with insta…

ParameterTypeDescription
host *string
name *string
password *string
port *integer
user *string
charsetstring
database

list_instances

List all registered database instances. Returns: JSON array of instances. Passwords are never included.

execute_sql

Execute a SQL statement on a registered instance. SQL is classified before execution: - Read-only (SELECT/SHOW/WITH/EXPLAIN/DESC): executes directly. - Destructive (DROP/DELETE/UPDATE/INSERT/ALTER/TRUNCATE/CREATE/...): requires confirm_destructive=true. - Blocked (OUTFILE/DUMPFILE/LOAD_FILE/SHUTDOWN/KILL): always rejected. Args: instance_id: The instance name from register_instance. sql: The SQL statement to execute. database: Optional database to switch to before executing. confirm_destructive: Set to true to allow destructive operat…

ParameterTypeDescription
instance_id *string
sql *string
confirm_destructiveboolean
database

list_databases

List all databases on a registered instance. Args: instance_id: The instance name from register_instance. Returns: JSON array of database names, or error details.

ParameterTypeDescription
instance_id *string

list_tables

List tables in a database with row count and size. Args: instance_id: The instance name from register_instance. database: The database name to list tables from. Returns: JSON array of {table, rows, size_mb, engine, comment}, or error.

ParameterTypeDescription
database *string
instance_id *string

get_table_detail

Get column info and CREATE TABLE DDL for a specific table. Args: instance_id: The instance name from register_instance. database: The database name. table_name: The table name. Returns: JSON with {columns: [...], ddl: "..."}, or error details.

ParameterTypeDescription
database *string
instance_id *string
table_name *string