DBA
- typescript
0
GitHub Stars
typescript
Language
5 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"gcorroto-dba-mcp": {
"command": "npx",
"args": [
"-y",
"@grec0/dba-mcp",
"--staging",
"mysql://root:pass@localhost:3306/staging_db"
]
}
}
}The DBA MCP Server lets you connect to multiple SQL databases from a single MCP client, manage and migrate schema and data, and store AI-generated context about each database for quick recall. It runs over stdio, making it easy to integrate with local MCP clients and AI tools while keeping your connections organized and reusable.
How to use
You use this server by connecting through an MCP client that supports stdio. You can load ephemeral connections via CLI arguments or save persistent connections for reuse. Once connected, you access a set of tools to inspect schemas, run queries, generate migrations, migrate data, or clone entire databases. You can save context about a database (governance notes, business rules, and schema explanations) and have the system recall that context when you ask complex questions about that database.
How to install
Prerequisites: Node.js and npm must be installed on your machine.
# Option 1: Run with NPX (no install required)
npx @grec0/dba-mcp --local sqlite://data.db --prod postgres://user:pass@host/db
Option 2: Local installation (clone and build) follows a standard Node.js project flow.
# Clone the project
git clone https://github.com/grecoLab/mcp-dba.git
cd mcp-dba
npm install
npm run build
Configuration basics
Ephemeral connections can be passed via the CLI in the following format: --[id] [connection_string].
/* claude_desktop_config.json */
{
"mcpServers": {
"dba-tools": {
"command": "npx",
"args": [
"-y",
"@grec0/dba-mcp",
"--staging", "mysql://root:pass@localhost:3306/staging_db"
]
}
}
}
Persistent storage
Connections saved persist in a local SQLite database named ".dba-mcp/storage.db" inside the active working directory.
Available persistence actions include saving, removing, and listing connections. Use these tools to manage your connections over time.
Available tools
list_connections
Lists all active connections with status icons indicating saved, CLI-derived, or context-enabled connections.
save_connection
Persistently saves a new connection URL for reuse across sessions.
remove_connection
Removes a previously saved connection from persistent storage.
save_database_context
Saves AI-generated markdown documentation for a specific connection, including governance and business logic notes.
get_database_context
Retrieves the stored markdown context for a given connection.
inspect_schema
Explores the database structure. If you provide a tableName, it shows columns and primary keys; without it, it lists all tables.
sql_query
Executes a read-only SQL query on a specified connection.
generate_migration_ddl
Compares two schemas (source → target) and generates DDL statements to synchronize the target to match the source.
migrate_data
Migrates specific tables from a source to a target using bulk inserts for efficiency.
replicate_database
Clones an entire database: scans the source, creates corresponding structures in the target, and migrates all data automatically.