AI2SQL generates, explains, fixes and optimizes SQL on your own schema and works with Claude, ChatGPT and Cursor via MCP. Plans start at $9/month.
Researched and fact-checked by Bartu Cavusoglu · Updated October 26, 2026
AI2SQL is an AI SQL assistant that turns plain-English requests into SQL written against the tables and columns of a database you connect. It can also explain, fix, optimize and format queries, and run them read-only so the rows appear on the page. The site describes it as a text-to-SQL tool built around your real schema rather than a generic example.
Beyond the web app, AI2SQL offers an MCP server for Claude, ChatGPT and Cursor, a REST API, a desktop app and a gateway for team AI agents. The homepage lists engineers and analysts at companies including Nutanix, Gusto, Ocado, CGI, TELUS, Prime Therapeutics and Montefiore as users.
Setup has three steps. First, connect a database such as Postgres, MySQL, SQL Server, Snowflake, BigQuery, MongoDB or Oracle using read-only credentials, which are encrypted at rest. Second, AI2SQL builds a semantic layer from the schema, covering tables, joins and business terms, so the generated SQL reflects your own data.
Third, you or your agent asks a question. An agent calls run_query over MCP or REST, governed read-only SQL runs, and the answer returns, audited and metered per query. A component called sqlGuard classifies each statement and blocks INSERT, UPDATE, DELETE, DROP and other DDL, multi-statement input and functions that read server files.
The workflow has six parts. Generate turns a description into SQL in the dialect of the chosen database. Explain walks through a query clause by clause. Optimize returns a rewrite with reasoning, such as a join that should be a filter or a missing index. Fix corrects syntax errors, dialect mismatches and wrong column names, and explains what broke.
Format cleans casing and indentation in one pass, and Run executes against a live read-only connection. Supported databases are PostgreSQL, MySQL, SQL Server, Oracle, Snowflake, BigQuery, Amazon Redshift, MongoDB, SQLite and Firebird. The Team plan adds a shared query library, role-based access control and data masking for AI agents.
AI2SQL is an AI SQL assistant that turns plain-English requests into SQL using the tables, columns and dialect of a database you connect. It can also explain, fix, optimize and format queries, and run them read-only to show rows.
Start is $9 per month, Pro is $19 and Team is $39. Billed annually they are $7, $14 and $29 per month. A Free plan offers 3 queries a day on a demo database, and a one-time Lifetime plan costs $29.
Yes. Every paid plan starts with a 7-day free trial and $0 is charged up front. A card is required to start, and you can cancel in one click from your account before the trial ends to avoid being charged.
Connections are read-only by default. The sqlGuard component classifies each statement and blocks INSERT, UPDATE, DELETE, DROP and other DDL, multi-statement input and functions that read server files. Credentials are encrypted, every query is logged and keys can be revoked.
It supports PostgreSQL, MySQL, SQL Server, Oracle, Snowflake, BigQuery, Amazon Redshift, MongoDB, SQLite and Firebird. The Start plan lists MySQL and PostgreSQL only, while Pro and Team cover all supported databases.
Yes. AI2SQL offers an MCP server that works with Claude, ChatGPT in developer mode, Cursor and VS Code. Every plan can write SQL through it, while Pro and Team can also run read-only queries on connected databases.
Yes. A desktop app for Windows and macOS is included in Pro and Team. It runs next to your database so credentials stay on your computer, and it can reach databases that only listen on localhost or an internal hostname.
For a single query on a schema you can paste into a chat, the company says it is not very different. The advantage is live-database features: knowing your tables, using the right dialect, running queries and returning rows, refusing writes and exposing the same to your own AI agent.