mcp-database-server
v0.1.6Node.js MCP server for runtime database connections with support for multiple database types
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
connect_database
Connect to a database with the specified configuration
| Parameter | Type | Description |
|---|---|---|
database * | string | Database name |
host * | string | Database host |
password * | string | Database password |
type * | string | Database type (postgresql, mysql) |
user * | string | Database user |
acquireTimeout | number | Connection acquire timeout in milliseconds (optional) |
connectionTimeout | number | Connection timeout in milliseconds (optional) |
idleTimeout | number | Idle connection timeout in milliseconds (optional) |
maxConnections | number | Maximum number of connections in pool (optional) |
name | string | Connection name (optional, will be auto-generated if not provided) |
port | number | Database port (optional, uses default for database type) |
ssl | boolean | Use SSL connection (optional) |
connect_from_config
Connect to a database using a named configuration from config file
| Parameter | Type | Description |
|---|---|---|
configName | string | Name of the connection configuration (defaults to 'default' if not provided) |
connectionName | string | Custom name for this connection (optional, will use configName if not provided) |
execute_query
Execute a SQL query on a connected database
| Parameter | Type | Description |
|---|---|---|
connection * | string | Connection name |
sql * | string | SQL query to execute |
params | array | Query parameters (optional) |
list_connections
List all active database connections
test_connection
Test the connectivity of a database connection
| Parameter | Type | Description |
|---|---|---|
connection * | string | Connection name |
close_connection
Close a database connection
| Parameter | Type | Description |
|---|---|---|
connection * | string | Connection name |
connection_info
Get detailed information about a specific connection
| Parameter | Type | Description |
|---|---|---|
connection * | string | Connection name |
show_configurations
Show all database configurations available in the config file that can be used with connect_from_config
export_connections
Export connection configurations for backup or migration
import_connections
Import connection configurations from backup
| Parameter | Type | Description |
|---|---|---|
connections * | object | Connection configurations to import |
overwrite | boolean | Whether to overwrite existing connections with same name (default: false) |