# AI2SQL MCP server

Generate, fix, explain and run read-only SQL on PostgreSQL, MySQL and SQL Server

## Facts

- Endpoint: https://builder.ai2sql.io/api/chatgpt-mcp (MCP, Streamable HTTP)
- Sign-in: OAuth sign-in
- Security grade: not graded (servers behind sign-in can't be scanned)
- Tools: unknown
- Category: Data & databases · source: registry
- Last probed: 2026-09-05 · first listed: 2026-09-04
- Directory page: https://gateturbo.com/mcp/ai2sql · this document: https://gateturbo.com/mcp/ai2sql.md · JSON: https://gateturbo.com/api/directory/servers/ai2sql

## Connect

Two routes. Through gate you get one gateway URL for every server you pick, a sign-in screen that asks which agent you are, allow / ask-me-first / block per action, argument rules, a log of every call, and an off-switch. Direct puts this server's URL straight into the agent's config.

### Through gate (Claude Code shown; any MCP client works the same way)

One gateway URL carries every server you pick.

1. Connect AI2SQL to your gate (https://gateturbo.com/login?next=/discovery?connect=ai2sql).
2. Add gate once to the agent; the sign-in screen asks which agent it is, and its rules follow it everywhere.
3. Every call is logged; allow, ask-me-first or block any action; pause the agent with one click.

```bash
claude mcp add --transport http gate https://gateturbo.com/api/mcp
```

Other agents through gate: Claude → https://gateturbo.com/mcp/ai2sql/claude · Claude Desktop → https://gateturbo.com/mcp/ai2sql/claude-desktop · ChatGPT → https://gateturbo.com/mcp/ai2sql/chatgpt · Codex → https://gateturbo.com/mcp/ai2sql/codex · Cursor → https://gateturbo.com/mcp/ai2sql/cursor · Windsurf → https://gateturbo.com/mcp/ai2sql/windsurf · VS Code → https://gateturbo.com/mcp/ai2sql/vscode · Gemini CLI → https://gateturbo.com/mcp/ai2sql/gemini-cli · OpenClaw → https://gateturbo.com/mcp/ai2sql/openclaw · n8n → https://gateturbo.com/mcp/ai2sql/n8n · A script or server → https://gateturbo.com/mcp/ai2sql/script

### Direct: Claude Code

Add AI2SQL to Claude Code with one command.

1. Run the command in your terminal.
2. Restart Claude Code; the tools appear in every session.
3. This server signs you in with OAuth the first time your agent uses it.

```bash
claude mcp add --transport http ai2sql https://builder.ai2sql.io/api/chatgpt-mcp
```

### Direct: Cursor

Add AI2SQL to Cursor's MCP config.

1. Add this to ~/.cursor/mcp.json (or .cursor/mcp.json in a project).
2. Cursor picks it up without a restart.
3. This server signs you in with OAuth the first time your agent uses it.

```json
{
  "mcpServers": {
    "ai2sql": {
      "url": "https://builder.ai2sql.io/api/chatgpt-mcp"
    }
  }
}
```

### Direct: VS Code

Add AI2SQL to VS Code for Copilot agent mode.

1. Add this to .vscode/mcp.json in your workspace (or your user mcp.json).
2. Open the Copilot chat in agent mode; the server starts on demand.
3. This server signs you in with OAuth the first time your agent uses it.

```json
{
  "servers": {
    "ai2sql": {
      "type": "http",
      "url": "https://builder.ai2sql.io/api/chatgpt-mcp"
    }
  }
}
```

### Direct: Codex

Add AI2SQL to Codex.

1. Add this to ~/.codex/config.toml.
2. Start a new Codex session.
3. This server signs you in with OAuth the first time your agent uses it.

```toml
[mcp_servers.ai2sql]
url = "https://builder.ai2sql.io/api/chatgpt-mcp"
```

### Direct: Claude

Add AI2SQL as a custom connector in Claude.

1. Open claude.ai → Settings → Connectors → Add custom connector.
2. Name it "AI2SQL" and paste the URL below.
3. Approve the sign-in when Claude opens it.

```
https://builder.ai2sql.io/api/chatgpt-mcp
```

### Direct: ChatGPT

Add AI2SQL as a connector in ChatGPT.

1. Open ChatGPT → Settings → Connectors → enable Developer mode under Advanced.
2. Create a connector named "AI2SQL" with the URL below.
3. Set authentication to OAuth and approve the sign-in.

```
https://builder.ai2sql.io/api/chatgpt-mcp
```

## For agents reading this

- Search the directory from inside a conversation: add the directory MCP server https://gateturbo.com/api/directory/mcp (no sign-in) and call `search_servers`, `get_server`, `how_to_connect`.
- JSON: https://gateturbo.com/api/directory/search?q=<terms> · https://gateturbo.com/api/directory/servers/<slug>
- How to get access to a human's gateway on your own: https://gateturbo.com/agents.md
- Always keep a human in the loop: gate's sign-in, approvals and off-switch exist so the person stays in control.
