dblink

v2.0.1
@fb0sh/dblink Checked 2 days ago Published 1 month ago

MCP server for multi-database access: PostgreSQL, MySQL, Redis, SQLite

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

open_connection

Open (or reuse) a database connection. Returns a connection_id used by the other tools. DSN schemes: postgres://, mysql://, redis://, mongodb://, mongodb+srv://, sqlite:

ParameterTypeDescription
dsn *stringDatabase URL / DSN
namestringOptional human-friendly label
read_onlybooleanRead-only connection (default true)

close_connection

Close a connection and release its pool.

ParameterTypeDescription
connection_id *string

list_connections

List active connections with alive/dead status.

db_query

Run a read-only SQL statement (SELECT/SHOW/EXPLAIN/read-only WITH) and return rows.

ParameterTypeDescription
connection_id *string
sql *string
limitinteger
paramsarray

db_execute

Run a write statement on a writable connection (read_only=false). Returns affected_rows.

ParameterTypeDescription
connection_id *string
sql *string
paramsarray

db_list_tables

List tables/views in the connected database.

ParameterTypeDescription
connection_id *string
schemastring

db_describe_table

Describe a table: columns (name/type/nullable/default) and indexes.

ParameterTypeDescription
connection_id *string
table *string
schemastring

redis_command

Run a read-only Redis command (allow-list). Writes return UNSUPPORTED.

ParameterTypeDescription
command *string
connection_id *string
argsarray

mongo_find

Query documents from a MongoDB collection. filter/projection/sort accept relaxed EJSON. Returns relaxed EJSON documents.

ParameterTypeDescription
collection *string
connection_id *string
databasestring
filterobject
limitinteger
projectionobject
sortobject

mongo_aggregate

Run a MongoDB aggregation pipeline. Read-only connections reject $out/$merge.

ParameterTypeDescription
collection *string
connection_id *string
pipeline *
databasestring
limitinteger

mongo_write

Write to MongoDB (action: insert|update|delete). Only allowed on writable connections (read_only=false).

ParameterTypeDescription
action *string
collection *string
connection_id *string
payload *object
databasestring

mongo_list_collections

List collections in a MongoDB database.

ParameterTypeDescription
connection_id *string
databasestring

mongo_describe_collection

Describe a MongoDB collection: sample document (EJSON), indexes and inferred fields.

ParameterTypeDescription
collection *string
connection_id *string
databasestring