ai2sql-mcp
v1.0.6
Published
AI2SQL MCP Server - Generate, explain, optimize and fix SQL queries from natural language inside Claude Code
Downloads
763
Maintainers
Readme
AI2SQL MCP Server
Generate, explain, optimize, and fix SQL queries from natural language inside Claude Code.
Quick Start
Add to your Claude Code settings:
{
"mcpServers": {
"ai2sql": {
"command": "npx",
"args": ["-y", "ai2sql-mcp"]
}
}
}Tools
generate_sql
Convert natural language to SQL. Supports PostgreSQL, MySQL, SQL Server, Snowflake, Oracle, and SQLite.
> Generate a query to find the top 10 customers by revenue last monthexplain_sql
Get a plain English explanation of any SQL query.
optimize_sql
Analyze SQL for performance issues and get an optimized version.
fix_sql_error
Provide a broken query and error message, get a corrected version.
Pro Features
Set your AI2SQL API key for unlimited queries and schema support:
{
"mcpServers": {
"ai2sql": {
"command": "npx",
"args": ["-y", "ai2sql-mcp"],
"env": {
"AI2SQL_API_KEY": "your-api-key"
}
}
}
}How to get your API key
- Sign up at ai2sql.io
- Go to Dashboard > API Keys
- Click "Generate New Key"
- Copy the key and add it to your Claude Code settings above
Supported Databases
- PostgreSQL
- MySQL
- SQL Server
- Snowflake
- Oracle
- SQLite
License
MIT
