list_databasesLABSCO SUMMARY
Three layers of write protection, and you have to defeat all of them.
That is the right shape for a tool an assistant drives: read-only per database, writes off globally, and the destructive statements still blocked after you enable writes. The schema cache is the other design decision that shows up in use — introspection is expensive on a large database, so caching it with a TTL and a version hash means the join suggestions and query help are answered from a local copy rather than re-read every turn. If you are wiring one database only, this is more configuration than you need; the payoff starts at two.
What it is
A SQL database MCP server built for the case where there is more than one database. Each connection gets an ID in a config file, and every tool call names which one it means. It discovers and caches schemas, infers relationships from foreign keys and heuristics, and blocks writes unless you have explicitly turned them on.
What you get
- The configured databases listed with their connection and cache state, and schema discovery that caches with a TTL and a version hash —
list_databases,introspect_schema,get_schema,cache_status,clear_cache - Parameterised queries with row limits, offsets, a byte cap on the response and a per-call timeout, plus a streaming export of large read-only results to JSONL or CSV —
run_query,export_query - Join paths suggested from the relationship graph for a set of tables you name, rather than worked out from the schema by hand —
suggest_joins - Query analysis: execution plans, index recommendations, slow-query detection, rewrite suggestions and per-query profiling —
explain_query,suggest_indexes,detect_slow_queries,rewrite_query,profile_query,analyze_performance - A connectivity test for when the failure is the connection rather than the query —
health_check
Requirements
A .mcp-database-server.config file describing each database — an id, a type of postgres, mysql, sqlite, mssql or oracle, and a connection string. Credentials have three paths and only one is recommended: secretRef names an environment variable, credentialCommand runs a shell command that prints the string (1Password, Vault, an AWS helper), and an inline url is supported but not the recommended secret handling. Install with npm install -g @adevguide/mcp-database-server or run through npx; the package is @adevguide/mcp-database-server (2.0.2) with a mcp-database-server binary. Writes are off by default at two levels — per-database readOnly defaults to true and the global allowWrite defaults to false — and disableDangerousOperations still blocks DELETE, TRUNCATE and DROP even when writes are allowed. Oracle is a stub requiring Oracle Instant Client.
Setup effort
One command plus credentials — npm install -g @adevguide/mcp-database-server, then supply credentials
USE CASES
Asking questions across several databases from one client
Register each with an ID and name the one you mean per call, instead of running a server per database.
Working out how two tables relate
Ask for join paths between the tables you care about and let the relationship graph propose them.
Making a slow query fast
Read the execution plan, get index recommendations from the tracked history, and compare against a suggested rewrite.
Pulling out more rows than a response can hold
Export the read-only query to a file as JSONL or CSV rather than paging a result set through the conversation.
Handing an assistant production credentials safely
Resolve the connection string through a secret manager command, keep the database read-only, and leave the dangerous-operation block on.
15 tools
Listed in project docs. Your client may show a different list.
introspect_schemaget_schemarun_queryexport_queryexplain_querysuggest_joinsclear_cachecache_statushealth_checkanalyze_performancesuggest_indexesdetect_slow_queriesrewrite_queryprofile_queryBEFORE YOU INSTALL
What to know first
Tools you get
15 tools named in the project's documentation.
Requires
- npm on PATH
- Node.js 18+
INSTALLATION
Connect your client
Server setup
npm install -g @adevguide/mcp-database-serverMCP Clients
Any MCP client — global npm
{
"mcpServers": {
"database": {
"command": "mcp-database-server",
"args": [
"--config",
"<YOUR_PATH_TO_MCP_DATABASE_SERVER>"
]
}
}
}Any MCP client — local build
git clone https://github.com/iPraBhu/mcp-database-server.git
cd mcp-database-server
npm install
npm run buildPoint the client at dist/index.js inside that folder, using its full path:
{
"mcpServers": {
"database": {
"command": "node",
"args": [
"<YOUR_PATH_TO_MCP_DATABASE_SERVER>/dist/index.js",
"--config",
"<YOUR_PATH_TO_MCP_DATABASE_SERVER>"
]
}
}
}