mcp-database

v0.3.0
mcp-database Checked 1 day ago Published 2 days ago

MCP 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").

ParameterTypeDescription
connection_namestring
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").

ParameterTypeDescription
table *string
connection_namestring
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").

ParameterTypeDescription
connection_namestring
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").

ParameterTypeDescription
sql *string
connection_namestring
database
max_rowsinteger

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").

ParameterTypeDescription
sql *string
connection_namestring
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").

ParameterTypeDescription
table *string
connection_namestring
database
limitinteger

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").

ParameterTypeDescription
keyword *string
connection_namestring
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.

ParameterTypeDescription
source_connection *string
target_connection *string
table_namestring

check_health

Check database health: latency, table count, row count, largest tables. Args: connection_name: Name of the database connection (default: "default").

ParameterTypeDescription
connection_namestring

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.

ParameterTypeDescription
connection_namestring
formatstring

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").

ParameterTypeDescription
query *string
connection_namestring

diagnose_connection

Diagnose a database connection with detailed status and troubleshooting hints. Args: connection_name: Name of the database connection (default: "default").

ParameterTypeDescription
connection_namestring