Command Palette

Search for a command to run...

UnylyUnyly
Весь каталог

SqlExecutorMCP

БесплатноНе проверен

MCP server that lets AI agents work SQL Server and MySQL safely: allowlisted targets, statement-type gating, and destructive ops split into their own tools.

GitHubEmbed

Описание

MCP server that lets AI agents work SQL Server and MySQL safely: allowlisted targets, statement-type gating, and destructive ops split into their own tools.

README

Python MCP SQL Server MySQL License: MIT

An MCP server that lets AI agents work with real databases without handing them the keys to the kingdom. It speaks to SQL Server and MySQL over named connections, and every request passes through an allowlist and a statement-type gate before it touches an engine.

I built it because I point Claude at working databases every day, and "the agent can run whatever SQL it wants" was never going to fly. It's wired into my own Claude Code sessions as I type this.

The safety model

This is the part I care about. Three layers, all enforced server-side:

  1. Named connections only. The agent never sees a connection string. It asks for a connection by name, and credentials live in a local config.json that never leaves the machine.
  2. Per-connection allowlists. Each connection declares which databases and schemas are fair game ("*" is available, but it's an explicit opt-in). Anything outside the list raises a permission error before any SQL runs.
  3. Statement-type gating. Every statement is parsed with sqlparse and its type is checked against the tool that submitted it:
    • execute_query accepts SELECT and CALL, nothing else
    • execute_statement accepts INSERT, UPDATE, CREATE, ALTER, and MERGE
    • DELETE and DROP each require their own dedicated tool, so a destructive statement can't ride in on a generic call
    • TRUNCATE is blocked everywhere, full stop

Transactions get the same treatment: execute_transaction runs a batch of DML atomically, and the MySQL adapter knows that DDL there commits implicitly, so it won't pretend a DDL rollback would have worked.

Tools

Tool What it does
list_connections Show the named connections and what they allow
list_databases List databases visible on a connection
list_tables List tables in a database
describe_table Columns, types, and nullability for a table
get_table_constraints Keys, foreign keys, and constraints
get_schema Broader schema snapshot for orientation
preview_table Peek at the first rows without writing SQL
execute_query Read-only SELECT / CALL
execute_statement Gated writes: INSERT, UPDATE, CREATE, ALTER, MERGE
execute_transaction A batch of DML statements, all-or-nothing
delete_statement DELETE, and only DELETE
drop_statement DROP, and only DROP

Setup

pip install -e .
cp config.template.json config.json   # connections + allowlist, see the template

Then register it with your MCP client (Claude Code / Claude Desktop shown):

{
  "mcpServers": {
    "sql-executor": { "command": "sql-executor-mcp" }
  }
}

Stack

Python 3.10+ · FastMCP · pyodbc · mysql-connector-python · sqlparse

from github.com/TylerBuilds-Official/SqlExecutorMCP

Установить SqlExecutorMCP в Claude Desktop, Claude Code, Cursor

Рекомендуется · одна команда, все IDE
unyly install sqlexecutormcp

Ставит в Claude Desktop, Claude Code, Cursor и VS Code — сам разбирается с npx, uvx и сборкой из исходников.

Впервые? Поставь CLI: curl -fsSL https://unyly.org/install | sh

Или настроить вручную

Выполни в терминале:

claude mcp add sqlexecutormcp -- uvx --from git+https://github.com/TylerBuilds-Official/SqlExecutorMCP sql-executor-mcp

Пошаговые гайды: как установить SqlExecutorMCP

FAQ

SqlExecutorMCP MCP бесплатный?

Да, SqlExecutorMCP MCP бесплатный — установка в пару кликов через Unyly без оплаты.

Нужен ли API-ключ для SqlExecutorMCP?

Нет, SqlExecutorMCP работает без API-ключей и переменных окружения.

SqlExecutorMCP — hosted или self-hosted?

Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.

Как установить SqlExecutorMCP в Claude Desktop, Claude Code или Cursor?

Открой SqlExecutorMCP на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.

Похожие MCP

wenb1n-dev/SmartDB_MCP

A universal database MCP server supporting simultaneous connections to multiple databases. It provides tools for database operations, health analysis, SQL optim

wenb1n-devавтор: wenb1n-dev

Postgres Server

This server enables interaction with PostgreSQL databases through the Model Context Protocol, optimized for the AWS Bedrock AgentCore Runtime. It provides tools

madhurprashавтор: madhurprash

Postgres

Query your database in natural language

Anthropicавтор: Anthropic

PostgreSQL

Read-only database access with schema inspection.

modelcontextprotocolавтор: modelcontextprotocol

Redis

Interact with Redis key-value stores.

modelcontextprotocolавтор: modelcontextprotocol

SQLite

Database interaction and business intelligence capabilities.

modelcontextprotocolавтор: modelcontextprotocol

mxcp

Open-source framework for building enterprise-grade MCP servers using just YAML, SQL, and Python, with built-in auth, monitoring, ETL and policy enforcement.

raw-labsавтор: raw-labs

tadas-github/a2asearch-mcp

MCP server to search 4,800+ MCP servers, AI agents, CLI tools and agent skills. Install: npx -y a2asearch-mcp. Ask Claude: "Find MCP servers for database access

tadas-githubавтор: tadas-github

julien040/anyquery

Query more than 40 apps with one binary using SQL. It can also connect to your PostgreSQL, MySQL, or SQLite compatible database. Local-first and private by desi

julien040автор: julien040

drakonkat/wizzy-mcp-tmdb

A MCP server for The Movie Database API that enables AI assistants to search and retrieve movie, TV show, and person information.

drakonkatавтор: drakonkat

Compare SqlExecutorMCP with

Не уверен что выбрать?

Найди свой стек за 60 секунд

Автор?

Embed-бейдж для README

Похожее

Все в категории data