# AI for Database
> AI for Database is a hosted workspace that connects to operational databases and other data sources and answers questions about them in plain English. Its hosted MCP connector at https://mcp.aifordatabase.com/mcp links an AI assistant to your AI for Database workspace through OAuth sign-in, using that workspace's connections, permissions and credits.

The 10 tools list your connections, show a connection's tables, columns and relationships, and run SQL inside a read-only transaction, where writes are rejected by the database. ask_database answers a plain-English question with the answer, the SQL it used and the rows, and uses AI credits. The assistant can also list dashboards and alert workflows, create a workflow (a SQL check that sends email or webhook alerts when it returns rows), run a workflow now, show this billing period's AI credit budget and usage, and send feedback to the AI for Database team.

Tools that can send email or webhook alerts are labelled as such to the client, and in Claude each can be set to Needs approval. The connector cannot change billing, team members or connection credentials. You need an account with at least one connection; new accounts can add the built-in sample database. Documented sources include PostgreSQL, MySQL, MariaDB, SQL Server, MongoDB, SQLite, BigQuery, Snowflake, Google Sheets, Mixpanel, Amplitude, Stripe, Salesforce and Sentry. AI usage needs credits from a Basic plan ($20 per user per month, paid as credits) or a Team plan ($50 per user per month, unlimited AI).
Canonical: https://www.mcpfolio.com/servers/ai-for-database
## Catalog record

- Publisher: AI for Database
- Categories: database, productivity, development

## Website

https://www.aifordatabase.com/?utm_source=mcpfolio.com&utm_medium=referral&utm_campaign=mcp_listing_md&utm_content=ai-for-database&ref=mcpfolio.com

## Transports

streamable-http

## Authentication

OAuth sign-in with your AI for Database account (scope aifordatabase), with PKCE (S256) and dynamic client registration. Database passwords and keys are entered in AI for Database's own connection form, never in the chat.

## Tools

### list_connections

List your database connections. Read only.

Input schema is not included in the available catalog record.

### get_schema

Show a connection's tables, columns and relationships. Read only.

Input schema is not included in the available catalog record.

### run_query

Run SQL inside a read-only transaction. Writes are rejected by the database.

Input schema is not included in the available catalog record.

### ask_database

Ask a question in plain English; get the answer, the SQL and the rows. Uses AI credits.

Input schema is not included in the available catalog record.

### list_dashboards

List your dashboards. Read only.

Input schema is not included in the available catalog record.

### list_workflows

List alert workflows and their triggers. Read only.

Input schema is not included in the available catalog record.

### create_workflow

Create a SQL check that sends email or webhook alerts. Can send alerts.

Input schema is not included in the available catalog record.

### run_workflow

Run a workflow now; its alerts fire if the check returns rows. Can send alerts.

Input schema is not included in the available catalog record.

### request_feature

Send a feature request or feedback to the AI for Database team, with your account details so they can follow up.

Input schema is not included in the available catalog record.

### get_usage

Show this billing period's AI credit budget and usage. Read only.

Input schema is not included in the available catalog record.

## Sources

- [official](https://www.aifordatabase.com/ai-connector/)
- [official](https://www.aifordatabase.com/ai-connector.md)
- [official](https://mcp.aifordatabase.com/)
- [official](https://www.aifordatabase.com/pricing)
- [official](https://www.aifordatabase.com/for-agents/)

## Client setup instructions

### Cursor

Status: ready to configure.

Configuration:

```json
{
  "mcpServers": {
    "ai-for-database": {
      "url": "https://mcp.aifordatabase.com/mcp"
    }
  }
}
```

Prerequisites:

- An AI for Database account with at least one connection; new accounts can add the built-in sample database (https://www.aifordatabase.com)
- AI credits from a Basic plan or top-up, or a Team plan with unlimited AI usage, for ask_database
- An MCP client that supports remote servers with OAuth (Claude, ChatGPT developer mode, Grok, Muse)

Authentication:

- If OAuth is required, connect through Cursor's MCP tools settings and finish the browser sign-in yourself. For credential-based servers, store credentials in a local environment variable or the client's supported secret facility; do not paste secrets into chat.

Setup steps:

- Claude: open the AI for Database listing in the Claude directory (claude.ai/directory/ai-for-database), or search for it under Settings → Connectors
- Click Connect, sign in to AI for Database, review the access and click Allow
- ChatGPT: open Settings → Security and login and turn on Developer mode, then at chatgpt.com/plugins click Create MCP app and enter https://mcp.aifordatabase.com/mcp
- Grok: go to grok.com/connectors, click New Connector, then Custom, enter https://mcp.aifordatabase.com/mcp and sign in
- Muse by Meta: open Connectors, search for AI for Database, click Connect and sign in
- Optional: in Claude, set create_workflow and run_workflow to Needs approval under Settings → Connectors → AI for Database
- Ask: Which database connections do I have in AI for Database?

Reload:

- Open Cursor Settings → Tools & MCP; restart or reconnect the server if Cursor does not pick up the saved project configuration.

Verify the connection:

- Open Cursor Settings → Tools & MCP and confirm the server is enabled with its tools listed. Ask for a harmless read-only operation only after authentication.

Official client guide: [Cursor](https://www.aifordatabase.com/ai-connector/)

### VS Code

Status: ready to configure.

Configuration:

```json
{
  "mcpServers": {
    "ai-for-database": {
      "type": "http",
      "url": "https://mcp.aifordatabase.com/mcp"
    }
  }
}
```

Prerequisites:

- An AI for Database account with at least one connection; new accounts can add the built-in sample database (https://www.aifordatabase.com)
- AI credits from a Basic plan or top-up, or a Team plan with unlimited AI usage, for ask_database
- An MCP client that supports remote servers with OAuth (Claude, ChatGPT developer mode, Grok, Muse)

Authentication:

- For OAuth, use VS Code's MCP server controls and complete the browser sign-in yourself. For credential-based servers, use a supported local environment variable/input mechanism; never write a real secret into a tracked workspace file.

Setup steps:

- Claude: open the AI for Database listing in the Claude directory (claude.ai/directory/ai-for-database), or search for it under Settings → Connectors
- Click Connect, sign in to AI for Database, review the access and click Allow
- ChatGPT: open Settings → Security and login and turn on Developer mode, then at chatgpt.com/plugins click Create MCP app and enter https://mcp.aifordatabase.com/mcp
- Grok: go to grok.com/connectors, click New Connector, then Custom, enter https://mcp.aifordatabase.com/mcp and sign in
- Muse by Meta: open Connectors, search for AI for Database, click Connect and sign in
- Optional: in Claude, set create_workflow and run_workflow to Needs approval under Settings → Connectors → AI for Database
- Ask: Which database connections do I have in AI for Database?

Reload:

- Run `MCP: List Servers` from the Command Palette and use its Start/Restart action, or reload the VS Code window if needed.

Verify the connection:

- Run `MCP: List Servers`; confirm the server is running and its tools appear in Copilot Chat's Agent mode.

Official client guide: [VS Code](https://www.aifordatabase.com/ai-connector/)

### Claude Desktop

Status: ready to configure.

Configuration:

```json
Remote connector URL: https://mcp.aifordatabase.com/mcp
Add it in Claude Desktop → Settings → Connectors → Add custom connector.
```

Prerequisites:

- An AI for Database account with at least one connection; new accounts can add the built-in sample database (https://www.aifordatabase.com)
- AI credits from a Basic plan or top-up, or a Team plan with unlimited AI usage, for ask_database
- An MCP client that supports remote servers with OAuth (Claude, ChatGPT developer mode, Grok, Muse)

Authentication:

- Remote connector: review Claude's detected authentication and complete OAuth in its browser flow, or enter a required API credential in the connector's request-header UI. Local extensions may request settings in Claude Desktop; enter secrets only into its secure settings UI.

Setup steps:

- Claude: open the AI for Database listing in the Claude directory (claude.ai/directory/ai-for-database), or search for it under Settings → Connectors
- Click Connect, sign in to AI for Database, review the access and click Allow
- ChatGPT: open Settings → Security and login and turn on Developer mode, then at chatgpt.com/plugins click Create MCP app and enter https://mcp.aifordatabase.com/mcp
- Grok: go to grok.com/connectors, click New Connector, then Custom, enter https://mcp.aifordatabase.com/mcp and sign in
- Muse by Meta: open Connectors, search for AI for Database, click Connect and sign in
- Optional: in Claude, set create_workflow and run_workflow to Needs approval under Settings → Connectors → AI for Database
- Ask: Which database connections do I have in AI for Database?

Reload:

- For a remote connector, enable it from Claude's Connectors UI. After editing `claude_desktop_config.json` or installing a local extension, fully quit and reopen Claude Desktop; the config is read only at launch.

Verify the connection:

- Open the Connectors/tools picker and confirm the server and its tools are available. Check Settings → Developer for local server status and logs for startup failures.

Official client guide: [Claude Desktop](https://www.aifordatabase.com/ai-connector/)

### Claude Code

Status: ready to configure.

Configuration:

```text
claude mcp add --transport http ai-for-database --scope project "https://mcp.aifordatabase.com/mcp"
```

Prerequisites:

- An AI for Database account with at least one connection; new accounts can add the built-in sample database (https://www.aifordatabase.com)
- AI credits from a Basic plan or top-up, or a Team plan with unlimited AI usage, for ask_database
- An MCP client that supports remote servers with OAuth (Claude, ChatGPT developer mode, Grok, Muse)

Authentication:

- For OAuth, run 'claude /mcp' in a regular terminal and authenticate ai-for-database if prompted. Complete the browser sign-in yourself; do not paste credentials into chat.

Setup steps:

- Claude: open the AI for Database listing in the Claude directory (claude.ai/directory/ai-for-database), or search for it under Settings → Connectors
- Click Connect, sign in to AI for Database, review the access and click Allow
- ChatGPT: open Settings → Security and login and turn on Developer mode, then at chatgpt.com/plugins click Create MCP app and enter https://mcp.aifordatabase.com/mcp
- Grok: go to grok.com/connectors, click New Connector, then Custom, enter https://mcp.aifordatabase.com/mcp and sign in
- Muse by Meta: open Connectors, search for AI for Database, click Connect and sign in
- Optional: in Claude, set create_workflow and run_workflow to Needs approval under Settings → Connectors → AI for Database
- Ask: Which database connections do I have in AI for Database?

Reload:

- Start or restart the Claude Code session in the project if it was already open. Review and approve a new project-scoped server when Claude Code asks.

Verify the connection:

- Run 'claude mcp get ai-for-database' or 'claude mcp list'; in an interactive session, use '/mcp'. Confirm the status is connected and tools are listed. A configured entry alone is not proof of connection.

Official client guide: [Claude Code](https://www.aifordatabase.com/ai-connector/)

### Gemini CLI

Status: ready to configure.

Configuration:

```text
gemini mcp add --transport http ai-for-database "https://mcp.aifordatabase.com/mcp"
```

Prerequisites:

- An AI for Database account with at least one connection; new accounts can add the built-in sample database (https://www.aifordatabase.com)
- AI credits from a Basic plan or top-up, or a Team plan with unlimited AI usage, for ask_database
- An MCP client that supports remote servers with OAuth (Claude, ChatGPT developer mode, Grok, Muse)

Authentication:

- For OAuth, run '/mcp auth ai-for-database' inside Gemini CLI and complete the browser flow yourself.

Setup steps:

- Claude: open the AI for Database listing in the Claude directory (claude.ai/directory/ai-for-database), or search for it under Settings → Connectors
- Click Connect, sign in to AI for Database, review the access and click Allow
- ChatGPT: open Settings → Security and login and turn on Developer mode, then at chatgpt.com/plugins click Create MCP app and enter https://mcp.aifordatabase.com/mcp
- Grok: go to grok.com/connectors, click New Connector, then Custom, enter https://mcp.aifordatabase.com/mcp and sign in
- Muse by Meta: open Connectors, search for AI for Database, click Connect and sign in
- Optional: in Claude, set create_workflow and run_workflow to Needs approval under Settings → Connectors → AI for Database
- Ask: Which database connections do I have in AI for Database?

Reload:

- Gemini CLI reads its settings on startup. Restart the CLI after direct file edits; its `mcp add` command writes the configuration.

Verify the connection:

- Run 'gemini mcp list' and confirm ai-for-database reports Connected. For local stdio servers, trust the current folder if Gemini CLI requires it.

Official client guide: [Gemini CLI](https://www.aifordatabase.com/ai-connector/)

### Codex CLI

Status: ready to configure.

Configuration:

```text
codex mcp add ai-for-database --url "https://mcp.aifordatabase.com/mcp"
```

Prerequisites:

- An AI for Database account with at least one connection; new accounts can add the built-in sample database (https://www.aifordatabase.com)
- AI credits from a Basic plan or top-up, or a Team plan with unlimited AI usage, for ask_database
- An MCP client that supports remote servers with OAuth (Claude, ChatGPT developer mode, Grok, Muse)

Authentication:

- For OAuth, run 'codex mcp login ai-for-database' and complete the browser flow yourself. Do not paste credentials into chat.

Setup steps:

- Claude: open the AI for Database listing in the Claude directory (claude.ai/directory/ai-for-database), or search for it under Settings → Connectors
- Click Connect, sign in to AI for Database, review the access and click Allow
- ChatGPT: open Settings → Security and login and turn on Developer mode, then at chatgpt.com/plugins click Create MCP app and enter https://mcp.aifordatabase.com/mcp
- Grok: go to grok.com/connectors, click New Connector, then Custom, enter https://mcp.aifordatabase.com/mcp and sign in
- Muse by Meta: open Connectors, search for AI for Database, click Connect and sign in
- Optional: in Claude, set create_workflow and run_workflow to Needs approval under Settings → Connectors → AI for Database
- Ask: Which database connections do I have in AI for Database?

Reload:

- Restart an already-open Codex session or IDE extension if the server does not appear; the IDE extension offers a Restart action.

Verify the connection:

- Run 'codex mcp list' or '/mcp' in the Codex TUI. Confirm the server is enabled/connected and its tools are available.

Official client guide: [Codex CLI](https://www.aifordatabase.com/ai-connector/)

### Windsurf

Status: ready to configure.

Configuration:

```json
{
  "mcpServers": {
    "ai-for-database": {
      "serverUrl": "https://mcp.aifordatabase.com/mcp"
    }
  }
}
```

Prerequisites:

- An AI for Database account with at least one connection; new accounts can add the built-in sample database (https://www.aifordatabase.com)
- AI credits from a Basic plan or top-up, or a Team plan with unlimited AI usage, for ask_database
- An MCP client that supports remote servers with OAuth (Claude, ChatGPT developer mode, Grok, Muse)

Authentication:

- OAuth is supported for remote and stdio server transports; complete any browser sign-in from Cascade. For a fixed credential, store it using documented environment interpolation rather than a literal secret in JSON.

Setup steps:

- Claude: open the AI for Database listing in the Claude directory (claude.ai/directory/ai-for-database), or search for it under Settings → Connectors
- Click Connect, sign in to AI for Database, review the access and click Allow
- ChatGPT: open Settings → Security and login and turn on Developer mode, then at chatgpt.com/plugins click Create MCP app and enter https://mcp.aifordatabase.com/mcp
- Grok: go to grok.com/connectors, click New Connector, then Custom, enter https://mcp.aifordatabase.com/mcp and sign in
- Muse by Meta: open Connectors, search for AI for Database, click Connect and sign in
- Optional: in Claude, set create_workflow and run_workflow to Needs approval under Settings → Connectors → AI for Database
- Ask: Which database connections do I have in AI for Database?

Reload:

- Save `mcp_config.json`, then restart or reconnect the server from Cascade's MCP controls.

Verify the connection:

- Open Cascade's MCP panel and confirm the server is enabled and lists tools. Note: this documentation applies to legacy Cascade; newer Devin Local setup may differ.

Official client guide: [Windsurf](https://www.aifordatabase.com/ai-connector/)

### ChatGPT

Status: ready to configure.

Configuration:

```json
Remote MCP endpoint: https://mcp.aifordatabase.com/mcp
Add it in ChatGPT web → Settings/Workspace Settings → Apps → Create.
```

Prerequisites:

- An AI for Database account with at least one connection; new accounts can add the built-in sample database (https://www.aifordatabase.com)
- AI credits from a Basic plan or top-up, or a Team plan with unlimited AI usage, for ask_database
- An MCP client that supports remote servers with OAuth (Claude, ChatGPT developer mode, Grok, Muse)

Authentication:

- If OAuth is configured, complete the authorization prompt while ChatGPT scans tools. Workspace admin/developer permissions may be required. Do not paste credentials into chat.

Setup steps:

- Claude: open the AI for Database listing in the Claude directory (claude.ai/directory/ai-for-database), or search for it under Settings → Connectors
- Click Connect, sign in to AI for Database, review the access and click Allow
- ChatGPT: open Settings → Security and login and turn on Developer mode, then at chatgpt.com/plugins click Create MCP app and enter https://mcp.aifordatabase.com/mcp
- Grok: go to grok.com/connectors, click New Connector, then Custom, enter https://mcp.aifordatabase.com/mcp and sign in
- Muse by Meta: open Connectors, search for AI for Database, click Connect and sign in
- Optional: in Claude, set create_workflow and run_workflow to Needs approval under Settings → Connectors → AI for Database
- Ask: Which database connections do I have in AI for Database?

Reload:

- Save/Create the app draft, then open a new chat and select the app from the tools menu. Admin approval or publishing may be required for workspace use.

Verify the connection:

- Confirm the app appears as a draft or enabled app, its tool scan completes, and the tools are available in a chat. ChatGPT web cannot connect directly to local stdio servers.

Official client guide: [ChatGPT](https://www.aifordatabase.com/ai-connector/)

### Manual

Status: ready to configure.

Configuration:

```json
{
  "mcpServers": {
    "ai-for-database": {
      "url": "https://mcp.aifordatabase.com/mcp"
    }
  }
}
```

Prerequisites:

- An AI for Database account with at least one connection; new accounts can add the built-in sample database (https://www.aifordatabase.com)
- AI credits from a Basic plan or top-up, or a Team plan with unlimited AI usage, for ask_database
- An MCP client that supports remote servers with OAuth (Claude, ChatGPT developer mode, Grok, Muse)

Authentication:

- Follow the selected client's official OAuth flow or store a required credential in its local secret/environment mechanism. Never paste secrets into chat or commit them.

Setup steps:

- Claude: open the AI for Database listing in the Claude directory (claude.ai/directory/ai-for-database), or search for it under Settings → Connectors
- Click Connect, sign in to AI for Database, review the access and click Allow
- ChatGPT: open Settings → Security and login and turn on Developer mode, then at chatgpt.com/plugins click Create MCP app and enter https://mcp.aifordatabase.com/mcp
- Grok: go to grok.com/connectors, click New Connector, then Custom, enter https://mcp.aifordatabase.com/mcp and sign in
- Muse by Meta: open Connectors, search for AI for Database, click Connect and sign in
- Optional: in Claude, set create_workflow and run_workflow to Needs approval under Settings → Connectors → AI for Database
- Ask: Which database connections do I have in AI for Database?

Reload:

- Restart/reload the selected client only if its documentation requires it.

Verify the connection:

- Use the selected client's MCP status view and verify the server exposes tools; do not report connected based only on a saved config.

Official client guide: [Manual](https://www.aifordatabase.com/ai-connector/)