> ## Documentation Index
> Fetch the complete documentation index at: https://docs.grainql.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect ChatGPT

> Add Grain as a custom MCP connector in ChatGPT using Developer Mode.

ChatGPT supports remote MCP servers via its **Developer Mode**, currently available on Pro, Team, Enterprise, and Edu plans. Once enabled, Grain shows up like any other connector — toggle it on in a conversation and ChatGPT can query your analytics.

<Warning>
  Developer Mode is a beta feature. OpenAI may gate or change the UI as it matures. If any of the menu names below look different, skim the [OpenAI help article](https://help.openai.com/en/articles/12584461-developer-mode-apps-and-full-mcp-connectors-in-chatgpt-beta) for the current path.
</Warning>

## Setup

<Steps>
  <Step title="Enable Developer Mode">
    In ChatGPT, open **Settings → Apps & Connectors → Advanced settings** and switch **Developer Mode** on. This unlocks the "Add custom connector" flow.
  </Step>

  <Step title="Create a new connector">
    Still in settings, go to **Apps & Connectors → Add new connector** (some plans label it **Connectors → Create**).
  </Step>

  <Step title="Fill in the connector details">
    | Field                      | Value                                 |
    | -------------------------- | ------------------------------------- |
    | **Name**                   | `Grain`                               |
    | **Description** (optional) | `Query my Grain analytics workspace`  |
    | **Icon** (optional)        | Your Grain logo if you have one handy |
    | **MCP server URL**         | `https://grainql.com/api/mcp`         |
    | **Authentication**         | `OAuth`                               |

    You don't need to paste a client ID or secret. Grain registers ChatGPT dynamically when it first connects.
  </Step>

  <Step title="Trust and create">
    Tick the **I trust this application** checkbox and click **Create**. ChatGPT opens Grain's consent screen in your browser.
  </Step>

  <Step title="Authorize the workspace">
    Pick the workspace you want ChatGPT to see, review the three scope rows, and click **Authorize**.

    <Check>
      ChatGPT closes the browser tab and marks the connector as connected.
    </Check>
  </Step>

  <Step title="Use it in a conversation">
    Open a new chat, click **+** (or the tools menu, depending on your ChatGPT version), enable **Grain**, and ask:

    > What were my top 10 referrers last week, and which ones grew the most vs the week before?

    ChatGPT will call `grain.query.compare` and summarize.
  </Step>
</Steps>

## What ChatGPT is good at with Grain

ChatGPT shines at **narrative synthesis** — turning rows into a paragraph your CEO will actually read. A few framings that work well:

<AccordionGroup>
  <Accordion title="Monday‑morning briefing">
    > Pull last week's digest from Grain and write me a 4‑bullet Slack summary. Bold anything that looks surprising, and link the dashboard at the end.

    ChatGPT uses `grain.query.digest`, then formats. Grain's surprise hints (concentration, volatility, rank changes) are embedded in the response, so the "surprising" bullets are data‑driven, not guessed.
  </Accordion>

  <Accordion title="Stakeholder follow‑ups">
    > We just ran a paid campaign on `utm_source=hackernews`. Break down the resulting signups by first‑touch source and tell me the conversion rate versus organic.

    ChatGPT uses `grain.query` twice (with and without the filter) and does the math.
  </Accordion>

  <Accordion title="Tracking sanity check">
    > Is my Grain integration healthy? Any events that stopped firing in the last 7 days?

    ChatGPT uses `grain.integration.status` and `grain.query.compare`.
  </Accordion>
</AccordionGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="“Add custom connector” is greyed out">
    Developer Mode hasn't been enabled yet, or your plan doesn't support it. The feature is currently Pro/Team/Enterprise/Edu only.
  </Accordion>

  <Accordion title="Create button errors on submit">
    The URL must be exactly `https://grainql.com/api/mcp` — including `https://`. No trailing slash, no subpath.
  </Accordion>

  <Accordion title="Consent screen opens but never returns to ChatGPT">
    Make sure popups are allowed for `chat.openai.com` (or `chatgpt.com`). If the browser swallowed the redirect, revoke the half‑created connector in ChatGPT's settings, and from Grain's [Connections panel](https://grainql.com/dashboard/settings?tab=connectors\&category=mcp), then retry.
  </Accordion>

  <Accordion title="Tool calls fail with 401 after a week">
    Grain refresh tokens rotate. ChatGPT should do this silently, but if it doesn't, click the connector and hit **Reconnect** — one OAuth round‑trip and you're back.
  </Accordion>
</AccordionGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Tool reference" icon="book" href="/ai-tools/mcp/tools">
    The eleven tools available over MCP.
  </Card>

  <Card title="Security & scopes" icon="shield-check" href="/ai-tools/mcp/security">
    How to audit what ChatGPT can see.
  </Card>
</CardGroup>

## References

* [OpenAI Help Center — Developer Mode and MCP connectors in ChatGPT](https://help.openai.com/en/articles/12584461-developer-mode-apps-and-full-mcp-connectors-in-chatgpt-beta)
* [OpenAI Developers — Connect from ChatGPT](https://developers.openai.com/apps-sdk/deploy/connect-chatgpt)
