
text2sql
io.github.cpenniman12Published by GitHub account cpenniman12v0.1.2Updated Oct 24, 2026
Ask any SQL database in natural language. Agent explores schema, writes SQL, self-corrects.
Overview
Lets an assistant query a SQL database in natural language, exploring the schema, writing and running SQL, and correcting itself on errors.
- What you can do
- Ask a database a natural-language question and get back the generated SQL, result rows, error and row count.
- When to use it
- Use it when you want to ask questions of a SQLite, Postgres, MySQL, Snowflake or BigQuery database in plain language without writing SQL or setting up schema descriptions and embeddings first.
- Requirements
- Runs locally as a Python package (pip or uvx), with a database extra such as postgres, mysql, snowflake or bigquery installed as needed. Requires TEXT2SQL_DATABASE_URL and either ANTHROPIC_API_KEY or OPENAI_API_KEY; optional TEXT2SQL_MODEL, TEXT2SQL_INSTRUCTIONS and TEXT2SQL_EXAMPLES.
Installation
In SourceWeft
- Open text2sql in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
text2sql-mcp
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.
Install
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:
Configure
Set environment variables in your MCP client config:
Claude Desktop / Cursor / generic MCP
Goose CLI
Tools
query(question, max_rows=100)— ask the database a natural-language question. Returns{sql, data, error, row_count, tool_calls_made}.
How it works
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.
License
MIT
Source: README.md at commit 97142b4
Tools
0Version history
1- v0.1.2LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts