mcptesis
Provides read-only access to a PostgreSQL database, with tools to list schema tables, describe table details, and run SELECT/WITH queries.
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., "@mcptesisWhat's the number of vehicles currently out of service?"
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.
mcptesis — MCP server (solo lectura) sobre la base de flota
Servidor MCP que expone la base de datos del sistema de
gestión de flota como tools de solo lectura. Lo consume el chatbot del backend
(/api/chatbot), que corre el agent loop contra un LLM (vía OpenRouter) y usa estas tools
para responder preguntas en lenguaje natural.
backend /api/chatbot ──HTTP + Bearer──► mcptesis (:4000/mcp) ──SELECT──► PostgreSQL (rol read-only)Tools expuestas
Tool | Args | Qué hace |
| — | Lista todas las tablas del schema |
|
| Detalle de una tabla puntual. |
|
| Ejecuta una consulta |
Candados de solo lectura (defensa en profundidad)
Rol Postgres read-only — el server se conecta con
DATABASE_URL_READONLY, un rol que solo tieneSELECT.Validación estructural (
src/guards.ts) — una sola sentencia, debe empezar conSELECT/WITH, sin;, y rechaza palabras clave de escritura/DDL.Transacción
READ ONLYconstatement_timeoutyLIMITforzado (src/db.ts).
Related MCP server: MCP PostgreSQL
Requisitos
Node.js 20+ (probado en 22).
Acceso a la base PostgreSQL del sistema de flota.
Setup
npm install
cp .env.example .env # y completá los valores (ver abajo).env:
PORT=4000
DATABASE_URL_READONLY=postgresql://fleet_readonly:PASSWORD@host:5432/db
DB_SSL=true # true en Render/RDS
MCP_AUTH_TOKEN=<mismo token que el backend>
QUERY_TIMEOUT_MS=5000
MAX_ROWS=500Crear el rol de solo lectura
Automático (usa un usuario owner para crear el rol):
ADMIN_DATABASE_URL="postgresql://OWNER:PASS@host:5432/db" \
READONLY_PASSWORD="una-password-fuerte" \
DB_SSL=true \
npm run create-readonly-roleO manual: ver sql/create_readonly_role.sql.
En bases administradas (Render) el usuario provisto puede no tener permiso para
CREATE ROLE. Si es el caso, apuntáDATABASE_URL_READONLYa la conexión normal: los guards de la app fuerzan solo lectura igual (candados 2 y 3), aunque perdés el candado 1.
Correr
npm run dev # desarrollo (tsx watch)
npm run build && npm start # producción
npm run smoke # con el server corriendo: lista tools + prueba list_schema/run_queryHealth check: GET http://localhost:4000/health.
Estructura
src/
config.ts # env validado con zod
db.ts # pool pg + runReadOnlyQuery (txn read-only, timeout, limit)
guards.ts # validación SELECT-only
introspection.ts # esquema desde information_schema (cacheado)
tools.ts # registro de las 3 tools MCP
server.ts # McpServer + tools
index.ts # Express + Streamable HTTP transport + auth Bearer
scripts/
create-readonly-role.ts
smoke.ts
sql/
create_readonly_role.sqlThis 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
- AlicenseAqualityAmaintenanceAn MCP server that gives AI agents direct read-only access to PostgreSQL databases, enabling natural language analytics through tools for schema exploration, querying, trend analysis, and data quality checks.115MIT
- Alicense-qualityDmaintenanceA read-only MCP server for PostgreSQL that enables safe database introspection and querying via natural language.727MIT
- Alicense-qualityCmaintenanceRead-only MCP server for SQL databases (SQLite/PostgreSQL) that enables listing tables, describing schemas, and executing SELECT queries with safety guardrails.MIT
- Flicense-qualityBmaintenanceRead-only MCP server for PostgreSQL enabling schema introspection and SELECT queries via MCP clients like Claude, with multi-layered write protection.
Related MCP Connectors
GibsonAI MCP server: manage your databases with natural language
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
MCP server for managing Prisma Postgres.
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/Juanma519/mcp_tesis'
If you have feedback or need assistance with the MCP directory API, please join our Discord server