mcp-database-server

v0.1.6
mcp-database-server Checked 1 day ago Published 1 year ago

Node.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

ParameterTypeDescription
database *stringDatabase name
host *stringDatabase host
password *stringDatabase password
type *stringDatabase type (postgresql, mysql)
user *stringDatabase user
acquireTimeoutnumberConnection acquire timeout in milliseconds (optional)
connectionTimeoutnumberConnection timeout in milliseconds (optional)
idleTimeoutnumberIdle connection timeout in milliseconds (optional)
maxConnectionsnumberMaximum number of connections in pool (optional)
namestringConnection name (optional, will be auto-generated if not provided)
portnumberDatabase port (optional, uses default for database type)
sslbooleanUse SSL connection (optional)

connect_from_config

Connect to a database using a named configuration from config file

ParameterTypeDescription
configNamestringName of the connection configuration (defaults to 'default' if not provided)
connectionNamestringCustom name for this connection (optional, will use configName if not provided)

execute_query

Execute a SQL query on a connected database

ParameterTypeDescription
connection *stringConnection name
sql *stringSQL query to execute
paramsarrayQuery parameters (optional)

list_connections

List all active database connections

test_connection

Test the connectivity of a database connection

ParameterTypeDescription
connection *stringConnection name

close_connection

Close a database connection

ParameterTypeDescription
connection *stringConnection name

connection_info

Get detailed information about a specific connection

ParameterTypeDescription
connection *stringConnection 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

ParameterTypeDescription
connections *objectConnection configurations to import
overwritebooleanWhether to overwrite existing connections with same name (default: false)