Server data from the Official MCP Registry
Ask any SQL database in natural language. Agent explores schema, writes SQL, self-corrects.
About
Ask any SQL database in natural language. Agent explores schema, writes SQL, self-corrects.
Security Report
This is a well-intentioned MCP server for database querying via natural language. Authentication and authorization are appropriately delegated to the underlying text2sql-framework and LLM providers (Anthropic/OpenAI). The primary security concern is that database access depends entirely on the `TEXT2SQL_DATABASE_URL` environment variable and the framework's internal safety mechanisms — users must ensure their database credentials are properly managed and that the framework actually enforces read-only access. Code quality is good with proper error handling, but lacks explicit input validation and logging safeguards around sensitive operations. Supply chain analysis found 4 known vulnerabilities in dependencies (0 critical, 3 high severity). Package verification found 1 issue.
4 files analyzed · 9 issues found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
Permissions Required
This plugin requests these system permissions. Most are normal for its category.
What You'll Need
Set these up before or after installing:
Environment variable: TEXT2SQL_DATABASE_URL
Environment variable: ANTHROPIC_API_KEY
Environment variable: OPENAI_API_KEY
Environment variable: TEXT2SQL_MODEL
How to Install
Add this to your MCP configuration file:
{
"mcpServers": {
"io-github-cpenniman12-text2sql-mcp": {
"env": {
"OPENAI_API_KEY": "your-openai-api-key-here",
"TEXT2SQL_MODEL": "your-text2sql-model-here",
"ANTHROPIC_API_KEY": "your-anthropic-api-key-here",
"TEXT2SQL_DATABASE_URL": "your-text2sql-database-url-here"
},
"args": [
"text2sql-mcp"
],
"command": "uvx"
}
}
}Documentation
View on GitHubFrom the project's GitHub 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:
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
Reviews
No reviews yet
Be the first to review this server!
More Developer Tools MCP Servers
Fetch
Freeby Modelcontextprotocol · Developer Tools
Web content fetching and conversion for efficient LLM usage
Toleno
Freeby Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
mcp-creator-python
Freeby mcp-marketplace · Developer Tools
Create, build, and publish Python MCP servers to PyPI — conversationally.
MarkItDown
Freeby Microsoft · Content & Media
Convert files (PDF, Word, Excel, images, audio) to Markdown for LLM consumption
MCP Marketplace
Freeby mcp-marketplace · Developer Tools
Search and install MCP servers from inside your AI client.
FinAgent
Freeby mcp-marketplace · Finance
Free stock data and market news for any MCP-compatible AI assistant.
