An MCP server for SQL query generation and execution with LLM integration, featuring database schema analysis, vector embeddings, and a chat interface for natural language to SQL conversion
This MCP server has fundamental definition quality issues that render it unsuitable for production use. Of 11 tools, none have proper input schemas visible in the code; most descriptions are generic or missing context; parameter documentation is minimal or absent. The codebase shows incomplete tool registration, tool definitions are scattered across multiple FastAPI endpoints rather than centralized in an MCP-compliant tool registry. There is no evidence of proper error handling, parameter validation, or output schema documentation. The server appears to be a collection of ad-hoc FastAPI endpoints rather than a cohesive MCP implementation.
Connect to MSSQL database using credentials from environment variables
Construct an LLM prompt using the schema and user question for SQL generation
Combine user query with relevant context to generate an LLM prompt
Get LLM response for a given prompt by calling the LLM interface service
Fetch detailed column information of a specified table from the MSSQL database
Handle a query request with user context and return a formatted response
Load FAISS vector index and embeddings from files
No visible input schemas for any tool. Tools are defined as FastAPI Pydantic models (QueryRequest, etc.) but MCP tool schemas are not explicitly registered. Cannot verify that tools declare proper JSON Schema with types, constraints, and descriptions for all parameters.
Duplicate tool name 'create_prompt' with different signatures (6 and 7). LLMs cannot distinguish between them. Must rename to indicate the difference: e.g. 'create_prompt_from_schema' vs 'create_prompt_from_context'.
Generic/incomplete descriptions. Examples: 'Construct an LLM prompt...' (55 chars), 'Query the FAISS vector index...' (45 chars). Descriptions lack WHEN to use, prerequisites, or expected outcomes. Descriptions should be 50-200 chars with clear intent.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | F | 34 | <=2025-11-25 | v2 |
| 2026-03-09 | F | 31 | - | v1 |
Load table schema from a JSON file
Process a user query and generate an SQL query based on the database schema
Query the FAISS vector index for semantic search
Query the database via the LLM interface
Parameter descriptions missing or trivial. 'query' param across multiple tools lacks context on format (natural language vs SQL vs FAISS embedding vs database query). 'context' param in create_prompt has only 'Optional dictionary of previous context', no guidance on expected structure. Parameter descriptions must explain format, constraints, and valid values.
No error handling guidance. Tools return generic HTTP 500 errors with stack traces. No recovery hints like 'Try search_table_list() first' or 'Check database connectivity.' Error responses must categorize as retryable/user-fixable/fatal and guide next steps.
No output schema documentation. Tools return ad-hoc responses (e.g. QueryResponse with bare 'response' string) without specifying field types, nesting, or pagination. LLMs cannot plan downstream calls or extract structured data. Every tool must document return types.
connect_to_mssql has empty input schema ({}). Tool accepts no parameters but database credentials are likely hardcoded or environment-based. If credentials are environment variables, this is correct, but the description does not explain this. If they must be passed, add parameters.
No parameter type constraints. 'top_k' in query(FAISS) is an integer with default=5 but no min/max bounds. LLMs could pass negative or absurdly large values (e.g. top_k=1000000). Numeric parameters must declare range (e.g. 1 - 100).
Generic tool names lack specificity. 'query' appears 3 times across different contexts (database, FAISS, LLM interface). LLMs conflate them. Rename to: 'query_database', 'search_faiss_embeddings', 'query_llm_interface' to clarify intent.
No idempotency guarantees. Tools like 'create_prompt', 'handle_query' offer no idempotency hints. If an agent retries on network failure, will it create duplicate prompts or duplicate side effects? Stateless operations should declare idempotentHint=true.