Skip to main content
Glama
mcp-database-tools

mcp-database-tools

by rog0x

mcp-database-tools

AI 에이전트를 위한 SQL 및 데이터베이스 도구를 제공하는 MCP 서버입니다. 모든 분석은 SQL 텍스트에서 수행되며, 실제 데이터베이스 연결이 필요하지 않습니다.

도구

sql_format

적절한 들여쓰기, 대문자 키워드, 정렬된 열로 SQL 쿼리를 포맷하고 정리합니다. MySQL, PostgreSQL, SQLite 구문을 지원합니다.

sql_explain

SQL 쿼리를 받아 단계별로 평이한 영어로 설명합니다. 쿼리 유형, 테이블, 열, 조건을 식별하고 최적화 팁을 제공합니다.

schema_analyze

CREATE TABLE 문을 파싱하여 테이블, 열, 유형, 제약 조건, 외래 키, 인덱스를 추출합니다. Mermaid 형식의 ER 다이어그램을 생성합니다.

query_build

자연어 설명에서 SQL 쿼리를 생성합니다. 날짜 필터링, 집계, 조인, 정렬, 페이지네이션과 같은 일반적인 패턴을 지원합니다.

migration_generate

두 스키마(이전 및 새 CREATE TABLE 문)를 비교하고 ALTER TABLE 마이그레이션 문을 생성합니다. 업(정방향) 및 다운(롤백) 마이그레이션을 모두 생성합니다.

Related MCP server: MCP Data Analyst

설치

npm install
npm run build

사용법

Claude Desktop 사용

Claude Desktop 구성(claude_desktop_config.json)에 추가하세요:

{
  "mcpServers": {
    "database-tools": {
      "command": "node",
      "args": ["path/to/mcp-database-tools/dist/index.js"]
    }
  }
}

독립 실행

npm start

개발

npm run build    # Compile TypeScript
npm start        # Run the server

라이선스

MIT

Available Tools

5 tools
migration_generateA

Compare two schemas (old vs new CREATE TABLE statements) and generate ALTER TABLE migration statements with both up and down migrations.

Inputs: new_schema (required), old_schema (required), dialect.

query_buildC

Build SQL queries from natural language descriptions. Example: "get all users who signed up this month and have at least 3 orders" generates the corresponding SQL.

Inputs: description (required), dialect, schema_hint.

schema_analyzeA

Parse CREATE TABLE statements to extract tables, columns, types, constraints, foreign keys, and indexes. Generates an ER diagram in Mermaid format.

Inputs: sql (required).

sql_explainA

Take a SQL query and explain what it does in plain English, step by step. Identifies tables, columns, conditions, and provides optimization tips.

Inputs: sql (required).

sql_formatA

Format and prettify SQL queries with proper indentation, uppercased keywords, and aligned columns. Supports MySQL, PostgreSQL, and SQLite syntax.

Inputs: sql (required), dialect, uppercase, indent_size, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool addresses a distinct aspect of database work: formatting, natural language query building, explaining SQL, schema analysis, and migration generation. No two tools overlap in purpose, making selection unambiguous.

    Naming Consistency5/5

    All tool names follow a consistent '<domain>_<action>' pattern (e.g., sql_format, schema_analyze), with noun-first ordering and snake_case throughout. This creates a predictable and readable convention.

    Tool Count5/5

    With 5 tools, the set is concise and well-scoped for a database utility server. Each tool covers a core workflow (format, build, explain, analyze, migrate) without redundancy or bloat.

    Completeness5/5

    The tool set covers the full lifecycle of SQL development: creating/formatting queries, building from natural language, understanding, analyzing schema, and generating schema migrations. No critical gaps are apparent for the stated purpose.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI assistants to query databases using natural language, with automatic schema discovery and SQL compilation.
      4,182 npm
      3,243
      Apache 2.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables natural language querying of SQL databases using AI, supporting multiple database types and automatic schema discovery.
      1
      MIT
    • F
      license
      A
      quality
      C
      maintenance
      Enables AI agents to interact with PostgreSQL or MySQL databases using natural language. Supports SQL queries, schema discovery, and pre-built aggregations without writing SQL.
      3
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables LLM agents to connect to multiple database types, retrieve normalized schemas, and execute optimized SQL queries through a unified API.
      -