SqlExecutorMCP
FreeNot checkedMCP server that lets AI agents work SQL Server and MySQL safely: allowlisted targets, statement-type gating, and destructive ops split into their own tools.
About
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:
- Named connections only. The agent never sees a connection string. It asks for a connection by name, and credentials live in a local
config.jsonthat never leaves the machine. - 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. - Statement-type gating. Every statement is parsed with
sqlparseand its type is checked against the tool that submitted it:execute_queryaccepts SELECT and CALL, nothing elseexecute_statementaccepts 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
Install SqlExecutorMCP in Claude Desktop, Claude Code & Cursor
unyly install sqlexecutormcpInstalls into Claude Desktop, Claude Code, Cursor & VS Code — handles npx, uvx and build-from-source repos for you.
First time? Get the CLI: curl -fsSL https://unyly.org/install | sh
Or configure manually
Run in your terminal:
claude mcp add sqlexecutormcp -- uvx --from git+https://github.com/TylerBuilds-Official/SqlExecutorMCP sql-executor-mcpStep-by-step: how to install SqlExecutorMCP
FAQ
Is SqlExecutorMCP MCP free?
Yes, SqlExecutorMCP MCP is free — one-click install via Unyly at no cost.
Does SqlExecutorMCP need an API key?
No, SqlExecutorMCP runs without API keys or environment variables.
Is SqlExecutorMCP hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install SqlExecutorMCP in Claude Desktop, Claude Code or Cursor?
Open SqlExecutorMCP on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
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
by wenb1n-devPostgres Server
This server enables interaction with PostgreSQL databases through the Model Context Protocol, optimized for the AWS Bedrock AgentCore Runtime. It provides tools
by madhurprashPostgres
Query your database in natural language
by AnthropicPostgreSQL
Read-only database access with schema inspection.
by modelcontextprotocolRedis
Interact with Redis key-value stores.
by modelcontextprotocolSQLite
Database interaction and business intelligence capabilities.
by modelcontextprotocolmxcp
Open-source framework for building enterprise-grade MCP servers using just YAML, SQL, and Python, with built-in auth, monitoring, ETL and policy enforcement.
by raw-labstadas-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
by tadas-githubjulien040/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
by julien040drakonkat/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.
by drakonkatCompare SqlExecutorMCP with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All data MCPs
