AI2SQL
Text-to-SQL MCP server running read-only queries on Postgres, MySQL and SQL Server
- Pricing
- Freemium
- Platforms
- Web, API, macOS
- Runs
- Remotely
- Version
- 1.0.1
- Listing updated
- 1 day ago
About AI2SQL
AI2SQL is a freemium MCP server for databases. It runs as a hosted remote server, so there is nothing to install locally.
This hosted server gives an AI assistant eight tools for working with SQL: five that write, fix, optimise, explain and convert queries, and three that inspect and query databases you connect at the vendor's site. Queries can be written for PostgreSQL, MySQL, SQL Server, Oracle, Snowflake, BigQuery, SQLite and MariaDB; live querying covers PostgreSQL, MySQL/MariaDB and SQL Server.
Access is guarded. Sign-in uses OAuth 2.1, so no API key is pasted into the client. Only a single SELECT or WITH statement runs, with writes, DDL and batches rejected on the server, and results are capped at 1,000 rows and 10 seconds. Team plans can mask names, emails, phone numbers and similar fields before the assistant sees them, and an activity log records every call, including blocked writes.
A sample store called demo_shop lets anyone try live queries without connecting a database.
Install
Run in a terminal
claude mcp add --transport http ai2sql https://builder.ai2sql.io/api/chatgpt-mcpAdd to Settings → Connectors → Add custom connector
https://builder.ai2sql.io/api/chatgpt-mcpAdd to ~/.cursor/mcp.json
{
"mcpServers": {
"ai2sql": {
"url": "https://builder.ai2sql.io/api/chatgpt-mcp"
}
}
}Add to .vscode/mcp.json
{
"servers": {
"ai2sql": {
"type": "http",
"url": "https://builder.ai2sql.io/api/chatgpt-mcp"
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"ai2sql": {
"serverUrl": "https://builder.ai2sql.io/api/chatgpt-mcp"
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"ai2sql": {
"type": "http",
"url": "https://builder.ai2sql.io/api/chatgpt-mcp"
}
}
}Tools this server provides (8)
Taken from the project documentation; the running server may differ.
- generate_sql
- Plain English to SQL in a named dialect.
- fix_sql
- Corrects a failing query given its error.
- optimize_sql
- Rewrites a slow query with reasoning and index hints.
- explain_sql
- Explains a query line by line.
- convert_sql
- Translates SQL between dialects.
- list_connections
- Lists connected databases.
- describe_schema
- Describes tables and columns of a connection.
- run_query
- Runs one read-only query, up to 1,000 rows.
What it does
- SQL generation
- Turns plain English into SQL for the named dialect, using the real schema when a connection is picked.
- Fix and optimise
- Repairs failing queries and suggests faster versions with index hints.
- Dialect conversion
- Translates queries between eight SQL dialects.
- Schema inspection
- Lists connections and describes tables and columns.
- Read-only queries
- Runs one SELECT or WITH statement and returns up to 1,000 rows.
- Data masking
- Replaces personal values in results with placeholders on the Team plan.
- Audit log
- Logs SQL, database, result and latency for every call.
Good for
- Ask Claude for last month's orders from a connected database
- Debug a failing query by pasting its error
- Convert a query from MySQL to Snowflake
- Explain an unfamiliar query line by line
- Let agents query customer data with personal fields masked
Pricing
Freemium, from $9 a month
Free tier of 5 SQL requests a day; Start $9/mo, Pro $19/mo, Team $39/mo with 7-day trial; Lifetime $29 once; demo_shop queries on every plan
Prices change. Check ai2sql.io before you buy.
AI2SQL FAQ
Is it safe to point at a production database?
Queries are read-only: only one SELECT or WITH statement runs, and writes, DDL and batches are rejected server-side.
How do I sign in?
With your AI2SQL account via OAuth 2.1; there is no API key to paste.
Which clients work?
Claude, ChatGPT, Cursor, VS Code with Copilot and any client supporting Streamable HTTP with OAuth.
What does it cost?
The pricing page lists Start at $9, Pro at $19 and Team at $39 a month with a 7-day trial; running queries on your own databases needs Pro or Team.
Is AI2SQL free?
AI2SQL has a free plan, with paid plans for more usage or features. Paid plans start at $9 a month.
How do I add AI2SQL to Claude Code?
Run this command in your terminal: claude mcp add --transport http ai2sql https://builder.ai2sql.io/api/chatgpt-mcp
What are the best alternatives to AI2SQL?
The closest alternatives to AI2SQL are Midplane, PlatypusDB, Lorebase, Sovaria and model2data studio.
Alternatives to AI2SQL

Midplane
MCP serverPostgres gateway for AI agents with table grants, column masking and approval for writes
Runs locally- Open source
- 5 GitHub stars
- Databases

PlatypusDB
MCP serverGives MCP clients access to your PlatypusDB database connections, scoped per agent
Runs locally- Open source
- Databases

Lorebase
MCP serverLets agents read and change a governed, versioned Postgres knowledge graph
Runs locally- Open source
- Knowledge and memory
Sovaria
MCP serverManage a Sovaria backend (Postgres, auth, storage, functions) from an AI assistant
Not checked yet- 4 tools
- Remote
- Freemium
- Databases

model2data studio
MCP serverGenerate realistic connected test data, dbt projects and dashboards from a schema
- Remote
- Freemium
- Databases

semlayer
MCP serverInfers a semantic layer from your data warehouse and serves it to agents
Runs locally- Free
- Databases