# Sequel Documentation

> The complete Sequel documentation, concatenated as Markdown for LLMs. Sequel is the data layer for your agents: it manages auth, credentials, and execution so AI tools can securely query your cloud databases, warehouses, and SaaS tools over MCP.

Source pages: https://sequel.sh/docs

---

# Getting Started

Connect the Sequel MCP server to your AI tool in a few minutes — the MCP URL, where to get an API key, the two auth types, and how OAuth works.

This guide gets the Sequel MCP server running inside your AI tool. By the end you'll have a connected data source and an agent answering questions against it.

<Steps>
<Step title="Create an account and connect a data source">
Sign up at [sequel.sh](https://sequel.sh) and create or join an organization. Then add a data source — a cloud Postgres or MySQL database, a warehouse like BigQuery, or a SaaS source like Stripe or Google Analytics. See [Connecting your first data source](/docs/connecting-your-first-data-source) for the full walkthrough. Everything you connect becomes available to the MCP server.
</Step>

<Step title="Install the Sequel CLI">
The CLI is the fastest way to wire Sequel into a coding agent — it creates the API key and writes the config for you. One line installs it:

<CodeBlock language="bash">curl -fsSL https://sequel.sh/install | sh</CodeBlock>

Then sign in:

<CodeBlock language="bash">sequel login</CodeBlock>
</Step>

<Step title="Install Sequel into your agent">
Run `install` and pick your agent — Claude Code, Cursor, VS Code, Windsurf, Zed, Codex, or Claude Desktop — or pass its slug directly:

```bash
sequel install          # interactive
sequel install cursor   # or target one directly
```

The CLI runs over the same hosted MCP endpoint every tool uses — `https://api.sequel.sh/mcp` — so you never touch the URL or key by hand. Prefer to configure a tool manually (or using ChatGPT, Claude.ai, or Gemini)? See [Install Sequel MCP](/docs/install) for copy-paste setup.
</Step>

<Step title="Ask your first question">
Restart the agent, then try “What tables do we have, and how many rows are in each?” Go deeper with [Chatting with your data](/docs/chatting-with-your-data).
</Step>
</Steps>

## Authentication: two ways to connect

Sequel supports **two authentication methods** for the MCP server. Pick whichever your tool supports best.

| Method | Best for | How it works |
| --- | --- | --- |
| **API key (Bearer token)** | CLIs and editors — Claude Code, Cursor, VS Code, Windsurf, Zed, Codex, Gemini | You paste a static key into an `Authorization: Bearer …` header in the tool's config. |
| **OAuth 2.0** | Connector-style clients — ChatGPT, Claude.ai | The tool registers itself and sends you through a sign-in + consent screen. No key to copy. |

### API key

Create a key in the Sequel dashboard under **Settings → API Keys**. Keys look like `sql_…` and are shown **once** at creation — copy it then. Add it as a Bearer token:

<CodeBlock language="http" label="Authorization header">Authorization: Bearer sql_your_api_key</CodeBlock>

<Callout type="tip">
When you install from the dashboard, Sequel auto-provisions a key named <code>sequel_mcp</code> and drops it straight into the snippet for you.
</Callout>

### OAuth

For clients that support it, OAuth avoids copying keys around. The flow is standard OAuth 2.0 with PKCE: the client registers itself automatically, you sign in on a Sequel consent screen, and Sequel issues a short-lived access token (refreshed automatically) scoped to your organization. Revoke access any time from the dashboard.

Either method only ever exposes the data sources your organization has connected — see [API keys & authentication](/docs/api-keys-and-auth) for the full details.

## Next step

Head to **[Install Sequel MCP](/docs/install)** for copy-paste setup instructions for every supported AI tool.

---

# Install Sequel MCP

Step-by-step instructions for installing the Sequel MCP server in Claude Code, Cursor, VS Code, ChatGPT, Codex, Windsurf, Zed, and Gemini.

Sequel exposes a single hosted MCP endpoint. Point any MCP-capable AI tool at it and authenticate with your API key:

<CodeBlock language="bash">https://api.sequel.sh/mcp</CodeBlock>

There are two ways to install it into your agent: the **Sequel CLI** (one command — it creates the API key and writes the config for you) or **manual setup** (copy-paste the config into each tool yourself).

## Fastest: the Sequel CLI

The CLI installs Sequel into a coding agent in a single step. It signs you in, provisions a scoped API key for that agent, and writes the right config to the right place — no keys to copy by hand.

<Steps>
<Step title="Install the CLI">
One line installs the latest CLI (`@sequelsh/cli`) with whatever package manager you have:

<CodeBlock language="bash">curl -fsSL https://sequel.sh/install | sh</CodeBlock>

Prefer npm directly? `npm install -g @sequelsh/cli@latest` works too (or `pnpm add -g`, `bun add -g`, `yarn global add`).
</Step>

<Step title="Sign in">
<CodeBlock language="bash">sequel login</CodeBlock>

This opens your browser to authenticate and pick an organization.
</Step>

<Step title="Install Sequel into your agent">
Run `install` and pick an agent from the list, or pass its slug directly:

<CodeBlock language="bash">sequel install</CodeBlock>

The CLI creates an API key named after the agent, then writes its MCP config. For agents that support it, you'll also be asked for a **scope** — `global` (available everywhere on this machine) or `local` (this project only).

| Agent | Slug | Scopes |
| --- | --- | --- |
| Claude Code | `claude-code` | global, local |
| Claude Desktop | `claude` | global |
| Cursor | `cursor` | global, local |
| VS Code | `vscode` | global, local |
| Windsurf | `windsurf` | global |
| Zed | `zed` | global, local |
| Codex | `codex` | global |
| OpenClaw | `openclaw` | global |
| Hermes | `hermes` | global |
</Step>

<Step title="Verify">
Restart the agent and ask it to **"list my Sequel connections."** If it answers, you're connected.
</Step>
</Steps>

<Callout type="tip">
Already have the CLI? `sequel install claude-code` (or any slug above) re-runs setup for that agent at any time.
</Callout>

## Manual setup

Prefer to wire it up yourself — or using ChatGPT, Claude.ai, or Gemini? Generate a key under **Settings → API Keys** in your Sequel dashboard and drop it into the `Authorization` header shown in each snippet below. Some tools — like ChatGPT and Claude.ai — can also sign in with **OAuth** instead of a static key; see [API keys & authentication](/docs/api-keys-and-auth) for the difference.

Expand a tool for its exact setup. Replace `sql_your_api_key` with a real key from your dashboard.

<McpInstallList />

<Callout type="info" title="Using a tool that isn't listed?">
Any client that supports the [Model Context Protocol](https://modelcontextprotocol.io) over streamable HTTP can connect using the URL and `Authorization` header above.
</Callout>

---

# Connecting your first data source

Add a cloud database, warehouse, or SaaS source to Sequel — credentials, testing the connection, and what happens once it's live.

A **data source** is any database, warehouse, or SaaS API you connect to Sequel. Once connected, it's available to the in-app chat and to every AI tool you've authorized through the [MCP server](/docs/install). This guide walks through adding your first one.

<Callout type="info" title="Cloud-hosted sources">
Sequel connects to cloud-hosted data sources — managed Postgres/MySQL (RDS, Supabase, Neon, PlanetScale), warehouses like BigQuery and ClickHouse, and SaaS APIs like Stripe and Google Analytics. Make sure your source is reachable from the internet (or via the access method its guide describes).
</Callout>

## Add a connection

<Steps>
<Step title="Open Connections">
In the Sequel dashboard, go to **Connections** and click **New connection**.
</Step>

<Step title="Pick a source type">
Choose the source you want to connect — for example PostgreSQL, BigQuery, or Google Analytics. Each type asks for the credentials it needs.
</Step>

<Step title="Enter credentials">
Depending on the source, this is a connection string, a host/port/user/password, a service-account key, or an OAuth sign-in. The per-integration guides under [Integrations](/docs/integrations) cover exactly what each source needs.
</Step>

<Step title="Test and save">
Sequel verifies the credentials before saving. A green check means the connection is live and ready to query. If the test fails, double-check network access and credentials.
</Step>
</Steps>

<Callout type="tip" title="Database behind a firewall?">
Sequel reaches your database from a fixed set of IP addresses. If your database sits behind a firewall, security group, or IP allowlist, add Sequel's egress IPs so the connection test can get through. The exact IPs are shown on the connection screen for database sources — copy them into your provider's networking settings (RDS security groups, Supabase/Neon network restrictions, Cloud SQL authorized networks, ClickHouse Cloud IP access list, and the like). SaaS sources that connect over OAuth or an API key don't need this.
</Callout>

## What happens after you connect

- **Schema discovery.** Sequel reads your tables, columns, and relationships so agents can navigate the source without you spelling everything out.
- **Available over MCP.** The source immediately becomes queryable from any AI tool connected to your organization's MCP server.
- **Scoped access.** Connections belong to your organization. API keys and OAuth sessions only ever see the sources your org has connected.

## Connecting more sources

Repeat the flow for every source you want Sequel to reach. Because Sequel can join across connections, adding a second and third source is where it gets powerful — see [Chatting with your data](/docs/chatting-with-your-data) for cross-source examples.

## Next steps

- [Chatting with your data](/docs/chatting-with-your-data)
- [Browse all integrations](/docs/integrations)
- [API keys & authentication](/docs/api-keys-and-auth)

---

# Analyzing data with AI

How to ask good questions, join across sources, and use the Python workbench — whether you're in the Sequel app or an MCP client like Claude or Cursor.

Once a source is connected, you can ask questions in plain English — from the Sequel app or from any AI tool wired up to the [MCP server](/docs/install). This page covers what the agent can do and how to get the most out of it.

## What the agent can do

Behind the scenes, Sequel exposes a small set of tools that the AI agent calls to answer your question:

| Capability | What it's for |
| --- | --- |
| **Discover connections** | List the data sources available to you. |
| **Search schemas** | Find the right tables and columns and plan a query. |
| **Run queries** | Execute read queries and return sample results. |
| **Python workbench** | Run Python (pandas, matplotlib, and more) in an isolated sandbox for analysis and charts. |
| **Download files** | Export results — CSVs, charts — produced in the workbench. |

You don't call these directly. You ask a question; the agent chains the tools to answer it.

## Ask better questions

- **Be specific about the metric and window.** "Weekly active users for the last 90 days" beats "how are we doing."
- **Name the source when it's ambiguous.** "In our Postgres `orders` table…" removes guesswork.
- **Ask for the format you want.** "Return a table" or "plot it as a line chart."

<Callout type="tip">
Start broad to orient the agent ("what tables relate to subscriptions?"), then drill in. The agent keeps context across the conversation.
</Callout>

## Join across sources

This is where Sequel shines. Because every connection is available in one place, a single question can span systems:

> "Compare 90-day retention for users acquired through paid vs organic channels, using signups from Postgres and acquisition source from Google Analytics."

The agent searches both schemas, runs the queries it needs, and combines the results — no manual exports or copy-paste between tools.

## Run real analysis with the workbench

When SQL isn't enough, the agent can run Python in a sandbox:

> "Pull last quarter's order values and plot a histogram with the median marked."

The workbench has common data libraries available and runs in isolation. Generated files (charts, CSVs) can be downloaded directly from the conversation.

## Same data, every tool

The connections you set up power every surface equally — the Sequel app, Claude, Cursor, ChatGPT, and any other MCP client. Set a source up once and ask about it from wherever you work.

## Next steps

- [Install Sequel MCP in your tool](/docs/install)
- [API keys & authentication](/docs/api-keys-and-auth)
- [Browse all integrations](/docs/integrations)

---

# Building with Sequel

Use the Sequel MCP server inside your own agents — examples for the Vercel AI SDK, the Claude Agent SDK, and the OpenAI Agents SDK.

Sequel isn't only for off-the-shelf tools like Claude or Cursor — you can point your own agents at the same hosted MCP server and give them secure, schema-aware access to your data. Every framework that speaks [Model Context Protocol](https://modelcontextprotocol.io) connects the same way: the streamable HTTP endpoint `https://api.sequel.sh/mcp`, authenticated with a Bearer API key.

<Callout type="tip" title="Grab an API key first">
Create a key under **Settings → API Keys** in the dashboard and pass it as `Authorization: Bearer sql_…`. See [API keys & authentication](/docs/api-keys-and-auth) for details.
</Callout>

## Vercel AI SDK

Create an MCP client over the streamable HTTP transport, then hand its tools to `generateText`.

```ts
import { experimental_createMCPClient, generateText, stepCountIs } from "ai";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
import { anthropic } from "@ai-sdk/anthropic";

const mcp = await experimental_createMCPClient({
  transport: new StreamableHTTPClientTransport(new URL("https://api.sequel.sh/mcp"), {
    requestInit: {
      headers: { Authorization: "Bearer " + process.env.SEQUEL_API_KEY },
    },
  }),
});

const { text } = await generateText({
  model: anthropic("claude-opus-4-8"),
  tools: await mcp.tools(),
  stopWhen: stepCountIs(10),
  prompt: "How many users signed up last week?",
});

console.log(text);
```

## Claude Agent SDK

Register Sequel as an `http` MCP server in the `query` options — the agent discovers and calls the tools on its own.

```ts
import { query } from "@anthropic-ai/claude-agent-sdk";

const response = query({
  prompt: "How many users signed up last week?",
  options: {
    mcpServers: {
      sequel: {
        type: "http",
        url: "https://api.sequel.sh/mcp",
        headers: { Authorization: "Bearer " + process.env.SEQUEL_API_KEY },
      },
    },
  },
});

for await (const message of response) {
  if (message.type === "result") console.log(message.result);
}
```

## OpenAI Agents SDK

Wrap the endpoint in an `MCPServerStreamableHttp` and attach it to your agent's `mcpServers`.

```ts
import { Agent, run, MCPServerStreamableHttp } from "@openai/agents";

const sequel = new MCPServerStreamableHttp({
  name: "Sequel",
  url: "https://api.sequel.sh/mcp",
  requestInit: {
    headers: { Authorization: "Bearer " + process.env.SEQUEL_API_KEY },
  },
});

const agent = new Agent({
  name: "Data analyst",
  instructions: "Answer questions using the connected data sources.",
  mcpServers: [sequel],
});

await sequel.connect();
const result = await run(agent, "How many users signed up last week?");
console.log(result.finalOutput);
await sequel.close();
```

## Next steps

- [Install Sequel MCP in your tool](/docs/install)
- [API keys & authentication](/docs/api-keys-and-auth)
- [Browse all integrations](/docs/integrations)

---

# API keys & authentication

The two ways to authenticate with the Sequel MCP server — static API keys and OAuth 2.0 — plus how to create, scope, and revoke access.

The Sequel MCP server supports **two authentication methods**. Both authorize a client to query the data sources your organization has connected — nothing more. This page explains when to use each and how to manage access.

## At a glance

| | API key | OAuth 2.0 |
| --- | --- | --- |
| **Best for** | CLIs & editors (Claude Code, Cursor, VS Code, Windsurf, Zed, Codex, Gemini) | Connector-style clients (ChatGPT, Claude.ai) |
| **Setup** | Paste a key into the tool's config | Sign in on a consent screen |
| **Credential** | Static `sql_…` Bearer token | Short-lived access token, auto-refreshed |
| **Revoke** | Delete the key | Revoke the authorization |

## API keys

API keys are static Bearer tokens you generate once and paste into a tool's MCP config.

<Steps>
<Step title="Create a key">
Go to **Settings → API Keys** in the Sequel dashboard and create a new key. Give it a descriptive name (e.g. the tool or person it's for).
</Step>

<Step title="Copy it immediately">
The full key is shown **once**, at creation. Copy it then — afterward only a short prefix is visible for identification.
</Step>

<Step title="Use it as a Bearer token">
Add it to your tool's MCP config:

<CodeBlock language="http" label="Authorization header">Authorization: Bearer sql_your_api_key</CodeBlock>
</Step>
</Steps>

<Callout type="tip" title="The sequel_mcp key">
When you install Sequel from the dashboard's install dialog, it auto-provisions a key named <code>sequel_mcp</code> and inserts it into the config snippet for you — so you usually don't have to create one by hand.
</Callout>

<Callout type="warning" title="Keep keys private">
A key grants access to your organization's connected data. Don't commit keys to shared repos — give each person or tool its own key, and revoke any key that may have leaked.
</Callout>

## OAuth 2.0

For clients that support it, OAuth avoids sharing static keys. Sequel implements standard **OAuth 2.0 with PKCE**:

<Steps>
<Step title="The client registers itself">
The MCP client registers with Sequel automatically (dynamic client registration) — there's nothing to paste.
</Step>

<Step title="You sign in and consent">
You're redirected to a Sequel consent screen, sign in, and pick the organization to authorize.
</Step>

<Step title="Sequel issues tokens">
Sequel returns a short-lived access token (refreshed automatically in the background) scoped to your organization. The client uses it on every request.
</Step>
</Steps>

To use OAuth, just choose Sequel as an MCP connector in a client that supports it (for example ChatGPT's Connectors or Claude.ai integrations) and follow the sign-in prompt.

## Scope & revocation

- **Organization-scoped.** Every key and OAuth session can only reach the data sources your organization has connected.
- **Revoke anytime.** Delete an API key, or revoke an OAuth authorization, from the dashboard. Access stops immediately.
- **Rotate freely.** Issue separate keys per tool or environment so you can revoke one without disrupting the others.

## Next steps

- [Install Sequel MCP in your tool](/docs/install)
- [Getting Started](/docs/getting-started)

---

# Integrations

Connect Sequel to your databases, warehouses, product analytics, and SaaS tools. Browse every supported integration and its setup guide.

Sequel connects to cloud databases, warehouses, product analytics, and SaaS APIs — and can join across them in a single question. Pick a source below for its step-by-step setup guide.

<Callout type="info">
Guides are rolling out continuously. Sources without a dedicated guide yet still work today via the [connections flow](/docs/connecting-your-first-data-source).
</Callout>

<ConnectorGrid />

---

# How to connect PostgreSQL to AI agents?

Connect a cloud-hosted PostgreSQL database to Sequel and query it in natural language from the app or any MCP client.

Connect a cloud-hosted PostgreSQL database to Sequel and query it in plain English — from the Sequel app or any AI tool wired up to the [MCP server](/docs/install). This works with managed Postgres anywhere: Amazon RDS/Aurora, Supabase, Neon, Render, Railway, Heroku, Digital Ocean, and similar.

## What you'll need

- A **cloud-hosted PostgreSQL** database reachable over the internet.
- A database **connection string** (or host, port, database, user, and password).
- A user with **read access** to the schemas you want to query.

<Callout type="tip" title="Use a read-only user">
Create a dedicated read-only role for Sequel. It's the simplest way to guarantee queries can't modify your data, and it scopes access to just the tables you intend to expose.
</Callout>

## Connect it

<Steps>
<Step title="Open a new connection">
In the Sequel dashboard, go to **Connections → New connection** and choose **PostgreSQL**.
</Step>

<Step title="Enter your connection string">
Paste your connection string. It usually looks like this:

<CodeBlock language="bash" label="Connection string">postgresql://USER:PASSWORD@HOST:5432/DATABASE?sslmode=require</CodeBlock>

Most managed providers require SSL — keep `sslmode=require` unless your provider says otherwise.
</Step>

<Step title="Allow Sequel through your firewall">
Sequel connects to your database from a fixed set of IP addresses. If your database (or its provider's firewall/security group) restricts inbound traffic, add Sequel's egress IPs to the allowlist so the connection test can reach it.

The exact IPs to allowlist are shown on the connection screen — copy them from there into your provider's networking settings (e.g. RDS security groups, Supabase network restrictions, Neon IP allow).
</Step>

<Step title="Test and save">
Sequel verifies the credentials and reads your schema. A green check means it's live.
</Step>
</Steps>

## Try it

Once connected, ask things like:

- "How many rows are in each table?"
- "Show me the 10 most recently created users."
- "What foreign keys reference the `orders` table?"
- "Plot daily signups for the last 30 days."

## Troubleshooting

| Symptom | Likely fix |
| --- | --- |
| Connection test times out | Database isn't reachable from the internet, or a firewall is blocking Sequel — add Sequel's egress IPs (shown on the connection screen) to your allowlist. |
| SSL/TLS error | Add or adjust `sslmode` (commonly `require`) to match your provider. |
| "Permission denied" on a table | The user lacks `SELECT` on that table or schema — grant read access. |

## Related

- [Connecting your first data source](/docs/connecting-your-first-data-source)
- [Chatting with your data](/docs/chatting-with-your-data)
- [Browse all integrations](/docs/integrations)

---

# How to connect MySQL to AI agents?

Connect a cloud-hosted MySQL database to Sequel and query it in natural language from the app or any MCP client.

Connect a cloud-hosted MySQL database to Sequel and query it in plain English — from the Sequel app or any AI tool wired up to the [MCP server](/docs/install). This works with managed MySQL anywhere: PlanetScale, Amazon RDS/Aurora MySQL, Google Cloud SQL, Azure Database for MySQL, and similar (MySQL 5.7+, including 8.x, and MariaDB 10.3+).

## What you'll need

- A **cloud-hosted MySQL** database reachable over the internet.
- A database **connection string** (host, port, database, user, and password).
- A user with **read access** to the schemas you want to query.

<Callout type="tip" title="Use a read-only user">
Create a dedicated read-only user for Sequel. It's the simplest way to guarantee queries can't modify your data, and it scopes access to just the tables you intend to expose.
</Callout>

## Connect it

<Steps>
<Step title="Open a new connection">
In the Sequel dashboard, go to **Connections → New connection** and choose **MySQL**.
</Step>

<Step title="Enter your connection string">
Paste your connection string. It usually looks like this:

<CodeBlock language="bash" label="Connection string">mysql://USER:PASSWORD@HOST:3306/DATABASE</CodeBlock>

Most managed providers require SSL — append the SSL parameters your provider documents (some need a CA certificate) if the connection is rejected without them.
</Step>

<Step title="Allow Sequel through your firewall">
Sequel connects to your database from a fixed set of IP addresses. If your database (or its provider's firewall/security group) restricts inbound traffic, add Sequel's egress IPs to the allowlist so the connection test can reach it.

The exact IPs to allowlist are shown on the connection screen — copy them from there into your provider's networking settings (e.g. RDS security groups, Cloud SQL authorized networks, PlanetScale/Azure IP allow).
</Step>

<Step title="Test and save">
Sequel verifies the credentials and reads your schema. A green check means it's live.
</Step>
</Steps>

## Try it

Once connected, ask things like:

- "Show me total sales by product category last quarter"
- "Which customers haven't placed an order in 90 days?"
- "Show me the top 20 users by total spend"

## Troubleshooting

| Symptom | Likely fix |
| --- | --- |
| Connection test times out | Database isn't reachable from the internet, or a firewall is blocking Sequel — add Sequel's egress IPs (shown on the connection screen) to your allowlist. |
| SSL/TLS connection error | Provider requires an encrypted connection — add the SSL parameters (and CA certificate, if needed) from your provider's docs. |
| Access denied for user | The user lacks a `SELECT` grant on the target database, or the credentials are wrong. |

## Related

- [Connecting your first data source](/docs/connecting-your-first-data-source)
- [Chatting with your data](/docs/chatting-with-your-data)
- [Browse all integrations](/docs/integrations)

---

# How to connect ClickHouse to AI agents?

Connect a cloud-hosted ClickHouse database to Sequel and query it in natural language from the app or any MCP client.

Connect a cloud-hosted ClickHouse database to Sequel and ask analytical questions in plain English — from the Sequel app or any AI tool wired up to the [MCP server](/docs/install). This works with ClickHouse Cloud and self-managed ClickHouse running on a host Sequel can reach over the internet.

## What you'll need

- A **cloud-hosted ClickHouse** server reachable over the internet (ClickHouse Cloud or self-managed).
- The **host**, **port**, **database**, **username**, and **password** for the server.
- A user with **read access** to the databases you want to query.

<Callout type="tip" title="Use a read-only user">
Create a dedicated read-only user for Sequel. It's the simplest way to guarantee queries can't modify your data, and it scopes access to just the tables you intend to expose.
</Callout>

## Connect it

<Steps>
<Step title="Open a new connection">
In the Sequel dashboard, go to **Connections → New connection** and choose **ClickHouse**.
</Step>

<Step title="Enter your connection details">
Fill in each field:

<CodeBlock language="bash" label="Connection details">host: your-instance.clickhouse.cloud
port: 8443        # ClickHouse Cloud. Self-managed HTTP is usually 8123
username: default
password: ••••••••
database: default</CodeBlock>

For ClickHouse Cloud, use the secure HTTP port **8443**. Self-managed servers typically expose plain HTTP on **8123**.
</Step>

<Step title="Allow Sequel through your firewall">
Sequel connects to your server from a fixed set of IP addresses. If your server restricts inbound traffic, add Sequel's egress IPs to the allowlist so the connection test can reach it. In ClickHouse Cloud, add them under **Settings → IP Access List**.

The exact IPs to allowlist are shown on the connection screen — copy them from there.
</Step>

<Step title="Test and save">
Sequel pings the server, verifies the credentials, and reads your schema. A green check means it's live.
</Step>
</Steps>

## What you can query

Once connected, Sequel can list the databases on your server, read every table's columns and types, and run read-only SQL against them — so you can ask questions across any database you've granted access to.

## Try it

Once connected, ask things like:

- "How many events did we receive per hour yesterday?"
- "What's the funnel conversion rate from signup to first purchase?"
- "Show me the top 10 users by event count this week."
- "Which event types have increased most in the last 7 days?"

## Troubleshooting

| Symptom | Likely fix |
| --- | --- |
| Connection test times out | The server isn't reachable from the internet, or a firewall is blocking Sequel — add Sequel's egress IPs (shown on the connection screen) to your allowlist. In ClickHouse Cloud, that's **Settings → IP Access List**. |
| Authentication failed | Double-check the username and password, and confirm the user is allowed to connect from Sequel's network. |
| Empty schema or "unknown database" | Verify the **database** name and make sure the user has read access to the tables you want to query. |

## Related

- [Connecting your first data source](/docs/connecting-your-first-data-source)
- [Chatting with your data](/docs/chatting-with-your-data)
- [Browse all integrations](/docs/integrations)

---

# How to connect Google BigQuery to AI agents?

Connect Google BigQuery to Sequel and query petabytes of data in natural language from the app or any MCP client.

Connect Google BigQuery to Sequel and query it in plain English — from the Sequel app or any AI tool wired up to the [MCP server](/docs/install). BigQuery is Google's fully-managed, serverless data warehouse, and Sequel connects to it with a read-only Google sign-in so you can ask questions across your datasets without writing GoogleSQL by hand.

## What you'll need

- A **Google Cloud project** with the **BigQuery API** enabled.
- A **Google account** with read access to the datasets you want to query — in practice the `roles/bigquery.dataViewer` role (to read tables) and `roles/bigquery.jobUser` role (to run queries).
- Your **GCP Project ID** — the unique identifier for your project, e.g. `my-company-analytics-123`. You'll find it at the top of the Google Cloud Console, or by running `gcloud config get-value project`.

<Callout type="tip" title="Connect with a least-privilege account">
Sign in with an account that only has read access to the datasets you intend to expose. Sequel requests the read-only `bigquery.readonly` scope, so it can run `SELECT` queries but can never modify your data.
</Callout>

## Connect it

<Steps>
<Step title="Open a new connection">
In the Sequel dashboard, go to **Connections → New connection** and choose **BigQuery**.
</Step>

<Step title="Sign in with Google">
Authorize Sequel through Google OAuth 2.0. Sequel only requests the read-only `bigquery.readonly` scope — there are no service-account JSON keys to create or manage.
</Step>

<Step title="Enter your GCP Project ID">
Provide the project you want to query.

<CodeBlock language="bash" label="GCP Project ID">my-company-analytics-123</CodeBlock>

Sequel verifies the project, confirms the BigQuery API is enabled, and checks that your account can list datasets.
</Step>

<Step title="Test and save">
Sequel reads your datasets and table schemas. A green check means it's live. You can restrict schema introspection to specific datasets later from the connection settings.
</Step>
</Steps>

## Try it

Once connected, ask things like:

- "What are the top 10 events by count this week?"
- "Show me daily revenue for the past 30 days as a line chart."
- "Which users had the highest session count last month?"
- "List all tables in my analytics dataset with row counts."

## Troubleshooting

| Symptom | Likely fix |
| --- | --- |
| "Access denied" / 403 | Make sure the BigQuery API is enabled and your account has `bigquery.dataViewer` (read) and `bigquery.jobUser` (run queries) roles. |
| "Project not found" / 404 | Double-check the GCP Project ID — use the project ID, not the project name or number. |
| Queries scan too many bytes | BigQuery bills per bytes scanned. Add an instruction in the connection settings to always filter by partition columns on large tables. |

## Related

- [Connecting your first data source](/docs/connecting-your-first-data-source)
- [Chatting with your data](/docs/chatting-with-your-data)
- [Browse all integrations](/docs/integrations)

---

# How to connect Google Analytics to AI agents?

Connect Google Analytics 4 to Sequel with OAuth and ask about sessions, conversions, and traffic in natural language.

Connect **Google Analytics 4 (GA4)** to Sequel and ask about your traffic, sessions, conversions, and acquisition channels in plain English — then join it with your product or revenue data for questions a single tool can't answer alone.

## What you'll need

- A **Google account** with access to the GA4 property you want to query.
- At least **Viewer** access on that property.

Google Analytics connects over **OAuth**, so there's no key to copy — you authorize Sequel with your Google account and pick the property.

## Connect it

<Steps>
<Step title="Open a new connection">
In the Sequel dashboard, go to **Connections → New connection** and choose **Google Analytics**.
</Step>

<Step title="Sign in with Google">
You'll be redirected to Google's consent screen. Sign in and grant Sequel read access to your Analytics data.
</Step>

<Step title="Pick a property">
Choose the GA4 property you want Sequel to query. You can connect additional properties later by repeating this flow.
</Step>

<Step title="Confirm">
Sequel verifies access and the connection goes live.
</Step>
</Steps>

<Callout type="info" title="GA4, not Universal Analytics">
Sequel queries GA4 properties. Universal Analytics properties stopped processing data in 2023 and aren't supported.
</Callout>

## Try it

- "How many sessions did we get last week, by channel?"
- "What were our top 10 landing pages by users this month?"
- "Compare conversion rate for mobile vs desktop over the last 30 days."
- "Which acquisition source drove the most new users this quarter?"

## Join it with other sources

Google Analytics gets more powerful alongside your other data. With a database also connected, ask:

> "For users acquired through paid search in GA, what's their 90-day retention in our Postgres `events` table?"

## Troubleshooting

| Symptom | Likely fix |
| --- | --- |
| No properties listed | The Google account you authorized doesn't have access to the property — use one with at least Viewer access. |
| Authorization fails | Re-run the OAuth flow and make sure you grant the requested Analytics read scope. |
| Data looks empty | Confirm the property actually has data in the date range you're asking about. |

## Related

- [Google Search Console](/docs/google-search-console)
- [Chatting with your data](/docs/chatting-with-your-data)
- [Browse all integrations](/docs/integrations)

---

# How to connect Amplitude to AI agents?

Connect Amplitude to Sequel with an API key and ask about events, active users, retention, and funnels in natural language.

Connect **Amplitude** to Sequel and ask about your product analytics — events, active users, retention, funnels, and cohorts — in plain English, from the Sequel app or any AI tool wired up to the [MCP server](/docs/install). Then join it with your warehouse, revenue, or CRM data for questions a single tool can't answer alone.

## What you'll need

- An **Amplitude account** with access to the project you want to query.
- Your project's **API Key** and **Secret Key**, found under **Settings → Projects → [your project] → General**.
- The **region** your project lives in — **US** (amplitude.com) or **EU** (analytics.eu.amplitude.com).

<Callout type="tip" title="Where to find your keys">
In Amplitude, open **Settings → Projects**, pick your project, and the **General** tab shows the **API Key** and **Secret Key**. Read access to the project is enough — Sequel only uses these keys for read-only analytics queries.
</Callout>

## Connect it

<Steps>
<Step title="Copy your API & Secret Key">
In Amplitude, go to **Settings → Projects → [your project] → General** and copy both the **API Key** and **Secret Key**.
</Step>

<Step title="Open a new connection">
In the Sequel dashboard, go to **Connections → New connection**, choose **Amplitude**, and give it a name.
</Step>

<Step title="Paste your keys and pick a region">
Paste the **API Key** and **Secret Key**, then select your **region** (US or EU) — the one the project was created in. Sequel combines the two keys as HTTP Basic auth against Amplitude's read APIs.
</Step>

<Step title="Test & save">
Click **Test**. Sequel validates the keys against the Taxonomy API. When it confirms, save the connection and it goes live.
</Step>
</Steps>

## What you can query

Sequel exposes read-only tools over Amplitude's Taxonomy, behavioral query, and Dashboard APIs:

- **Events catalog** — list every event tracked in the project, including last-seen timestamps.
- **Event properties** — the full property list (and value samples) for any event.
- **Event segmentation** — counts, uniques, sums, and averages over any event, grouped or filtered by property.
- **Funnel reports** — conversion and drop-off across any step sequence and window.
- **Retention reports** — N-day, weekly, and monthly retention by cohort.
- **Saved charts** — re-pull an existing Amplitude chart by its chart ID and re-segment it.

The connector is read-only; it cannot create or modify events, charts, or cohorts.

## Try it

- "What's the 7-day retention for users who signed up last month?"
- "Show me the conversion funnel from signup to first paid action over the past 30 days."
- "Which onboarding step has the biggest drop-off?"
- "How many users triggered 'Subscription Started' last week, by plan?"

## Join it with other sources

> "Compare onboarding funnel conversion in Amplitude against MRR from Stripe by signup month."

## Troubleshooting

| Symptom | Likely fix |
| --- | --- |
| Test fails with a 401 / auth error | The API Key or Secret Key is wrong. Re-copy both from **Settings → Projects → General** — they're easy to swap. |
| Connects but returns empty results | The region is almost always the culprit. Switch between **US** and **EU** to match where the project was created, then re-test. |
| A report comes back with no data | No events fired in the date range. Widen the range or confirm the event name with a quick "list events" question. |

## Related

- [Connecting your first data source](/docs/connecting-your-first-data-source)
- [Chatting with your data](/docs/chatting-with-your-data)
- [Browse all integrations](/docs/integrations)

---

# How to connect Mixpanel to AI agents?

Connect Mixpanel to Sequel with a Service Account and ask about your product analytics — events, funnels, retention, and active users — in natural language.

Connect **Mixpanel** to Sequel and ask about your product analytics in plain English — events, funnels, retention, segmentation, and active users — from the Sequel app or any AI tool wired up to the [MCP server](/docs/install). Skip the drop-downs: describe the report you want and Sequel runs it against Mixpanel's Query API. And because it's just another source, you can join your Mixpanel data with the rest of your stack in a single question. Sequel only ever reads.

## What you'll need

- A **Mixpanel account** with a project you can read.
- A **Service Account username** — looks like `my-sa.abc123.mp-service-account`.
- The **Service Account secret** — shown once when the account is created.
- Your numeric **project ID** — under **Project Settings → Overview**, or the digits after `/project/` in any Mixpanel URL.
- The project's **region** — `us` (mixpanel.com) or `eu` (eu.mixpanel.com). Pick the region the project was created in.

<Callout type="tip" title="Create a Service Account in Mixpanel">
Go to **Organization Settings → Service Accounts** and create a new account with at least **project-level read access** — a read role is enough, since Sequel never writes. Copy the username and the secret (the secret is shown only once) before leaving the page.
</Callout>

## Connect it

<Steps>
<Step title="Open a new connection">
In the Sequel dashboard, go to **Connections → New connection** and choose **Mixpanel**.
</Step>

<Step title="Create a Service Account in Mixpanel">
In Mixpanel, go to **Organization Settings → Service Accounts** and create an account with project-level read access. Copy the **username** and the **secret** shown at creation.
</Step>

<Step title="Fill in the connection form">
Paste the **Service Account username** and **secret**, enter your numeric **project ID**, and choose the **region** (`us` or `eu`) the project lives in. Sequel uses the username and secret as HTTP Basic auth.
</Step>

<Step title="Test and save">
Sequel pings your project against the Mixpanel API. A green check means it's live and ready to query.
</Step>
</Steps>

## What you can query

Sequel exposes Mixpanel as read-only tools over the Query API:

- **Events** — list the event names tracked in the project.
- **Event properties** — list the properties on a given event.
- **Segmentation** — counts, uniques, sums, and averages over any event, grouped by any property, bucketed by minute, hour, day, week, or month.
- **Funnels** — list saved funnels, or run conversion and drop-off across any custom step sequence and window.
- **Raw event export** — pull row-level events bounded by date range and event name.

<Callout type="info" title="Read-only">
The connector ships query and export tools only — it can't create or modify reports, funnels, or cohorts. Raw export is rate-limited (60 queries/hour/project), so keep its date range narrow and lean on segmentation for aggregate questions.
</Callout>

## Try it

- "How many users completed 'Subscription Started' last week, by plan?"
- "Show me the signup → activation funnel conversion for the past 30 days."
- "Compare DAU for iOS vs Android over the last 60 days."
- "Which step in funnel 4321 has the biggest drop-off?"

## Join it with other sources

Mixpanel is most useful next to your other data. With Stripe and Postgres also connected, ask:

> "Match users who completed activation in Mixpanel against paying customers in Stripe, and pull their plan and signup date from Postgres."

## Troubleshooting

| Symptom | Likely fix |
| --- | --- |
| `401 Unauthorized` on connect | Re-check the Service Account username and secret for typos. If the secret was lost (it's shown only once), create a new Service Account and use the fresh credentials. |
| Connects but returns no data | Confirm the **project ID** and **region** match — a US project queried against the EU host (or vice versa) returns 401s or empty results. |
| A report comes back empty | Loosen filters and confirm there are events in the date range; dates are interpreted in the project's timezone. |

## Related

- [Connecting your first data source](/docs/connecting-your-first-data-source)
- [Chatting with your data](/docs/chatting-with-your-data)
- [Browse all integrations](/docs/integrations)

---

# How to connect PostHog to AI agents?

Connect PostHog to Sequel and ask about events, funnels, retention, and active users in plain English — HogQL under the hood.

Connect **PostHog** to Sequel and ask about your product analytics in plain English — events, funnels, retention, active users, cohorts, and saved insights — from the Sequel app or any AI tool wired up to the [MCP server](/docs/install). Sequel writes HogQL (PostHog's SQL dialect) under the hood, only ever reads, and can join PostHog with your other connected sources.

## What you'll need

- A **PostHog account** (PostHog Cloud or self-hosted).
- A **Personal API key** with read-only scopes: `query:read`, `event_definitions:read`, `property_definitions:read`, `insight:read`, `cohort:read`, `project:read`.
- Your **host** — `https://us.posthog.com` for US Cloud (default), `https://eu.posthog.com` for EU Cloud, or your self-hosted base URL (no trailing slash).
- Your numeric **project ID** — found in your PostHog URL: `app.posthog.com/project/<id>`.

<Callout type="tip" title="Read-only by design">
The PostHog connector ships only read tools (HogQL query, list events, list properties, list insights, list cohorts). Granting the Personal API key read-only scopes means Sequel can't create or change insights, dashboards, cohorts, or feature flags — even in principle. Rotate or revoke the key from PostHog Settings at any time.
</Callout>

## Connect it

<Steps>
<Step title="Open a new connection">
In the Sequel dashboard, go to **Connections → New connection** and choose **PostHog**.
</Step>

<Step title="Create a Personal API key">
In PostHog, go to **Settings → Personal API Keys → Create personal API key**. Grant the read-only scopes: `query:read`, `event_definitions:read`, `property_definitions:read`, `insight:read`, `cohort:read`, and `project:read`. Copy the key — PostHog only shows it once.
</Step>

<Step title="Enter your key, host, and project ID">
Paste the **API key** into Sequel, set the **host** (US Cloud, EU Cloud, or your self-hosted base URL), and enter your numeric **project ID** from the PostHog URL.
</Step>

<Step title="Test and save">
Sequel verifies the credentials against your project and confirms the connection by name. A green check means it's live.
</Step>
</Steps>

## What you can query

Sequel exposes PostHog's product-analytics data as read-only tools:

- **HogQL queries** — arbitrary SQL against the `events`, `persons`, `sessions`, `groups`, and `cohort_people` tables for counts, funnels, retention, MAU/DAU, and property breakdowns.
- **Event definitions** — event names with first-/last-seen timestamps and 30-day volume, so the agent uses the events you actually track.
- **Property definitions** — event and person properties with type info to compose accurate HogQL.
- **Insights** — saved trends, funnels, and retention insights the team has already built.
- **Cohorts** — saved user segments, referenceable from HogQL as `person_id IN COHORT <id>`.

## Try it

- "How many unique users triggered $pageview yesterday, by country?"
- "Show me the signup → activation funnel for users created in the last 30 days."
- "What's the 7-day retention of users in the 'Power users' cohort?"
- "Show me daily active users, broken down by self-serve vs sales-led signup."

## Join it with other sources

PostHog is most powerful next to your accounts and revenue data. With Postgres also connected, ask:

> "For accounts in our Postgres `customers` table on the Pro plan, what's their 30-day active usage of the checkout flow in PostHog?"

## Troubleshooting

| Symptom | Likely fix |
| --- | --- |
| Invalid or unauthorized key | Re-check the key for typos, or create a fresh Personal API key in PostHog with the required read scopes and paste it again. |
| Connection fails or returns the wrong project | Confirm the **host** matches your region — `us.posthog.com` vs `eu.posthog.com` (or your self-hosted base URL, no trailing slash). |
| Queries return no data | Verify the numeric **project ID** is correct and that data exists in the date range you're asking about. |

## Related

- [Connecting your first data source](/docs/connecting-your-first-data-source)
- [Chatting with your data](/docs/chatting-with-your-data)
- [Browse all integrations](/docs/integrations)

---

# How to connect Google Search Console to AI agents?

Connect Google Search Console to Sequel with OAuth and ask about clicks, impressions, queries, and pages in natural language.

Connect **Google Search Console (GSC)** to Sequel and ask about your organic search performance — clicks, impressions, average position, top queries, and top pages — in plain English. Pair it with Google Analytics and your product data for a full picture of how search traffic converts.

## What you'll need

- A **Google account** with access to the Search Console property you want to query.
- At least **Restricted** or **Full** user access on that property.

Search Console connects over **OAuth** — authorize Sequel with your Google account and select the property.

## Connect it

<Steps>
<Step title="Open a new connection">
In the Sequel dashboard, go to **Connections → New connection** and choose **Google Search Console**.
</Step>

<Step title="Sign in with Google">
Grant Sequel read access on Google's consent screen.
</Step>

<Step title="Pick a property">
Choose the verified Search Console property (a domain or URL-prefix property) you want to query.
</Step>

<Step title="Confirm">
Sequel verifies access and the connection goes live.
</Step>
</Steps>

<Callout type="info" title="Data freshness">
Search Console data typically lags by a couple of days, and very recent dates may be incomplete. Ask about ranges that end a few days back for stable numbers.
</Callout>

## Try it

- "What were our top 20 search queries by clicks last month?"
- "Which pages gained the most impressions week over week?"
- "What's our average position for branded vs non-branded queries?"
- "Show clicks and CTR by country for the last 28 days."

## Join it with other sources

> "Take our top 20 GSC landing pages by clicks and show how many of those sessions converted, using our Postgres `orders` table."

## Troubleshooting

| Symptom | Likely fix |
| --- | --- |
| No properties listed | The authorized account lacks access — use one added as a user on the property in Search Console. |
| Recent dates empty | GSC data lags; query a range ending 2–3 days ago. |
| Authorization fails | Re-run the OAuth flow and grant the requested Search Console read scope. |

## Related

- [Google Analytics](/docs/google-analytics)
- [Chatting with your data](/docs/chatting-with-your-data)
- [Browse all integrations](/docs/integrations)

---

# How to connect Ahrefs to AI agents?

Connect Ahrefs to Sequel with an API key and ask about backlinks, keywords, rankings, and organic traffic in natural language.

Connect **Ahrefs** to Sequel and ask about your SEO data — backlinks, organic keywords, rankings, domain metrics, and organic traffic — in plain English, from the Sequel app or any AI tool wired up to the [MCP server](/docs/install). Then join it with your analytics or revenue data for questions a single tool can't answer alone.

## What you'll need

- An **Ahrefs account** with API access (workspace owners and admins can create keys).
- An **Ahrefs API key**, created under **Account settings → API keys**.

<Callout type="info" title="The Ahrefs API needs an eligible plan">
The Ahrefs API is available on eligible paid plans. On other plans you still get a limited set of free test queries. Most reports also consume Ahrefs API units (minimum 50 per request) billed against your plan's allowance — validating your key is free. See Ahrefs' pricing page for current API eligibility.
</Callout>

## Connect it

<Steps>
<Step title="Create an API key in Ahrefs">
In Ahrefs, go to **Account settings → API keys** and create a new key. Only workspace owners and admins can do this. Copy the key.
</Step>

<Step title="Open a new connection">
In the Sequel dashboard, go to **Connections → New connection**, choose **Ahrefs**, and give it a name.
</Step>

<Step title="Paste your API key">
Paste the key into the **API key** field. Sequel sends it to the Ahrefs API v3 as a Bearer token.
</Step>

<Step title="Test & save">
Click **Test**. Sequel validates the key against the free subscription-info endpoint (no units consumed). When it confirms, save the connection and it goes live.
</Step>
</Steps>

## What you can query

Sequel exposes read-only reports over the Ahrefs API v3:

- **Domain overview** — Domain Rating, organic/paid traffic, and keyword counts for a domain or URL.
- **Backlinks** — individual inbound links with anchor text and source metrics.
- **Referring domains** — unique linking domains and their authority.
- **Organic keywords** — keywords a target ranks for, with position, volume, and estimated traffic.
- **Top pages** — top pages by organic traffic and their lead keyword.
- **Keyword research** — search volume, difficulty, and CPC for a list of keywords via Keywords Explorer.

The connector is read-only; it cannot modify your Ahrefs projects or settings.

## Try it

- "What's the domain rating and organic traffic for ahrefs.com?"
- "Show the top 50 referring domains for competitor.com."
- "Which organic keywords does example.com rank for in the US top 10?"
- "What's the search volume and difficulty for 'text to sql'?"

## Troubleshooting

| Symptom | Likely fix |
| --- | --- |
| Test fails with an auth error | The API key is invalid or revoked. Create a fresh key in Ahrefs (**Account settings → API keys**) and paste it again. |
| Reports return no data or an access error | Your plan may lack API access or your API units are exhausted. Confirm an eligible paid plan and remaining units in Ahrefs. |
| "Domain not found" or empty results | Check the target domain/URL spelling and the country filter — Ahrefs may have no data for that market or target. |

## Related

- [Connecting your first data source](/docs/connecting-your-first-data-source)
- [Chatting with your data](/docs/chatting-with-your-data)
- [Browse all integrations](/docs/integrations)

---

# How to connect Google Ads to AI agents?

Connect Google Ads to Sequel with OAuth and ask about campaign spend, clicks, and conversions in natural language.

Connect **Google Ads** to Sequel and ask about your campaigns, spend, and conversions in plain English — then join paid-media performance with the revenue, signups, or pipeline data in your other sources. Under the hood Sequel queries Google Ads with GAQL (Google Ads Query Language), so you get campaigns, ad groups, ads, keywords, search terms, and metrics like impressions, clicks, cost, CTR, average CPC, and conversions — without writing a query yourself.

## What you'll need

- A **Google account** with access to the Google Ads account you want to query.
- At least **read access** to that Ads account.
- If you reach your accounts through a **manager (MCC) account**, the manager's **10-digit customer ID** (no dashes).

Google Ads connects over **OAuth**, so there's no key to copy — you authorize Sequel with your Google account. Sequel requests the `adwords` scope (read access to your Ads data).

<Callout>
Cost metrics come back in **micros** — 1,000,000 micros = one unit of the account's currency. Sequel divides this for you when you ask about spend, but it's worth knowing if you compare raw numbers against the Google Ads UI.
</Callout>

## Connect it

<Steps>
<Step title="Open a new connection">In the Sequel dashboard, go to **Connections → New connection** and choose **Google Ads**.</Step>
<Step title="Sign in with Google">You'll be redirected to Google's consent screen. Sign in and grant Sequel read access to your Google Ads data.</Step>
<Step title="Pick the Ads account">After authorizing, choose the Google Ads account (customer) you want to query. If that account sits under a **manager (MCC) account**, enter the manager's 10-digit customer ID so Sequel can reach it; leave it blank for a standalone account.</Step>
<Step title="Confirm">Sequel verifies access, lists the accounts it can see, and the connection goes live.</Step>
</Steps>

## Try it

- "How much did we spend on each campaign last month?"
- "Show daily clicks, cost, and conversions for our Search campaigns over the last 30 days."
- "Which campaigns have the best conversion value for the spend this quarter?"
- "List all enabled campaigns and their ad groups."

## Join it with other sources

> "For each Google Ads campaign last month, compare ad spend against the number of paid signups in our Postgres `users` table — which campaigns actually converted?"

## Troubleshooting

| Symptom | Likely fix |
| --- | --- |
| No accounts listed / "no accessible customers" | Confirm the Google account you signed in with has access to the Ads account. If you reach it through a manager account, set the **login customer ID** to the manager's 10-digit ID. |
| Authorization fails or data is denied | Re-run the connection and grant the **Ads read (`adwords`) scope** on Google's consent screen. Make sure you finish the redirect back to Sequel. |
| Empty results for a date range | Google Ads reporting has a short data lag — pick a date range that has ended (e.g. last week), and check the campaign was actually serving during that window. |

## Related

- [Google Analytics](/docs/google-analytics)
- [Google Search Console](/docs/google-search-console)
- [Chatting with your data](/docs/chatting-with-your-data)
- [Browse all integrations](/docs/integrations)

---

# How to connect Meta Ads to AI agents?

Connect Meta Ads (Facebook & Instagram) to Sequel with OAuth and ask about ad spend, ROAS, and campaign performance in plain English.

Connect **Meta Ads (Facebook & Instagram)** to Sequel and ask about ad spend, ROAS, impressions, clicks, and campaign performance in plain English — from the Sequel app or any AI tool wired up to the [MCP server](/docs/install). Then join it with your revenue or product data to answer questions a single tool can't.

## What you'll need

- A **Meta (Facebook) account** with access to the ad accounts you want to query.
- Authorization through Meta's OAuth flow — Sequel requests the **`ads_read`** and **`business_management`** scopes (read-only).

Meta Ads connects over **OAuth**, so there's no key to copy — you authorize Sequel with your Facebook account and it gets read access to the ad accounts that account can see.

<Callout type="info" title="Tokens last ~60 days">
Meta issues a long-lived token (~60 days) that can't be silently refreshed. When it nears expiry, Sequel asks you to reconnect so queries don't fail mid-run.
</Callout>

## Connect it

<Steps>
<Step title="Open a new connection">
In the Sequel dashboard, go to **Connections → New connection** and choose **Meta Ads**.
</Step>

<Step title="Sign in with Facebook">
You'll be redirected to Meta's consent screen. Sign in and grant Sequel read access (`ads_read`, `business_management`) to your advertising data.
</Step>

<Step title="Confirm">
Sequel verifies the connection (it reads your Meta profile to confirm access) and the connection goes live.
</Step>

<Step title="Pick an ad account when you query">
The connection covers every ad account your Facebook user can access. List them with **List Ad Accounts** to get each account id (in `act_<id>` form), then point your questions at the account you care about.
</Step>
</Steps>

## What you can query

- **Ad accounts** — id (`act_<id>`), name, status, currency, timezone, and business name.
- **Campaigns** — name, status, objective, schedule, and daily/lifetime budgets.
- **Ad sets** — status, budget, billing event, optimization goal, and targeting (geo, demographics, interests, audiences).
- **Ads** — name, status, parent ad set, and creative reference.
- **Insights** — spend, impressions, clicks, CTR, CPC, CPM, reach, frequency, and conversion actions (purchases and revenue live in `actions` / `action_values`) at account, campaign, ad set, or ad level — over presets like `last_30d` or an explicit date range, with daily/monthly buckets and breakdowns by age, gender, country, publisher platform, device, and more.

## Try it

- "What was our total Meta ad spend last 30 days, broken down by campaign?"
- "Which campaigns had the best ROAS this month?"
- "Show daily spend and clicks for the last 7 days."
- "Break down impressions by country and publisher platform for last month."

## Join it with other sources

Meta Ads gets more powerful next to your other data. With a database also connected, ask:

> "Compare last month's Meta ad spend by campaign against signups in our Postgres `users` table over the same dates."

## Troubleshooting

| Symptom | Likely fix |
| --- | --- |
| No ad accounts listed | The Facebook account you authorized doesn't have access to any ad account — reconnect with an account that does, and make sure you granted the `ads_read` / `business_management` scopes. |
| Authorization fails | Re-run the OAuth flow and approve the requested read scopes; if it persists, reconnect to issue a fresh 60-day token. |
| Insights come back empty | Confirm the ad account actually ran delivery in the date range, and that you're querying the right `object_id` and `level`. |

## Related

- [Connecting your first data source](/docs/connecting-your-first-data-source)
- [Chatting with your data](/docs/chatting-with-your-data)
- [Browse all integrations](/docs/integrations)

---

# How to connect HubSpot to AI agents?

Connect HubSpot to Sequel with OAuth and ask about contacts, companies, deals, tickets, and pipelines in natural language.

Connect **HubSpot** to Sequel and ask about your CRM — contacts, companies, deals, tickets, and pipeline — in plain English, from the Sequel app or any AI tool wired up to the [MCP server](/docs/install). Then join it with your product or revenue data for questions a single tool can't answer alone.

## What you'll need

- A **HubSpot account** (portal) with access to the CRM data you want to query.
- Nothing to copy or paste — HubSpot connects over **OAuth**. You authorize Sequel and pick the portal.

Sequel requests **read-only** scopes for CRM objects and their schemas: `crm.objects.{contacts,companies,deals,tickets}.read` and `crm.schemas.{contacts,companies,deals,tickets}.read`. No write scopes are requested, so Sequel cannot create, update, or delete records.

## Connect it

<Steps>
<Step title="Open a new connection">
In the Sequel dashboard, go to **Connections → New connection**, choose **HubSpot**, and give it a name.
</Step>

<Step title="Connect with HubSpot">
Click **Connect with HubSpot**. You'll be redirected to HubSpot's OAuth screen.
</Step>

<Step title="Pick a portal and authorize">
Choose the HubSpot portal you want Sequel to query and confirm the read-only CRM scopes. Connect additional portals later by repeating this flow — each portal is a separate Sequel data source.
</Step>

<Step title="Confirm">
Sequel verifies the token against your hub and the connection goes live.
</Step>
</Steps>

<Callout type="info" title="Custom properties just work">
The connector reads each object's property schema at query time, so your real custom property names (for example `ACV` or `Onboarding Status`) show up in answers without any manual setup.
</Callout>

## What you can query

Sequel exposes read tools over the HubSpot v3 CRM API:

- **Contacts** — search by any property combination, custom or default.
- **Companies** — segment by industry, lifecycle stage, or custom fields.
- **Deals** — filter and aggregate by stage, owner, pipeline, amount, or close date.
- **Tickets** — volume, priority, stage, and aging across pipelines.
- **Pipelines** and **properties** — enumerate deal/ticket pipeline + stage IDs and discover available property names per object type.

## Try it

- "How many open deals do we have, broken down by stage and owner?"
- "What's the win rate by lead source for deals closed this quarter?"
- "Show me deals over $50k that have been in 'Proposal Sent' for more than 30 days."
- "List the 20 most recently created tickets with their priority and pipeline."

## Join it with other sources

HubSpot gets more powerful alongside your other data. With a database also connected, ask:

> "For accounts in the 'Closed Won' stage in HubSpot, what's their current MRR and active seat count in our Postgres `subscriptions` table?"

## Troubleshooting

| Symptom | Likely fix |
| --- | --- |
| Authorization fails | Re-run the OAuth flow and confirm you grant the requested read-only CRM scopes. Tokens refresh automatically, but a revoked app needs reconnecting. |
| Missing object or property | The authorized portal may lack access to that CRM object, or the user who connected doesn't have permission — reconnect with an account that can see the data. |
| Data looks empty | Confirm the portal actually has records matching the filters and date range you're asking about. |

## Related

- [Connecting your first data source](/docs/connecting-your-first-data-source)
- [Chatting with your data](/docs/chatting-with-your-data)
- [Browse all integrations](/docs/integrations)

---

# How to connect Apollo to AI agents?

Connect Apollo.io to Sequel with an API key and ask about your prospects, contacts, and accounts in natural language.

Connect **Apollo.io** to Sequel and ask about your prospecting and sales data in plain English — search Apollo's B2B database of people and companies, and slice the contacts and accounts your team has saved in Apollo — from the Sequel app or any AI tool wired up to the [MCP server](/docs/install). Apollo connects with a single API key, and Sequel only ever reads.

## What you'll need

- An **Apollo.io account** with access to **Settings → Integrations → API**.
- An **Apollo master API key**. The People and Organization search endpoints require a **master** key (not a scoped key), so create the key with master access enabled.

<Callout type="info" title="Searching Apollo's database consumes credits">
The **Search People** and **Search Organizations** tools query Apollo's global prospect/company database and consume Apollo credits per their pricing. The **Search Contacts** and **Search Accounts** tools read your own saved CRM data and consume no credits.
</Callout>

## Connect it

<Steps>
<Step title="Open a new connection">
In the Sequel dashboard, go to **Connections → New connection** and choose **Apollo.io**.
</Step>

<Step title="Create a master API key in Apollo">
In Apollo, go to **Settings → Integrations → API → Create New Key** and enable **master** access. The key is passed in the `X-Api-Key` header on every request.
</Step>

<Step title="Paste the key into Sequel">
Copy the key from Apollo and paste it into the **API key** field on Sequel's Apollo connector.
</Step>

<Step title="Test and save">
Sequel verifies the key against the Apollo API. A green check means it's live.
</Step>
</Steps>

## What you can query

Sequel exposes Apollo as four read-only search tools:

- **People** — search Apollo's global prospect database by job title, seniority, location, employer, employee-count band, and keywords. (Consumes credits; does **not** return email addresses or phone numbers.)
- **Organizations** — search Apollo's global company database by location, headcount range, industry keyword tags, and domains. (Consumes credits.)
- **Contacts** — search the contacts your team has saved in Apollo (your CRM). No credits consumed.
- **Accounts** — search the accounts (companies) your team has saved in Apollo. No credits consumed.

<Callout type="info" title="Read-only">
The connector ships search tools only — it can't create, update, or delete any Apollo record.
</Callout>

## Try it

- "Find VPs of Sales at SaaS companies in the US with 50-200 employees."
- "Which of our Apollo contacts were added in the last 30 days?"
- "List our accounts in the 'Negotiation' stage, sorted by last activity."
- "Show me companies in the mining industry headquartered in Canada."

## Join it with other sources

Apollo is most useful next to your other data. With a database also connected, ask:

> "Match our Apollo accounts against the customer table in Postgres, and show which prospects aren't customers yet."

## Troubleshooting

| Symptom | Likely fix |
| --- | --- |
| Apollo rejected the API key (`is_logged_in=false`) | Re-check the key for typos, or create a fresh key in **Settings → Integrations → API** and paste it again. |
| People/Organization search errors or returns nothing | The key likely lacks **master** access — those endpoints require it. Recreate the key with master access enabled. |
| A search returns no results | Loosen your filters and confirm there's data in range. For "our" contacts/accounts use the CRM tools; for net-new prospecting use the global search tools. |

## Related

- [Connecting your first data source](/docs/connecting-your-first-data-source)
- [Chatting with your data](/docs/chatting-with-your-data)
- [Browse all integrations](/docs/integrations)

---

# How to connect Intercom to AI agents?

Connect Intercom to Sequel with OAuth and ask about conversations, support volume, response times, and customers in plain English.

Connect **Intercom** to Sequel and ask about your support conversations, tickets, response times, and customers in plain English — from the Sequel app or any MCP/AI client wired up to the [MCP server](/docs/install). Then join it with your product or revenue data for questions a single tool can't answer alone.

## What you'll need

- An **Intercom account** with access to the workspace you want to query.
- Permission to authorize an OAuth app for that workspace (typically a workspace admin).

Intercom connects over **OAuth**, so there's no key to copy or paste — you authorize Sequel with your Intercom account and the workspace is detected automatically. The tokens Sequel receives are **read-only** and don't expire.

## Connect it

<Steps>
<Step title="Open a new connection">
In the Sequel dashboard, go to **Connections → New connection** and choose **Intercom**.
</Step>

<Step title="Connect with Intercom">
You'll be redirected to Intercom's authorization screen (`app.intercom.com/oauth`). Sign in and approve access for the workspace you want Sequel to query.
</Step>

<Step title="Confirm">
Sequel exchanges the code, reads your workspace from Intercom's `/me` endpoint, and names the connection after it (e.g. *Intercom — Acme Support*). The connection goes live once access is verified.
</Step>
</Steps>

<Callout type="info" title="One workspace per connection">
Each connection maps to a single Intercom workspace. To query another workspace, repeat the flow and authorize that one.
</Callout>

## What you can query

Sequel exposes read access to your Intercom workspace through these tools:

- **Conversations** — search by open/closed state, assignee, team, tags, priority, source, and reply-time statistics.
- **Tickets** — filter by ticket state, category, type, and assignee.
- **Contacts** — users and leads, by email, role, signup/last-seen dates, or any custom attribute.
- **Companies** — full export with plan, spend, session and user counts, size, and industry.
- **Tags, Teams, and Admins** — small lookups, handy for resolving names to ids before a search.

## Try it

- "How many conversations were opened last week, and how many are still open?"
- "What's our median time to first reply this month, by team?"
- "List contacts that signed up in the last 30 days but haven't been seen since."
- "Which companies have the highest monthly spend?"

<Callout type="info" title="Timestamps are Unix seconds">
Intercom returns all dates as Unix seconds. Just ask in plain language — Sequel handles the conversion.
</Callout>

## Join it with other sources

Intercom gets more powerful alongside your other data. With a database also connected, ask:

> "For accounts with an open Intercom ticket this week, what's their MRR in our Postgres `subscriptions` table?"

## Troubleshooting

| Symptom | Likely fix |
| --- | --- |
| Authorization fails | Re-run the OAuth flow and approve access for the correct workspace; make sure your Intercom user can authorize apps. |
| Wrong workspace connected | You authorized a different workspace — start a new connection and pick the right one on Intercom's screen. |
| "Rate limit" errors on large pulls | Intercom caps search at 150 rows per page; narrow the date range or let Sequel page through with the cursor. |

## Related

- [Connecting your first data source](/docs/connecting-your-first-data-source)
- [Chatting with your data](/docs/chatting-with-your-data)
- [Browse all integrations](/docs/integrations)

---

# How to connect Stripe to AI agents?

Connect Stripe to Sequel with a read-only API key and ask about MRR, churn, refunds, and payouts in natural language.

Connect **Stripe** to Sequel and ask about your payments, revenue, and subscriptions in plain English — MRR, churn, refunds, disputes, payouts, and more — from the Sequel app or any AI tool wired up to the [MCP server](/docs/install). Stripe connects with a single API key, and Sequel only ever reads.

## What you'll need

- A **Stripe account** with access to the Dashboard.
- A **Stripe API key** — preferably a **Restricted Key** (starts with `rk_`) scoped **read-only** to the resources you want Sequel to query. A standard secret key (`sk_`) also works, but a restricted key is safer.

<Callout type="tip" title="Use a restricted, read-only key">
The Stripe connector ships only read tools (list, get, search). Pairing it with a Restricted Key scoped to read-only access means Sequel literally can't modify your account, even in principle. Scope the key to just the resources you care about (customers, charges, invoices, subscriptions, etc.), and revoke or rotate it from the Stripe Dashboard at any time without touching your other integrations.
</Callout>

## Connect it

<Steps>
<Step title="Open a new connection">
In the Sequel dashboard, go to **Connections → New connection** and choose **Stripe**.
</Step>

<Step title="Create a Restricted Key in Stripe">
In your Stripe Dashboard, go to **Developers → API keys → Create restricted key**. Set the resources you want Sequel to read (Customers, Charges, Invoices, Subscriptions, Products, Prices, Refunds, Disputes, Payouts, Balance) to **Read**, leave everything else **None**, and create the key. Use a `rk_test_…` key for test-mode data or `rk_live_…` for live data.
</Step>

<Step title="Paste the key into Sequel">
Copy the key from Stripe and paste it into the **API key** field on Sequel's Stripe connector.
</Step>

<Step title="Test and save">
Sequel verifies the key against the Stripe API. A green check means it's live.
</Step>
</Steps>

<Callout type="info" title="Test and live data stay separate">
Want both? Create two connections — one with a `rk_test_…` key and one with `rk_live_…`. Sequel keeps them isolated, and the connection name makes it obvious which is which.
</Callout>

## What you can query

Sequel exposes Stripe's core objects as read-only tools:

- **Customers** — find by email, metadata, or creation date.
- **Charges** and **Payment Intents** — including failed payments and their reason codes.
- **Invoices** and **Subscriptions** — by plan, price, status, or customer.
- **Products** and **Prices** — your catalog and pricing.
- **Refunds** and **Disputes** — over any period, by status.
- **Payouts** and **Balance Transactions** — what hit your bank and the fees behind it.
- **Balance** — current available and pending funds per currency.
- **Search** — full-text queries using Stripe Search Query Language (e.g. `email:"foo@bar.com"`, `status:"active" AND created>1700000000`) across customers, charges, invoices, subscriptions, products, prices, and payment intents.

## Try it

- "What's our MRR for May, broken down by plan?"
- "How many customers churned last month?"
- "List failed payment intents in the last 7 days with the failure reason."
- "What's our current available balance per currency?"

## Join it with other sources

Stripe is most powerful next to your product data. With a database also connected, ask:

> "For customers who churned in Stripe last month, what features did they use in our Postgres `events` table?"

## Troubleshooting

| Symptom | Likely fix |
| --- | --- |
| Invalid or expired key | Re-check the key for typos, or create a fresh Restricted Key in the Stripe Dashboard and paste it again. |
| A resource returns nothing or errors | The Restricted Key is missing **Read** permission on that resource — edit the key in Stripe and grant read access. |
| Data looks empty | Confirm there's actually data in the date range you're asking about, and that you used a live-mode key (`rk_live_…`) if you expect live data. |

## Related

- [Connecting your first data source](/docs/connecting-your-first-data-source)
- [Chatting with your data](/docs/chatting-with-your-data)
- [Browse all integrations](/docs/integrations)

---

# How to connect Google Sheets to AI agents?

Connect Google Sheets to Sequel with OAuth and ask questions about your spreadsheet data in plain English.

Connect **Google Sheets** to Sequel and ask questions about the data in your spreadsheets in plain English — from the Sequel app or any AI tool wired up to the [MCP server](/docs/install). Once a spreadsheet is connected, you can read any tab and join that data with your databases for questions a single tool can't answer alone.

## What you'll need

- A **Google account** with access to the spreadsheet you want to query (read access is enough).
- Nothing to copy or configure — Google Sheets connects over **OAuth**. After you sign in, you pick the spreadsheet from a Google file picker; there's no URL or ID to paste.

<Callout type="info" title="Scoped to the sheet you pick">
Sequel requests Google's `drive.file` scope, which grants access only to the specific spreadsheet you select in the picker. It cannot read, list, or modify any other files in your Google Drive.
</Callout>

## Connect it

<Steps>
<Step title="Open a new connection">
In the Sequel dashboard, go to **Connections → New connection** and choose **Google Sheets**.
</Step>

<Step title="Sign in with Google">
You'll be redirected to Google's consent screen. Sign in and grant Sequel access to the spreadsheet you'll choose next.
</Step>

<Step title="Pick a spreadsheet">
Google's file picker opens, filtered to spreadsheets. Select the one you want Sequel to query.
</Step>

<Step title="Confirm">
Sequel verifies it can read the spreadsheet, indexes its tabs and column headers, and the connection goes live. One connection represents one spreadsheet — repeat this flow to add more.
</Step>
</Steps>

## What you can query

Sequel exposes the connected spreadsheet as queryable tabs:

- **List the sheet tabs** in the spreadsheet, with each tab's row and column counts.
- **Read rows from any tab** — optionally narrowed to an A1 range like `A1:Z100`. The first row of each tab is treated as the column headers, so the AI can filter and reference columns by name.

On connect, Sequel reads the header row of each tab to learn the spreadsheet's structure, which lets it route your questions to the right tab and columns automatically.

## Try it

- "What sheets are in this spreadsheet?"
- "Show me the first 50 rows from the Sales sheet"
- "What are the column headers in the Inventory sheet?"
- "How many rows are in the Orders sheet?"

## Join it with other sources

Spreadsheet data gets more powerful alongside your databases. With a database also connected, ask:

> "Reconcile the headcount plan in my Planning sheet against the actual `employees` table in Postgres — which roles in the plan don't have a matching active employee?"

## Troubleshooting

| Symptom | Likely fix |
| --- | --- |
| "Access denied" on connect | The Google account you authorized doesn't have access to that spreadsheet — sign in with an account that can open it, or have the owner share it with you. |
| Authorization fails | Re-run the OAuth flow and make sure you grant the requested access on Google's consent screen. |
| "Spreadsheet not found" or a tab returns nothing | Pick the spreadsheet again from the file picker, and check you're naming the exact tab — sheet names are case-sensitive. |

## Related

- [Connecting your first data source](/docs/connecting-your-first-data-source)
- [Chatting with your data](/docs/chatting-with-your-data)
- [Browse all integrations](/docs/integrations)

---

# Introduction

What Sequel is — the data layer for your agents. It manages auth, credentials, and execution to securely connect your cloud databases, warehouses, and SaaS tools to the AI agents you already use, over MCP.

Sequel is the **data layer for your agents**. You connect your cloud databases, warehouses, and SaaS tools to Sequel once, and then the AI tools you already use — Claude, Cursor, ChatGPT, or any other MCP-capable agent — can ask questions of your data in plain English and get back real answers. Your agents talk to Sequel, and Sequel safely talks to your data. No more handing out database passwords or API keys to every tool.

![Sequel sits between your data stack and your AI agents](/docs/data-layer.png)

## Why use Sequel

- **One secure boundary.** Your credentials live in Sequel, encrypted. Agents ask Sequel to run work — they never see the secret behind a connection. Authorize a tool once, revoke it any time.
- **Connect once, use everywhere.** The same connections power every MCP client and the CLI. Add a new agent with a permission grant, not another round of credential setup.
- **Answers across sources.** Most real questions span more than one system. Sequel can join your Postgres revenue, Google Analytics sessions, and Stripe payments in a single thread.
- **Real analysis, not just queries.** A built-in Python sandbox (pandas, matplotlib, and more) lets agents compute, chart, and export results — backed by your actual data.

## What Sequel manages for you

Sitting between your agents and your data, Sequel owns the three things that make agent access hard to get right:

| Concern | How Sequel handles it |
| --- | --- |
| **Auth** | Every agent and MCP client connects through Sequel's OAuth flow and scoped API keys. You authorize a tool once, and you can revoke that access at any time without touching the data source itself. |
| **Credentials** | Database passwords, connection strings, and SaaS API keys are stored and encrypted on Sequel's side. Agents never see them — they ask Sequel to run work on a connection, not for the secret behind it. |
| **Execution** | Queries and Python analyses run in Sequel's controlled, sandboxed environment, then return clean results. Your agents get answers and charts back; your data sources only ever talk to Sequel. |

This is what "data layer" means in practice: one secure boundary in front of all your sources, so onboarding a new agent is a permission grant rather than a secret-sharing exercise.

## What you can do with it

- **Ask questions across sources.** Join Postgres revenue with Google Analytics sessions and Stripe payments in a single thread.
- **Explore schemas in natural language.** "What tables relate to subscriptions, and how?"
- **Run real analysis.** Sequel includes a Python sandbox (pandas, matplotlib, and more) so agents can compute, chart, and export results.
- **Connect once, use everywhere.** The same connections power every MCP client and the CLI — no per-tool credential setup.

## Who it's for

- **Data and analytics teams** who want self-serve answers without writing every query by hand.
- **Engineers** who want schema-aware, data-grounded answers inside their editor or CLI.
- **Operators and PMs** who live in ChatGPT or Claude and want those tools to answer with real numbers instead of guesses.

<Callout type="info" title="Sequel connects to cloud-hosted data sources">
Managed Postgres and MySQL (RDS, Supabase, Neon, PlanetScale, and similar), warehouses like BigQuery and ClickHouse, and SaaS APIs like Stripe and Google Analytics.
</Callout>

## Next steps

- **[Getting Started](/docs/getting-started)** — connect the MCP server and run your first query.
- **[Install Sequel MCP](/docs/install)** — copy-paste setup for every supported AI tool.
- **[Integrations](/docs/integrations)** — browse every supported data source and its setup guide.
