HA

haymon-ai/dbmcp

Database management

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

33 stars 8 forks 品質 85 トレンド 31MIT

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)
  • Two-layer config — CLI flags > environment variables, 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",
      "args": ["stdio"],
      "env": {
        "DB_BACKEND": "mysql",
        "DB_HOST": "127.0.0.1",
        "DB_PORT": "3306",
        "DB_USER": "root",
        "DB_PASSWORD": "secret",
        "DB_NAME": "mydb"
      }
    }
  }
}

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

# Start the server first
dbmcp http --db-backend mysql --db-user root --db-name mydb --port 9001
GitHub で README 全文を見る

インストール

npx @modelcontextprotocol/inspector ./target/release/dbmcp stdio
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "dbmcp": { "command": "dbmcp", "args": ["stdio"], "env": { "DB_BACKEND": "mysql", "DB_HOST": "127.0.0.1", "DB_PORT": "3306", "DB_USER": "root", "DB_PASSWORD": "secret", "DB_NAME": "mydb" } } } }