HA

haymon-ai/dbmcp

Database management

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

33 stars 8 forks 품질 85 트렌드 32MIT

Database MCP server for MySQL, MariaDB, PostgreSQL, and SQLite - with builtin PII redaction and write-prevention

개요

A single-binary MCP server for SQL databases. Connect your AI assistant to MySQL/MariaDB, PostgreSQL, or SQLite with zero runtime dependencies. - — MySQL/MariaDB, PostgreSQL, and SQLite from one binary - — schema discovery (listDatabases, listTables, listViews, listTriggers, listFunctions, listProcedures, listMaterializedViews), data access (readQuery, writeQuery), DDL (createDatabase, dropDatabase, dropTable), and explainQuery. Read-only mode hides the write tools (writeQuery, createDatabase, dropDatabase, dropTable). See MCP Tools for per-backend availability. - — ~7 MB, no Python/Node/Docker needed - — stdio (for Claude Desktop, Cursor) and HTTP (for remote/multi-client) - — CLI flags > environment variables, with sensible defaults per backend See the installation docs for Docker, Cargo, and other methods. Add a .mcp.json file to your project root. MCP clients read this file and configure the server automatically.

README

원문 README의 일부입니다. 원문 보기.

Database MCP

A single-binary MCP server for SQL databases. Connect your AI assistant to MySQL/MariaDB, PostgreSQL, or SQLite with zero runtime dependencies.

Website · Documentation · Releases

Features ✨

  • Multi-database — MySQL/MariaDB, PostgreSQL, and SQLite from one binary
  • MCP tools — schema discovery (listDatabases, listTables, listViews, listTriggers, listFunctions, listProcedures, listMaterializedViews), data access (readQuery, writeQuery), DDL (createDatabase, dropDatabase, dropTable), and explainQuery. Read-only mode hides the write tools (writeQuery, createDatabase, dropDatabase, dropTable). See MCP Tools for per-backend availability.
  • Single binary — ~7 MB, no Python/Node/Docker needed
  • Multiple transports — stdio (for Claude Desktop, Cursor) and HTTP (for remote/multi-client)
  • Layered config — DBMCP_* environment variables, an env file, and an optional YAML config file with ${} interpolation, with sensible defaults per backend
  • SSH tunnel — reach MySQL/MariaDB/PostgreSQL through an SSH bastion with an embedded client: password or key auth, known_hosts verification, automatic reconnect

Install 📦

macOS, Linux, WSL:

curl -fsSL https://dbmcp.haymon.ai/install.sh | bash

Windows PowerShell:

irm https://dbmcp.haymon.ai/install.ps1 | iex

Windows CMD:

curl -fsSL https://dbmcp.haymon.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

See the installation docs for Docker, Cargo, and other methods.

Quick Start 🚀

Using .mcp.json (recommended)

Add a .mcp.json file to your project root. MCP clients read this file and configure the server automatically.

Stdio transport — the client starts and manages the server process:

{
  "mcpServers": {
    "dbmcp": {
      "command": "dbmcp",
      "env": {
        "DBMCP_DB_BACKEND": "mysql",
        "DBMCP_DB_HOST": "127.0.0.1",
        "DBMCP_DB_PORT": "3306",
        "DBMCP_DB_USER": "root",
        "DBMCP_DB_PASSWORD": "secret",
        "DBMCP_DB_NAME": "mydb"
      }
    }
  }
}

HTTP transport — you start the server yourself, the client connects to it:

# Start the server first
GitHub에서 전체 README 보기

설치

npx @modelcontextprotocol/inspector ./target/release/dbmcp
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "dbmcp": { "command": "dbmcp", "env": { "DBMCP_DB_BACKEND": "mysql", "DBMCP_DB_HOST": "127.0.0.1", "DBMCP_DB_PORT": "3306", "DBMCP_DB_USER": "root", "DBMCP_DB_PASSWORD": "secret", "DBMCP_DB_NAME": "mydb" } } } }