text2sql MCP Server
Ask any SQL database in natural language. Agent explores schema, writes SQL, self-corrects.
text2sql scores 54 (Fair), licensed MIT and written in Python. It installs as a local process. It does not declare tools yet. Filed under Databases. GitHub shows 1 stars. Install configs are generated for 12 clients. Being listed in the registry is not the same as being vendor-official.
Fair trust
54 of 100 from six public signals. Nobody can buy a point.
- Listed in the official MCP registry.
- OSI-style license: mit.
License, quality and maintenance
Quality: Grade C
55/100 for listing completeness. Lost points: short README, no listed tools, short summary.
How quality is graded
Where the 54 comes from
22 + 10 + 1 + 10 + 4 + 7 = 54. Each factor is capped, so no single signal can carry a listing.
Active in the official MCP registry, plus a known vendor namespace.
Registry: 22 of 30 points.How recently the repository saw a commit or release.
Maintenance: 10 of 20 points.GitHub stars and weekly downloads, on a log scale.
Popularity: 1 of 20 points.A clear, OSI-style open-source license.
License: 10 of 10 points.Not archived, a secure install path, a pinned version.
Security: 4 of 10 points.A real summary, a README with depth, listed tools.
Docs: 7 of 10 points.Install
Pick your client, copy the config, paste it in.
Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.
{ "mcpServers": { "cpenniman12-text2sql-mcp": { "command": "uvx", "args": [ "text2sql-mcp" ], "env": { "TEXT2SQL_DATABASE_URL": "", "ANTHROPIC_API_KEY": "YOUR_ANTHROPIC_API_KEY", "OPENAI_API_KEY": "YOUR_OPENAI_API_KEY", "TEXT2SQL_MODEL": "" } } }}
Environment variables
| Name | Required | Notes |
|---|---|---|
TEXT2SQL_DATABASE_URL | Required | SQLAlchemy connection URL, e.g. sqlite:///mydb.db or postgresql://user:pass@host/db |
ANTHROPIC_API_KEYSecret | Optional | Anthropic API key (required if using the default Anthropic model) |
OPENAI_API_KEYSecret | Optional | OpenAI API key (required when TEXT2SQL_MODEL is set to an openai:* model) |
TEXT2SQL_MODEL | Optional | Optional LangChain model id (default: anthropic:claude-sonnet-4-6) |
Tools
All capabilitiesTools show up when the registry metadata or the repository README lists them. Public READMEs are read directly. A GitHub token is used only when one is already configured.
About
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:
pip install text2sql-mcp
# or
uvx text2sql-mcp
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]' |
Configure
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 |
Claude Desktop / Cursor / generic MCP
{
"mcpServers": {
"text2sql": {
"command": "uvx",
"args": ["text2sql-mcp"],
"env": {
"TEXT2SQL_DATABASE_URL": "sqlite:///mydb.db",
"ANTHROPIC_API_KEY": "sk-ant-..."
}
}
}
}
Goose CLI
goose configure
# Add Extension → Command-line Extension
# Name: text2sql
# Command: uvx text2sql-mcp
# Env: TEXT2SQL_DATABASE_URL, ANTHROPIC_API_KEY
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
Frequently asked questions
What is text2sql MCP Server?
Ask any SQL database in natural language. Agent explores schema, writes SQL, self-corrects.
How do I install text2sql MCP Server in Claude Desktop, Cursor, or VS Code?
Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. text2sql MCP Server runs locally from the PyPI package text2sql-mcp with the command uvx text2sql-mcp.
Is text2sql MCP Server free and open source?
Yes. text2sql MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.
Does text2sql MCP Server support remote (HTTP) connections?
No remote endpoint is listed for text2sql MCP Server. It runs locally on your machine over stdio, started by your MCP client.
How is text2sql MCP Server's trust score calculated?
text2sql MCP Server scores 54 out of 100 (Fair). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.
Reviews
No reviews yet—Be the first to review
No published reviews yet. Used it? Tell the next person how it went.
Sign inA verified email is required to review this server.
Add badge to your README
Paste either snippet into the repository README. The image links to this listing.