nlp2sql
Verified Safeby luiscarbonel1991
Overview
Converts natural language queries to optimized SQL for enterprise-scale databases, supporting multiple AI providers and robust schema management.
Installation
python /path/to/nlp2sql/mcp_server/server.pyEnvironment Variables
- OPENAI_API_KEY
- ANTHROPIC_API_KEY
- GOOGLE_API_KEY
- NLP2SQL_DEMO_DB_URL
- NLP2SQL_LOCAL_DB_URL
- NLP2SQL_TEST_DB_URL
Security Notes
The server employs good practices by using environment variables for API keys and database URLs and by parameterizing SQL queries in repositories. It cleans LLM output for JSON parsing, but the `QueryGenerationService.validate_sql` relies on the AI provider for validation, which can be a soft spot for robust SQL injection prevention. The `SchemaEmbeddingManager` uses `pickle.load` for metadata, which is a known vulnerability for arbitrary code execution if the local cache files are compromised.
Similar Servers
mcp-kql-server
An AI-powered Model Context Protocol (MCP) server for executing Kusto Query Language (KQL) queries against Azure Data Explorer, including natural language to KQL (NL2KQL) conversion, intelligent schema discovery, caching, and data visualization.
sqlite-mcp-server
An enhanced SQLite server that provides a rich set of database, JSON, text processing, vector search, and geospatial tools for AI-driven applications and intelligent workflows via the Model Context Protocol (MCP).
DatabaseMcpServer
This server provides a unified, secure database operation interface for AI assistants, supporting a wide range of database types and dynamic switching.
database-ontology-mcp
Analyzes relational database schemas and automatically generates comprehensive ontologies in RDF/Turtle format with direct SQL mappings for Text-2-SQL convenience, offering secure query execution and interactive data visualization.