PostgreSQL database query and management server for MCP
Server has 4 tools with basic descriptions in Spanish, but critical quality gaps undermine production readiness. All tools lack proper input schema validation, parameters are extracted manually from args dict without type enforcement. Descriptions are present but generic (avg ~80 chars, below 194-char baseline). No output schemas documented. SQL injection vulnerability in query_table and execute_query (string interpolation in LIMIT and table names). Hardcoded credentials in DatabaseConnection class. No error guidance for LLM recovery. Tools lack idempotency guarantees and confirmation patterns for destructive operations.
Ejecuta una consulta SQL personalizada. Args: query: Consulta SQL a ejecutar params: Tupla opcional de parámetros para la consulta (opcional)
Obtiene información detallada sobre una tabla específica. Args: table: Nombre de la tabla sobre la que obtener información
Lista todas las tablas en la base de datos.
Consulta datos de una tabla específica. Args: table: Nombre de la tabla a consultar limit: Número máximo de filas a retornar (opcional, por defecto: 5)
SQL injection vulnerability: query_table uses f-string interpolation for table name and LIMIT value (line: `cur.execute(f"SELECT * FROM {table} LIMIT {limit}")`) without parameterization. execute_query accepts raw SQL from LLM without sanitization.
Hardcoded database credentials in source code (host='localhost', user='postgres', password='codenexus' in DatabaseConnection.__init__). Credentials must use server-side secret injection via environment variables or vault.
No input schemas defined. Tools extract parameters manually from args dict without type validation. FastMCP @mcp.tool() decorator does not show explicit schema registration in source. Parameters lack JSON Schema type definitions, descriptions, and constraints.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 39 | 2026-07-28+ | v2 |
No output schema documentation. Tools return unstructured plain-text strings. LLMs cannot parse results reliably or extract IDs for chaining. Should return structured JSON with typed fields (e.g., {tables: [string], count: int}).
execute_query_tool marked WRITE risk but lacks confirmation/dry-run pattern. Destructive operations (DELETE, DROP, UPDATE) should require explicit confirmation before execution to prevent accidental data loss by LLM.