MCP SQL Server
An MCP server that connects LLMs to SQL databases for development assistance, enabling query execution, schema exploration, and data manipulation while providing safety controls against destructive operations.
README
MCP SQL Server (Desarrollo)
Servidor MCP profesional para conectar cualquier LLM compatible con MCP a una base de datos SQL y ejecutar:
- Consultas (
SELECT,WITH,SHOW, etc.) - DML (
INSERT,UPDATE,DELETE) - DDL (
CREATE,ALTER, y opcionalmenteDROP/TRUNCATE)
Este servidor está diseñado para uso personal en desarrollo asistido.
Características
- Protocolo MCP vía stdio (compatible con clientes MCP).
- Conexión multi-motor mediante
SQLAlchemy(sqlite,postgresql,mysql,mssql, etc.). - Herramientas MCP enfocadas en operación diaria:
sql_capabilitiessql_list_tablessql_describe_tablesql_runsql_run_script
- Bloqueo de DDL destructivo por defecto (
DROP/TRUNCATEbloqueados). - Límite configurable de filas y de sentencias por script.
Instalación
python -m venv .venv
source .venv/bin/activate
pip install -e .
Configuración (variables de entorno)
Prefijo: MCP_SQL_
MCP_SQL_DATABASE_URL: URL SQLAlchemy. Default:sqlite:///./dev.dbMCP_SQL_MAX_ROWS: máximo de filas devueltas por consulta. Default:200MCP_SQL_MAX_SCRIPT_STATEMENTS: máximo de sentencias por script. Default:100MCP_SQL_ALLOW_DESTRUCTIVE_DDL:true/falsepara permitirDROPyTRUNCATE. Default:false
Ejemplo
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
Ejecutar el servidor
mcp-sql-server
También puedes ejecutarlo como módulo:
python -m mcp_sql_server.server
Inicio con doble click en Windows
Se incluye el archivo start_mcp_sql_server.bat para facilitar el arranque:
- Crea
.venvautomáticamente (si no existe). - Instala/actualiza dependencias.
- Levanta el servidor MCP.
Solo haz doble click en ese .bat.
Configuración en un cliente MCP (ejemplo genérico)
{
"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"
}
}
}
}
Flujo recomendado
sql_capabilitiespara verificar configuración activa.sql_list_tablespara explorar el esquema.sql_describe_tablepara inspeccionar metadatos.sql_runpara consultas o DML puntual.sql_run_scriptpara lotes de cambios controlados.
Buenas prácticas para desarrollo asistido
- Usa usuarios de base de datos con privilegios mínimos.
- Trabaja sobre una DB local de desarrollo o snapshot desechable.
- Mantén
MCP_SQL_ALLOW_DESTRUCTIVE_DDL=falsepor defecto. - Versiona cambios estructurales con migraciones.
Nota de seguridad
Este proyecto no está endurecido para producción. Está orientado a productividad local en entornos de desarrollo.
Guía Claude en VS Code
Revisa README_CLAUDE_VSCODE.md para un ejemplo completo de configuración y uso.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.