Skip to main content
Glama

MCP SQL 서버 (개발용)

모든 MCP 호환 LLM을 SQL 데이터베이스에 연결하여 다음 작업을 수행할 수 있는 전문가용 MCP 서버입니다:

  • 쿼리 (SELECT, WITH, SHOW 등)

  • DML (INSERT, UPDATE, DELETE)

  • DDL (CREATE, ALTER 및 선택적으로 DROP/TRUNCATE)

이 서버는 개발 지원을 위한 개인용으로 설계되었습니다.

주요 기능

  • stdio를 통한 MCP 프로토콜 (MCP 클라이언트와 호환).

  • SQLAlchemy를 통한 다중 엔진 연결 (sqlite, postgresql, mysql, mssql 등).

  • 일상적인 작업에 초점을 맞춘 MCP 도구:

    • sql_capabilities

    • sql_list_tables

    • sql_describe_table

    • sql_run

    • sql_run_script

  • 기본적으로 파괴적인 DDL 차단 (DROP/TRUNCATE 차단됨).

  • 행 수 및 스크립트당 문장 수 제한 설정 가능.

Related MCP server: FastMCP MySQL Server

설치

python -m venv .venv
source .venv/bin/activate
pip install -e .

설정 (환경 변수)

접두사: MCP_SQL_

  • MCP_SQL_DATABASE_URL: SQLAlchemy URL. 기본값: sqlite:///./dev.db

  • MCP_SQL_MAX_ROWS: 쿼리당 반환되는 최대 행 수. 기본값: 200

  • MCP_SQL_MAX_SCRIPT_STATEMENTS: 스크립트당 최대 문장 수. 기본값: 100

  • MCP_SQL_ALLOW_DESTRUCTIVE_DDL: DROPTRUNCATE 허용 여부 (true/false). 기본값: false

예시

export MCP_SQL_DATABASE_URL='postgresql+psycopg://dev_user:dev_pass@localhost:5432/devdb'
export MCP_SQL_MAX_ROWS=500
export MCP_SQL_ALLOW_DESTRUCTIVE_DDL=false

서버 실행

mcp-sql-server

모듈로 실행할 수도 있습니다:

python -m mcp_sql_server.server

Windows에서 더블 클릭으로 시작

간편한 시작을 위해 start_mcp_sql_server.bat 파일이 포함되어 있습니다:

  1. .venv가 없으면 자동으로 생성합니다.

  2. 종속성을 설치/업데이트합니다.

  3. MCP 서버를 실행합니다.

해당 .bat 파일을 더블 클릭하기만 하면 됩니다.

MCP 클라이언트 설정 (일반 예시)

{
  "mcpServers": {
    "sql-dev": {
      "command": "mcp-sql-server",
      "env": {
        "MCP_SQL_DATABASE_URL": "sqlite:///./dev.db",
        "MCP_SQL_MAX_ROWS": "200",
        "MCP_SQL_ALLOW_DESTRUCTIVE_DDL": "false"
      }
    }
  }
}

권장 워크플로우

  1. sql_capabilities를 사용하여 활성 설정을 확인합니다.

  2. sql_list_tables를 사용하여 스키마를 탐색합니다.

  3. sql_describe_table을 사용하여 메타데이터를 검사합니다.

  4. sql_run을 사용하여 쿼리나 단일 DML을 실행합니다.

  5. sql_run_script를 사용하여 제어된 변경 사항을 일괄 처리합니다.

개발 지원을 위한 모범 사례

  • 최소 권한을 가진 데이터베이스 사용자를 사용하세요.

  • 로컬 개발 DB 또는 일회용 스냅샷에서 작업하세요.

  • 기본적으로 MCP_SQL_ALLOW_DESTRUCTIVE_DDL=false를 유지하세요.

  • 구조적 변경 사항은 마이그레이션을 통해 버전 관리하세요.

보안 참고 사항

이 프로젝트는 프로덕션 환경을 위해 강화되지 않았습니다. 로컬 개발 환경에서의 생산성 향상을 목적으로 합니다.

VS Code의 Claude 가이드

전체 설정 및 사용 예시는 README_CLAUDE_VSCODE.md를 확인하세요.

Available Tools

5 tools
sql_capabilitiesB

Describe la configuración activa y operaciones soportadas.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool describes configuration and operations, implying a read-only, informational function, but doesn't specify details like whether it requires authentication, returns structured data, or has any side effects. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence in Spanish: 'Describe la configuración activa y operaciones soportadas.' It is front-loaded with the core purpose and wastes no words, making it efficient and easy to parse. Every part of the sentence contributes to understanding the tool's function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (0 parameters, no annotations, but with an output schema), the description is minimally adequate. It explains what the tool does but lacks details on usage context, behavioral traits, or how it differs from siblings. The presence of an output schema means the description doesn't need to explain return values, but overall, it's incomplete for effective agent use without additional context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and the schema description coverage is 100% (since there are no parameters to describe). In such cases, the baseline score is 4, as there's no need for the description to compensate for missing parameter information. The description doesn't add parameter semantics, but that's acceptable given the lack of parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Describe la configuración activa y operaciones soportadas' (Describe active configuration and supported operations). It uses a specific verb ('describe') and identifies the resource ('active configuration and supported operations'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like sql_describe_table or sql_list_tables, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There are multiple sibling SQL tools (sql_describe_table, sql_list_tables, sql_run, sql_run_script), but the description doesn't indicate when sql_capabilities is appropriate compared to these other tools. No context or exclusions are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sql_describe_tableB

Describe columnas, PK, FK e índices de una tabla.

ParametersJSON Schema
NameRequiredDescriptionDefault
table_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It describes what the tool does but lacks critical details: it doesn't specify if this is a read-only operation, what permissions are required, how errors are handled, or the format of the output. For a metadata query tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Spanish that directly states the tool's function without unnecessary words. It's front-loaded with the core purpose, making it easy to parse quickly. Every part of the sentence earns its place by specifying what is described.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (a metadata query with one parameter), no annotations, and an output schema present, the description is minimally adequate. It covers the basic purpose but lacks details on usage, behavior, and parameter nuances. The output schema mitigates the need to explain return values, but overall completeness is limited, aligning with a score of 3.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, meaning the input schema provides no descriptions for parameters. The description adds some value by implying the 'table_name' parameter is used to specify which table to describe, but it doesn't clarify syntax, format, or constraints. With one parameter and low schema coverage, the description partially compensates but not fully, warranting a baseline score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Describe columnas, PK, FK e índices de una tabla' (Describe columns, primary keys, foreign keys, and indexes of a table). It specifies the verb 'describe' and the resource 'table', with details about what aspects are described. However, it doesn't explicitly differentiate from sibling tools like sql_list_tables or sql_capabilities, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like sql_list_tables (for listing tables) or sql_capabilities (for broader metadata), nor does it specify prerequisites or exclusions. This leaves the agent with minimal context for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sql_list_tablesB

Lista tablas y vistas disponibles en el esquema actual.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden but only states the action without disclosing behavioral traits like permissions needed, rate limits, or output format. It mentions 'esquema actual' which adds some context but is insufficient for a mutation-free tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Spanish that directly states the tool's purpose without any wasted words. It is front-loaded and appropriately sized for its simplicity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (0 params, read-only listing), an output schema exists, and schema coverage is high, the description is minimally adequate. However, it lacks details on scope or behavior that could enhance completeness, such as what 'esquema actual' entails or how results are structured.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100%, so no parameter info is needed. The description doesn't add param semantics, but with zero params, the baseline is appropriately high as there's nothing to compensate for.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Lista') and resource ('tablas y vistas disponibles en el esquema actual'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like sql_describe_table or sql_run, which prevents a score of 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives such as sql_describe_table for detailed table info or sql_run for querying. The description implies usage for listing but lacks explicit context or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sql_runB

Ejecuta una sentencia SQL individual usando parámetros nombrados opcionales.

ParametersJSON Schema
NameRequiredDescriptionDefault
statementYes
paramsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this executes SQL statements but doesn't cover critical aspects like whether it's read-only or destructive, authentication requirements, transaction behavior, error handling, or rate limits. For a SQL execution tool, this is a significant gap in safety and operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Spanish that directly states the tool's function. It's front-loaded with the core purpose and includes the key detail about optional named parameters without any unnecessary words or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (SQL execution with parameters), lack of annotations, and 0% schema description coverage, the description is incomplete. However, the presence of an output schema means the agent can infer return values from structured data, raising the baseline. The description covers the basic action but misses critical behavioral and usage context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the schema provides no parameter documentation. The description adds some value by explaining that 'params' are 'parámetros nombrados opcionales' (optional named parameters), but it doesn't clarify the format of 'statement' (e.g., SQL dialect, allowed operations) or provide examples. It partially compensates but leaves key details undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Ejecuta una sentencia SQL individual usando parámetros nombrados opcionales' (Executes a single SQL statement using optional named parameters). It specifies the verb ('ejecuta'), resource ('sentencia SQL'), and scope ('individual'), though it doesn't explicitly differentiate from sibling tools like sql_run_script.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like sql_run_script (for scripts vs. single statements) or sql_list_tables/sql_describe_table (for metadata queries), leaving the agent to guess based on tool names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sql_run_scriptA

Ejecuta múltiples sentencias SQL en secuencia; se detiene al primer error.

ParametersJSON Schema
NameRequiredDescriptionDefault
scriptYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behavioral traits: executes multiple statements sequentially and stops at the first error. This provides important context about transaction-like behavior and error handling that isn't captured elsewhere. However, it doesn't mention permissions, rate limits, or what happens on success.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise - a single sentence that communicates both the core functionality and a critical behavioral constraint. Every word earns its place, with no wasted verbiage. The structure is front-loaded with the main purpose followed by the important behavioral detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (which handles return values) and only one parameter, the description provides good contextual completeness. It covers the key behavioral aspects (sequential execution, error stopping) that aren't captured in structured fields. For a single-parameter tool with output schema, this is reasonably complete, though it could mention permissions or other constraints.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the schema provides no parameter documentation. The description doesn't explicitly mention the 'script' parameter or explain its format, content requirements, or syntax. However, the description implies the parameter contains multiple SQL statements, which adds some semantic context beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Ejecuta múltiples sentencias SQL en secuencia' (executes multiple SQL statements in sequence). It specifies the verb (execute) and resource (SQL statements) with additional detail about sequential execution. However, it doesn't explicitly differentiate from sibling tools like 'sql_run' which might handle single statements.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides implied usage guidance through the phrase 'se detiene al primer error' (stops at the first error), suggesting this tool is appropriate for batch operations where atomic execution is desired. However, it doesn't explicitly state when to use this vs. alternatives like 'sql_run' or provide any exclusion criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 5 tool updatesv0.1.0
    • First observedsql_capabilities
    • First observedsql_describe_table
    • First observedsql_list_tables
    • First observedsql_run
    • First observedsql_run_script

TDQS

A3.7/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: sql_capabilities provides metadata about the server, sql_describe_table describes a specific table's structure, sql_list_tables enumerates available tables/views, sql_run executes a single SQL statement, and sql_run_script handles multiple statements. There is no overlap or ambiguity between these functions.

Naming Consistency5/5

All tool names follow a consistent snake_case pattern with a 'sql_' prefix and descriptive verb_noun combinations (e.g., sql_list_tables, sql_run_script). This uniformity makes the tool set predictable and easy to understand.

Tool Count5/5

With 5 tools, the server is well-scoped for SQL operations. Each tool serves a specific, essential function in a database interaction workflow, from discovery (list_tables, describe_table) to execution (run, run_script), and configuration (capabilities). No tool feels redundant or missing.

Completeness4/5

The tool set covers core SQL operations effectively: listing and describing tables, running queries and scripts, and checking server capabilities. A minor gap is the lack of tools for schema modification (e.g., create/alter/drop tables) or transaction management, but agents can work around this using sql_run for such operations.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Connectors

  • GibsonAI MCP server: manage your databases with natural language

  • The Ramp MCP server enables users to securely connect Ramp with AI assistants like ChatGPT and Claude to query financial data and take actions using natural language. It transforms Ramp's developer API into a SQL interface that LLMs can query, allowing admins to analyze spend trends, identify cost savings, and run complex SQL analyses on comprehensive datasets (transactions, purchase orders, vendors, users), while all users can manage cards, view transactions, request reimbursements, and get expense policy answers.

  • The Instant MCP server is a wrapper around the Instant Platform SDK that enables creating, managing, and updating InstantDB applications directly within an editor. It provides tools for fetching rules files for LLMs, retrieving and pushing app schemas, managing permission rules, and executing database queries. Key capabilities include schema management (get-schema, push-schema), permission management (get-perms, push-perms), query execution, and listing recent query history.

  • The BigQuery remote MCP server is a fully managed service that uses the Model Context Protocol to connect AI applications and LLMs to BigQuery data sources. It provides secure, standardized tools for AI agents to list datasets and tables, retrieve schemas, generate and execute SQL queries through natural language, and analyze data—enabling direct access to enterprise analytics data without requiring manual SQL coding.

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    An MCP server that connects AI assistants to Microsoft SQL Server databases, enabling schema exploration and read-only queries safely.
    49
    37
    4
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A secure and efficient MCP server for MySQL database operations, enabling LLMs to execute SQL queries with read-only access by default and optional write permissions.
    3
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A multi-database MCP server that enables LLMs to safely interact with MySQL, PostgreSQL, SQLite, and others through a unified tool interface, with permission modes and schema resources.
    16
    65
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    A read-only MCP server that exposes SQL database access to LLMs, supporting multiple database types, compact columnar results, pagination, and file export.
    6
    18
    MIT

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/miguel1603/MCP-SQL'

If you have feedback or need assistance with the MCP directory API, please join our Discord server