Loading...
pip install database-mcp{
"mcpServers": {
"database-mcp": {
"command": "uvx",
"args": [
"database-mcp"
],
"env": {
"DB_CONFIGS": "[{\"id\":\"pg_main\",\"db_type\":\"pg\",\"configuration\":{\"host\":\"localhost\",\"port\":5432,\"user\":\"user\",\"password\":\"pw\",\"dbname\":\"postgres\"},\"description\":\"PostgreSQL Database\"},{\"id\":\"mysql_data\",\"db_type\":\"mysql\",\"configuration\":{\"host\":\"localhost\",\"port\":3306,\"user\":\"root\",\"password\":\"pass\",\"database\":\"mysql\"},\"description\":\"MySQL Database\"}]"
},
"disabled": true,
"autoApprove": []
}
}
}execute_queryExecutes a SQL query against the database and returns the results as a markdown table.
Allows arbitrary SQL execution, potentially leading to data modification or deletion.
execute_query_jsonExecutes a SQL query and returns results as JSON.
Allows arbitrary SQL execution, potentially leading to data modification or deletion.
get_table_columnsRetrieves the column names for a specified table.
Read-only operation, no side effects.
get_table_typesRetrieves the column types for a specified table.
Read-only operation, no side effects.
get_query_historyRetrieves the recent query history.
Read-only operation, no side effects.
list_databasesLists all available database connections.
Read-only operation, no side effects.
get_database_infoRetrieves detailed information about a database, including its schema.
Read-only operation, no side effects.
find_tableFinds which database contains a specific table.
Read-only operation, no side effects.
describe_tableRetrieves a detailed description of a table, including column names and types.
Read-only operation, no side effects.
get_table_sampleRetrieves a sample of data from a table.
Read-only operation, no side effects.
Database MCP offers a convenient way to access databases, but the ability to execute arbitrary SQL queries presents a significant risk. It is safe when used with read-only databases and carefully constructed queries. It is risky when used with write-enabled databases and untrusted queries.