Text-to-SQL via Model Context Protocol: Structured Context Orchestration for Reliable Database Query Generation

Text-to-SQL has emerged as a fundamental task for enabling natural language interfaces to relational databases, playing a critical role in data analytics, business intelligence, and end-user database interaction. Extensive research efforts have been devoted to this task, ranging from traditional semantic parsing approaches to recent large language model (LLM)-based methods. Despite recent advances, existing LLM-based Text-to-SQL approaches largely rely on one-shot prompt-based generation. This paradigm suffers from two fundamental limitations: entangled contextual information that obscures reasoning, and the absence of systematic validation mechanisms for detecting and correcting SQL errors. To address these challenges, we propose MCP-Text2SQL, a protocol-driven framework that reformulates Text-to-SQL as a controllable and verifiable generation process. Instead of relying on monolithic prompts, MCP-Text2SQL decomposes heterogeneous contextual knowledge into semantically isolated model context protocol context servers and coordinates them through an explicit generation protocol. Furthermore, we introduce a verifiable SQL generation loop that integrates schema validation and execution-based feedback as structured protocol interactions, enabling deterministic and error-aware SQL revision without modifying model parameters. We evaluate MCP-Text2SQL on standard Text-to-SQL benchmarks and demonstrate that protocol-guided context orchestration and verifiable generation substantially improve both generation accuracy and robustness. Our results suggest that MCP provides a principled system-level abstraction for Text-to-SQL, shifting the focus from prompt engineering to controllable and verifiable generation workflows.

Link
https://www.semanticscholar.org/paper/70b2f828173bb4d4b658dd6f644cb7f2cbd3de65
Found by
Semantic Scholar
Authors
Guo-Cang Yang, Victor Junqiu Wei, Ying-Gang Ling, Tao Zhang
Categories
benchmark, evaluation
Published
2026-10-01
Last seen by the radar
2026-10-03
Citations
0
Influential citations
0
Radar score
35.50 / 100 (how it is scored)
Why it scored so
Matched: benchmark, evaluat; Primary record: Semantic Scholar
Related links
https://doi.org/10.1109/TKDE.2026.3716724
Is this record right? If you made this work and something here is wrong or missing, tell us what to fix.

More records found by Semantic Scholar