Provides tools for interacting with MySQL databases, including listing tables, describing table structures, and executing SQL queries.
Provides tools for interacting with PostgreSQL databases, including listing tables, describing table structures, and executing SQL queries.
Provides tools for interacting with Redis, including getting and setting values, and listing keys with patterns.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-databasedescribe the users table schema"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Database MCP Server
MCP server untuk koneksi database yang mendukung PostgreSQL, MySQL, SQL Server, dan Redis.
Installation
Opsi 1: Development Mode
pip install -e .Opsi 2: Binary (Standalone) ✅ READY
# Build binary
python3.11 build.py
# Opsi instalasi:
# 1. Install ke system PATH
./install.sh
# 2. Atau menggunakan Make
make install
# 3. Atau install manual
python3.11 build.py --install
# 4. Atau gunakan langsung
./dist/database-mcp-serverRelated MCP server: mcp-database-server
Usage
Jalankan MCP Server
Binary Mode (Recommended):
# Setelah install
database-mcp-server
# Atau langsung dari dist
./dist/database-mcp-serverDevelopment Mode:
# Langsung dari source
python -m database_mcp_server.mainKonfigurasi di Kiro
Binary Mode (Recommended): Gunakan database-mcp-server langsung
Development Mode: Lihat mcp.json.example
Available Tools
SQL Database Tools
list_tables(connection_name)- List semua tabeldescribe_table(table_name, connection_name)- Lihat struktur tabelexecute_query(query, connection_name)- Eksekusi SQL query
Redis Tools
redis_get(key, connection_name)- Get value dari Redisredis_set(key, value, expiration, connection_name)- Set value ke Redisredis_keys(pattern, connection_name)- List keys dengan pattern
Database Support
PostgreSQL - psycopg2
MySQL - PyMySQL
SQL Server - pyodbc
Redis - redis-py
Configuration
Database connections dikonfigurasi melalui mcp.json dengan environment variables:
Single Connection (Simple)
{
"mcpServers": {
"database": {
"command": "database-mcp-server",
"args": [],
"env": {
"DB_TYPE": "postgresql",
"DB_HOST": "localhost",
"DB_PORT": "5432",
"DB_NAME": "mydb",
"DB_USER": "postgres",
"DB_PASSWORD": "password"
},
"disabled": false
}
}
}Multiple Connections (Advanced)
{
"mcpServers": {
"database": {
"command": "database-mcp-server",
"args": [],
"env": {
"DB_CONNECTIONS": "{\"default\":{\"type\":\"postgresql\",\"host\":\"localhost\",\"port\":5432,\"database\":\"mydb\",\"username\":\"postgres\",\"password\":\"password\"},\"mysql_db\":{\"type\":\"mysql\",\"host\":\"localhost\",\"port\":3306,\"database\":\"mydb\",\"username\":\"root\",\"password\":\"password\"},\"redis\":{\"type\":\"redis\",\"host\":\"localhost\",\"port\":6379,\"password\":\"\",\"db\":0}}"
},
"disabled": false
}
}
}Binary Configuration
After installation (recommended):
{
"mcpServers": {
"database": {
"command": "database-mcp-server",
"args": [],
"env": {
"DB_CONNECTIONS": "{\"default\":{\"type\":\"postgresql\",\"host\":\"localhost\",\"port\":5432,\"database\":\"mydb\",\"username\":\"postgres\",\"password\":\"password\"}}"
},
"disabled": false
}
}
}Direct binary usage:
{
"mcpServers": {
"database": {
"command": "./dist/database-mcp-server",
"args": [],
"env": {
"DB_CONNECTIONS": "{\"default\":{\"type\":\"postgresql\",\"host\":\"localhost\",\"port\":5432,\"database\":\"mydb\",\"username\":\"postgres\",\"password\":\"password\"}}"
},
"disabled": false
}
}
}Environment Variables
Single Connection:
DB_TYPE- Database type (postgresql, mysql, sqlserver)DB_HOST- Database hostDB_PORT- Database portDB_NAME- Database nameDB_USER- UsernameDB_PASSWORD- PasswordREDIS_HOST,REDIS_PORT, etc. - Redis connection
Multiple Connections:
DB_CONNECTIONS- JSON string dengan semua database connections
Troubleshooting
Error: "uvx: executable file not found"
Gunakan binary yang sudah terinstall:
{
"command": "database-mcp-server" // ✅ Correct
// "command": "uvx" // ❌ Wrong - uvx not needed
}Error: "database-mcp-server: command not found"
Install binary terlebih dahulu:
./install.sh
# atau
make installBinary tidak bisa dijalankan
Pastikan binary executable:
chmod +x /usr/local/bin/database-mcp-serverThis server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Appeared in Searches
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/justpoypoy/mcp-database'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
