Ask any SQL database in natural language. Agent explores schema, writes SQL, self-corrects.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
MCP server for text2sql-framework. Plugs into Claude Desktop, Cursor, Goose, or any other MCP-compatible assistant and lets it ask a SQL database questions in natural language.
The agent explores the schema, writes SQL, executes it against the real DB, and self-corrects on errors β no RAG layer, no schema descriptions, no pre-computed embeddings.
Out of the box, text2sql-mcp supports SQLite + Anthropic:
For other databases or LLM providers, install with the matching extra so the right driver gets installed:
| You want⦠| Install command |
|---|---|
| SQLite (default) | uvx text2sql-mcp |
| Postgres | uvx 'text2sql-mcp[postgres]' |
| MySQL | uvx 'text2sql-mcp[mysql]' |
| Snowflake | uvx 'text2sql-mcp[snowflake]' |
| BigQuery | uvx 'text2sql-mcp[bigquery]' |
| OpenAI models | add openai, e.g. uvx 'text2sql-mcp[postgres,openai]' |
Set environment variables in your MCP client config:
| Variable | Required | Description |
|---|---|---|
TEXT2SQL_DATABASE_URL | yes | SQLAlchemy URL, e.g. sqlite:///mydb.db, postgresql://user:pass@host/db |
ANTHROPIC_API_KEY or OPENAI_API_KEY | yes | LLM provider key |
TEXT2SQL_MODEL | no | LangChain model id (default: anthropic:claude-sonnet-4-6) |
TEXT2SQL_INSTRUCTIONS | no | Business rules / hints, e.g. "Revenue = net of refunds." |
TEXT2SQL_EXAMPLES | no | Path to a scenarios.md file for the agent's lookup_example tool |
query(question, max_rows=100) β ask the database a natural-language question. Returns {sql, data, error, row_count, tool_calls_made}.Under the hood this is a thin wrapper around text2sql-framework, which uses LangChain Deep Agents to do iterative tool-calling against a single execute_sql tool. See the framework README for benchmarks (19/20 on Spider zero-shot across 80 tables) and architecture details.
MIT
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/text2sql)<a href="https://allmcps.com/mcp/text2sql"><img src="https://allmcps.com/api/badge/text2sql?style=directory" alt="Text2sql on AllMCPs" /></a>