Skip to main content
Glama
justpoypoy

mcp-database

by justpoypoy

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-server

Related MCP server: Universal Database MCP Server

Usage

Jalankan MCP Server

Binary Mode (Recommended):

# Setelah install
database-mcp-server

# Atau langsung dari dist
./dist/database-mcp-server

Development Mode:

# Langsung dari source
python -m database_mcp_server.main

Konfigurasi 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 tabel

  • describe_table(table_name, connection_name) - Lihat struktur tabel

  • execute_query(query, connection_name) - Eksekusi SQL query

Redis Tools

  • redis_get(key, connection_name) - Get value dari Redis

  • redis_set(key, value, expiration, connection_name) - Set value ke Redis

  • redis_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 host

  • DB_PORT - Database port

  • DB_NAME - Database name

  • DB_USER - Username

  • DB_PASSWORD - Password

  • REDIS_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 install

Binary tidak bisa dijalankan

Pastikan binary executable:

chmod +x /usr/local/bin/database-mcp-server
A
license - permissive license
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    A modular MCP server that enables interaction with multiple database types including PostgreSQL, MySQL, SQLite, Redis, MongoDB, and LDAP. It provides tools for executing queries, managing SQL commands, and exploring database schemas with configurable read-only security.
    Last updated
    39
    MIT
  • F
    license
    -
    quality
    D
    maintenance
    A versatile MCP server that connects to multiple relational databases (MySQL, PostgreSQL, Oracle, SQL Server, SQLite) and enables secure read-only SQL query execution and metadata access.
    Last updated
    4
  • A
    license
    A
    quality
    D
    maintenance
    A multi-database MCP server supporting MySQL, PostgreSQL, MongoDB, and SQLite with read-only and read-write query capabilities, schema inspection, and SSH tunneling, all without Docker.
    Last updated
    5
    1
    MIT
  • F
    license
    -
    quality
    C
    maintenance
    A multi-database MCP server supporting PostgreSQL, ClickHouse, and MySQL that enables database exploration and SQL execution through MCP stdio or HTTP API.
    Last updated

View all related MCP servers

Related MCP Connectors

  • MCP server for managing Prisma Postgres.

  • MCP server for interacting with the Supabase platform

  • GibsonAI MCP server: manage your databases with natural language

View all MCP Connectors

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