mcp-database
v0.3.0MCP server for multi-database access — SQLite, PostgreSQL, MySQL.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_databases
List all configured database connections and their status. Returns JSON with connection names, types, status, and masked URLs.
list_tables
List all tables in a database. Args: database: Name of the database within the connection (optional). connection_name: Name of the database connection (default: "default").
| Parameter | Type | Description |
|---|---|---|
connection_name | string | |
database |
get_table_info
Get detailed information about a table: columns, types, row count. Args: table: Table name. database: Name of the database within the connection (optional). connection_name: Name of the database connection (default: "default").
| Parameter | Type | Description |
|---|---|---|
table * | string | |
connection_name | string | |
database |
get_schema
Get the full database schema (CREATE TABLE statements for all tables). Args: database: Name of the database within the connection (optional). connection_name: Name of the database connection (default: "default").
| Parameter | Type | Description |
|---|---|---|
connection_name | string | |
database |
query
Execute a read-only SQL query (SELECT, SHOW, DESCRIBE, EXPLAIN) and return results. Args: sql: SQL query to execute. database: Name of the database within the connection (optional). max_rows: Maximum number of rows to return (default: 100). connection_name: Name of the database connection (default: "default").
| Parameter | Type | Description |
|---|---|---|
sql * | string | |
connection_name | string | |
database | ||
max_rows | integer |
execute
Execute a write SQL statement (INSERT, UPDATE, DELETE). Only works if writes are enabled. Args: sql: SQL statement to execute. database: Name of the database within the connection (optional). connection_name: Name of the database connection (default: "default").
| Parameter | Type | Description |
|---|---|---|
sql * | string | |
connection_name | string | |
database |
sample_rows
Get a sample of rows from a table to understand its data. Args: table: Table name. limit: Number of rows to sample (default: 5, max: 20). database: Name of the database within the connection (optional). connection_name: Name of the database connection (default: "default").
| Parameter | Type | Description |
|---|---|---|
table * | string | |
connection_name | string | |
database | ||
limit | integer |
search_tables
Search for tables or columns matching a keyword. Args: keyword: Keyword to search for in table and column names. database: Name of the database within the connection (optional). connection_name: Name of the database connection (default: "default").
| Parameter | Type | Description |
|---|---|---|
keyword * | string | |
connection_name | string | |
database |
schema_diff
Compare schemas between two database connections. Args: source_connection: Source connection name. target_connection: Target connection name. table_name: Optional table name to diff. If empty, diff all tables.
| Parameter | Type | Description |
|---|---|---|
source_connection * | string | |
target_connection * | string | |
table_name | string |
check_health
Check database health: latency, table count, row count, largest tables. Args: connection_name: Name of the database connection (default: "default").
| Parameter | Type | Description |
|---|---|---|
connection_name | string |
generate_er_diagram
Generate an ER (Entity-Relationship) diagram in Mermaid format. Args: connection_name: Name of the database connection (default: "default"). format: Output format. Currently only 'mermaid' is supported.
| Parameter | Type | Description |
|---|---|---|
connection_name | string | |
format | string |
explain_query
Explain the execution plan for a SELECT query. Args: query: SQL SELECT or WITH...SELECT statement to explain. connection_name: Name of the database connection (default: "default").
| Parameter | Type | Description |
|---|---|---|
query * | string | |
connection_name | string |
diagnose_connection
Diagnose a database connection with detailed status and troubleshooting hints. Args: connection_name: Name of the database connection (default: "default").
| Parameter | Type | Description |
|---|---|---|
connection_name | string |