MCP SQL Server
Enables integration with n8n workflows for querying live structured data from SQL databases within automation pipelines.
Provides read-only access to PostgreSQL databases, allowing execution of SELECT queries, table listing, and schema inspection with built-in guardrails.
Provides read-only access to SQLite databases, allowing execution of SELECT queries, table listing, and schema inspection with built-in guardrails.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP SQL Serverlist the tables in the database"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-sql-server
Servidor MCP (Model Context Protocol) genérico de solo lectura sobre bases de datos SQL
(SQLite o PostgreSQL), construido con el SDK oficial de Python (mcp) y SQLAlchemy.
Es la evolución natural de sql_tools.py del proyecto Marvel Intelligence Assistant:
la misma lógica de guardrails (solo SELECT, whitelist de tablas, LIMIT forzado, timeout),
pero expuesta como servidor MCP estándar en vez de LangChain StructuredTools —
lo que significa que puede ser usado no solo por ese proyecto, sino por Claude Desktop,
Claude Code o cualquier otro cliente compatible con MCP, sin reescribir nada.
Tools expuestas
Tool | Descripción |
| Lista las tablas disponibles (respetando whitelist si está configurada) |
| Devuelve columnas y tipos de una tabla |
| Ejecuta un SELECT de solo lectura y devuelve resultado en tabla |
Related MCP server: mcp-sql
Guardrails aplicados
Solo se permiten sentencias
SELECT(bloquea INSERT/UPDATE/DELETE/DROP/ALTER/etc.)No se permiten múltiples sentencias en una misma query
Whitelist opcional de tablas accesibles vía
ALLOWED_TABLESLIMITforzado si el usuario no lo especifica (con tope máximo configurable)Timeout de ejecución por query
Instalación
python -m venv venv
# Windows: venv\Scripts\activate
source venv/bin/activate
pip install -r requirements.txtConfiguración (variables de entorno)
Variable | Descripción | Por defecto |
| Cadena de conexión SQLAlchemy |
|
| Tablas permitidas, separadas por coma | todas |
| Timeout por query (segundos) |
|
| Límite de filas por defecto |
|
| Límite máximo de filas |
|
Ejemplos de DB_URL:
SQLite:
sqlite:///C:/ruta/a/marvel.dbPostgreSQL:
postgresql+psycopg2://usuario:password@localhost:5432/mi_bd
Probar contra tu marvel.db real
export DB_URL="sqlite:///C:/ruta/a/tu/marvel.db" # Windows: usa la sintaxis de tu shell
python server.pyConectarlo a Claude Desktop
Añade esto a tu claude_desktop_config.json
(Windows: %APPDATA%\Claude\claude_desktop_config.json):
{
"mcpServers": {
"sql-readonly": {
"command": "C:\\ruta\\a\\mcp-sql-server\\venv\\Scripts\\python.exe",
"args": ["C:\\ruta\\a\\mcp-sql-server\\server.py"],
"env": {
"DB_URL": "sqlite:///C:/ruta/a/marvel.db"
}
}
}
}Reinicia Claude Desktop y podrás preguntarle directamente sobre tu base de datos ("¿qué tablas hay?", "dime las 5 películas con más ingresos") usando estas tools.
Relación con Marvel Intelligence Assistant
Este servidor reutiliza el mismo diseño de guardrails que sql_guardrails.py del proyecto
Marvel, pero desacoplado del router de LangChain. La idea de portfolio es poder decir:
"Mi SQL agent en Marvel Intelligence Assistant usa LangChain StructuredTools de forma nativa. Además, construí una versión de esas mismas herramientas como servidor MCP independiente, reutilizable desde cualquier cliente compatible (Claude Desktop, Claude Code, u otros agentes), no solo desde mi router."
Reutilización en otros proyectos (n8n + MCP + RAG)
Este mismo servidor (apuntando a otra BBDD en vez de Marvel) es la pieza de "datos estructurados en vivo" de otro proyecto combinado más adelante: n8n dispara el flujo, el agente usa este MCP para consultar datos en tiempo real, y un componente RAG aporta el contexto documental (informes técnicos, normativa) para el análisis final.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityAmaintenanceRead-only MCP server for querying PostgreSQL, MySQL, and SQLite from AI agents — multi-database, safe by default.4181ISC
- Alicense-qualityCmaintenanceAn extensible read-only MCP server for SQL databases, enabling schema exploration and safe SELECT queries via tools like list_schemas, list_tables, describe_table, and execute_query.MIT
- Alicense-qualityCmaintenanceA read-only MCP server that enables LLMs to safely explore and query any SQLite database via natural language. It exposes tools for listing tables, describing schemas, and executing SELECT/WITH queries with built-in safety guards like write prevention and row limits.MIT
- AlicenseAqualityAmaintenanceRead-only MCP server that lets AI agents safely query SQLite, PostgreSQL, and MySQL/MariaDB. Enforces read-only transactions with column masking, row caps, query timeouts, EXPLAIN-based cost rejection, and rate limiting.7291MIT
Related MCP Connectors
MCP server for managing Prisma Postgres.
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
Read-only MCP server for wafergraph.com's semiconductor & AI supply-chain data: 30 tools, no auth.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/alegonzjur/MCP-SQL-Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server