dynamic-db-mcp-server
v0.1.0Dynamic 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…
| Parameter | Type | Description |
|---|---|---|
host * | string | |
name * | string | |
password * | string | |
port * | integer | |
user * | string | |
charset | string | |
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…
| Parameter | Type | Description |
|---|---|---|
instance_id * | string | |
sql * | string | |
confirm_destructive | boolean | |
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.
| Parameter | Type | Description |
|---|---|---|
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.
| Parameter | Type | Description |
|---|---|---|
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.
| Parameter | Type | Description |
|---|---|---|
database * | string | |
instance_id * | string | |
table_name * | string |