A Model Context Protocol server that converts natural language queries to PostgreSQL SQL queries using Azure OpenAI and executes them against a PostgreSQL database.
Single tool 'mcp_query' has critical definition gaps. Tool name lacks action verb (should be 'execute_query' or 'query_database'). Description is present but generic (97 chars, below 194-char baseline). Input schema exists but lacks parameter descriptions, 'query' param has no guidance on format, length, or constraints. No output schema documented. No error handling guidance. Tool performs LLM-based SQL generation + execution, a high-risk operation combining two concerns (NL→SQL translation + query execution) without safety guardrails, confirmation steps, or destructive operation warnings.
Converts a natural language query to PostgreSQL SQL and executes it against the database, returning both the generated SQL and query results.
Tool name 'mcp_query' lacks action verb. Should be 'execute_query', 'query_database', or 'run_sql_query' to signal intent clearly to LLMs.
Input parameter 'query' has no description. LLM cannot infer expected format (natural language vs SQL), length limits, or constraints. Baseline: 100% of A+ tools have parameter descriptions.
No output schema documented. LLM cannot predict response structure (fields, types, pagination). Baseline: 100% of A+ tools have documented return types.
Tool combines NL→SQL translation + execution without confirmation or dry-run. High-risk destructive operation (UPDATE/DELETE via LLM-generated SQL) lacks safety guardrails. No error recovery guidance.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 25 | 2026-07-28+ | v2 |
SQL injection vulnerability: executor.py strips markdown backticks but does NOT validate SQL syntax or parameterize queries. LLM-generated SQL passed directly to psycopg2.execute() without prepared statements. Credentials (DB_HOST, DB_USER, DB_PASSWORD) exposed in environment without vault/secret manager.