MCP server for nlp2sql - Natural Language to SQL conversion using multiple AI providers
The nlp2sql MCP server provides 5 well-named, domain-focused tools for NLP-to-SQL conversion and database interaction. Tool names follow the verb_noun pattern (ask_database, explore_schema, run_sql, list_databases, explain_sql) and are unambiguous. All tools have descriptions exceeding 20 characters. However, several critical gaps reduce the score: (1) input schemas are visible for all 5 tools in the source specification, but the actual JSON Schema type definitions are not shown in the provided code excerpt, only parameter names and descriptions are visible in the YAML-like format. This prevents verification of full schema completeness. (2) Parameter descriptions are present but often generic and lack actionable constraints (e.g., 'database' param describes it as 'Database alias or connection URL' but does not list valid aliases or format restrictions). (3) No output schema is documented anywhere in the provided source. (4) Error handling is not evident in the code excerpt, no recovery guidance, categorization, or actionable error messages are shown. (5) Security patterns are undocumented (no scope declarations, audit trails, or permission gates are visible). The tools themselves are well-composed and avoid multi-responsibility bundling. All 5 tools are READ_ONLY, which is appropriate and well-marked.
Ask a question about your data in natural language. This is the main tool for converting natural language questions to SQL. Optionally execute the query and return actual results.
Explain what a SQL query does. Provides a human-readable explanation of SQL query logic and results.
Discover tables and columns in your database. List all tables with their column names, types, and descriptions.
List available database connections. Shows which database aliases are configured and ready to use.
Execute SQL queries directly (read-only). Run a SQL query and get the results back.
Output schemas not documented. Tool returns are not specified in the provided source code, making it impossible for LLMs to know what fields to expect and plan downstream operations.
Parameter descriptions lack actionable constraints. For example, 'database' param says 'Database alias (default, demo, local, test, prod) or connection URL' but does not enforce these as an enum or regex pattern. LLMs may pass invalid values.
No error handling or recovery guidance visible. The code excerpt does not show how the server returns errors, categorizes them as retryable/fatal, or guides the LLM's next action.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-21 | C | 64 | <=2025-11-25 | v2 |
| 2026-03-09 | F | 15 | - | v1 |
No security documentation. Tool definitions do not declare required scopes (e.g., 'read:database'), mention audit logging, or gate sensitive operations. For a tool that executes SQL, this is a significant gap.
Pagination not documented for explore_schema. When listing tables in a large database, results could exceed context window. No mention of limit, offset, or cursor-based pagination in the schema.
run_sql accepts arbitrary SQL queries. No indication of input sanitization or prevention of SQL injection attacks, even though the tool is read-only. Input validation rules should be explicit.