Database Administrator Stack for Claude Code
Configuration
{
"mcpServers": {
"postgres-mcp": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://localhost/mydb"
],
"env": {
"POSTGRES_CONNECTION_STRING": "YOUR_POSTGRES_CONNECTION_STRING"
}
},
"mongodb-mcp": {
"command": "npx",
"args": [
"-y",
"mongodb-mcp"
],
"env": {
"MONGODB_URI": "YOUR_MONGODB_URI"
}
},
"mysql-mcp": {
"command": "npx",
"args": [
"-y",
"mysql-mcp"
],
"env": {
"MYSQL_HOST": "YOUR_MYSQL_HOST",
"MYSQL_USER": "YOUR_MYSQL_USER",
"MYSQL_PASSWORD": "YOUR_MYSQL_PASSWORD",
"MYSQL_DATABASE": "YOUR_MYSQL_DATABASE"
}
},
"redis-mcp": {
"command": "npx",
"args": [
"-y",
"redis-mcp"
],
"env": {
"REDIS_URL": "YOUR_REDIS_URL"
}
},
"sqlite-mcp": {
"command": "npx",
"args": [
"-y",
"sqlite-mcp"
]
},
"neon-mcp": {
"command": "npx",
"args": [
"-y",
"@neondatabase/mcp-server-neon"
],
"env": {
"NEON_API_KEY": "YOUR_NEON_API_KEY"
}
}
}
}CLI Commands
Alternatively, add each server via the Claude Code CLI:
claude mcp add postgres-mcp -e POSTGRES_CONNECTION_STRING=YOUR_POSTGRES_CONNECTION_STRING -- npx -y @modelcontextprotocol/server-postgres postgresql://localhost/mydb
claude mcp add mongodb-mcp -e MONGODB_URI=YOUR_MONGODB_URI -- npx -y mongodb-mcp
claude mcp add mysql-mcp -e MYSQL_HOST=YOUR_MYSQL_HOST -e MYSQL_USER=YOUR_MYSQL_USER -e MYSQL_PASSWORD=YOUR_MYSQL_PASSWORD -e MYSQL_DATABASE=YOUR_MYSQL_DATABASE -- npx -y mysql-mcp
claude mcp add redis-mcp -e REDIS_URL=YOUR_REDIS_URL -- npx -y redis-mcp
claude mcp add sqlite-mcp -- npx -y sqlite-mcp
claude mcp add neon-mcp -e NEON_API_KEY=YOUR_NEON_API_KEY -- npx -y @neondatabase/mcp-server-neonWhere to save
Paste the config above into:
~/.claude.jsonEnvironment Variables
Replace the YOUR_ placeholders with your actual values.
POSTGRES_CONNECTION_STRINGrequiredPostgreSQL connection string (e.g. postgresql://user:pass@localhost:5432/mydb)
Used by: PostgreSQL MCP
MONGODB_URIrequiredMongoDB connection URI
Used by: MongoDB MCP
MYSQL_HOSTrequiredMySQL host
Used by: MySQL MCP
MYSQL_USERrequiredMySQL username
Used by: MySQL MCP
MYSQL_PASSWORDrequiredMySQL password
Used by: MySQL MCP
MYSQL_DATABASErequiredMySQL database name
Used by: MySQL MCP
REDIS_URLrequiredRedis connection URL
Used by: Redis MCP
NEON_API_KEYrequiredNeon API key for authentication
Used by: Neon MCP
What’s in this stack
Query and interact with PostgreSQL databases, inspect schemas, and run SQL directly from your AI editor.
Manages your primary relational database with query optimization, schema migrations, and performance tuning.
Query MongoDB databases, inspect collections, and analyze documents directly from your AI editor.
Administers document collections, indexes, and aggregation pipelines for your NoSQL workloads.
Execute SQL queries against MySQL databases. Inspect schemas, run queries, and analyze data from your AI editor.
Maintains legacy and enterprise MySQL instances that power critical business applications.
Interact with Redis databases. Get, set, and manage keys, run commands, and monitor your Redis instances from your AI editor.
Configures caching layers, session stores, and pub/sub channels for low-latency data access.
Query and manage SQLite databases. Create tables, run queries, and inspect data directly from your AI editor.
Handles embedded databases for local development, testing, and lightweight application storage.
Manage Neon serverless Postgres projects, branches, databases, and run SQL queries and migrations directly from your AI editor.
Provisions serverless Postgres branches for safe schema testing without touching production data.