PostHog answers product questions well once you know which insight to open. Grok Bot is xAI's bot builder, an agent that keeps context and reaches your tools through plugins. Connect PostHog through Sequel and the bot writes the HogQL itself, using the event and property names you actually track.
TL;DR
| What you're connecting | A PostHog project to Grok Bot |
| Setup time | About 6 minutes |
| Setup method | One chat message. Grok Bot has no MCP config file |
| Auth to PostHog | Personal API key with read-only scopes |
| Auth to the bot | OAuth to Sequel. No key in the chat |
| Query language | HogQL, written by the agent |
| Works with | US Cloud, EU Cloud, and self-hosted |
What You'll Accomplish
Once this is wired up, you can ask your bot:
- "What's the signup to activation funnel conversion for users created in the last 30 days?"
- "Show 7-day retention for the Power Users cohort, by signup week."
- "Which pages had the most unique viewers yesterday, by country?"
Prerequisites
- A Sequel account: sign up free at sequel.sh
- A PostHog account, Cloud or self-hosted
- A personal API key with
query:read,event_definitions:read,property_definitions:read,insight:read,cohort:read,project:read - Your host and numeric project ID
- A Grok account with a bot you can send messages to
Step 1: Connect PostHog to Sequel
In PostHog, go to Settings → Personal API Keys → Create personal API key and grant the six read scopes above. Copy the key, PostHog shows it once.
Then sign in to sequel.sh, open Data Sources, click New Connection, and choose PostHog.
![]()
| Field | What to enter |
|---|---|
| API key | The personal API key you just created |
| Host | https://us.posthog.com, https://eu.posthog.com, or your self-hosted base URL with no trailing slash |
| Project ID | The number from app.posthog.com/project/<id> |
Sequel verifies the credentials against your project and confirms it by name.
What you get, all read-only:
| Tool | What it returns |
|---|---|
| HogQL queries | Arbitrary SQL over events, persons, sessions, groups, cohort_people |
| Event definitions | Event names with first and last seen, plus 30-day volume |
| Property definitions | Event and person properties with type information |
| Insights | Saved trends, funnels, and retention insights |
| Cohorts | Saved segments, referenceable from HogQL |
Step 2: Add Sequel to Grok Bot
Grok Bot has no MCP config file and no settings form to fill in. You add a server by asking the bot.
Open a chat with your bot and send this:
Add a custom MCP server called sequel at https://api.sequel.sh/mcp
Say custom server explicitly. Leave those words out and the bot searches the plugin marketplace instead of registering your endpoint.
![]()
The bot reads the name and URL back to you. Check both, confirm, and it posts a connect card in the chat. Click Authorize, sign in to Sequel, and approve access. The OAuth token stays on the connector side, so there is no API key to copy and nothing to keep in sync.
To confirm it registered, open Settings → Plugins → Yours. Every server on your account is listed there, including the ones you added by chat.
![]()
Then attach it to a task: type @ in the chat and pick sequel.
Using Grok chat rather than a bot? The steps do not carry over. On grok.com, open Plugins → New Connector → Custom, set the name to
Sequeland the Server URL tohttps://api.sequel.sh/mcp, click Add Connector, and sign in.
Step 3: Ask Grok Bot About Your PostHog Data
Attach @sequel and ask:
What's the signup to activation funnel conversion for users created in the last 30 days?
Show 7-day retention for the Power Users cohort, broken out by signup week.
How many unique users triggered $pageview yesterday, by country?
What You Can Do Now
- Funnels without the builder: describe the steps in a sentence and get the conversion table back.
- Scheduled product digests: the bot runs unattended, so weekly activation numbers arrive on their own.
- Cohort questions: "How do users in the Power Users cohort differ on feature adoption?" in one message.
- Event hygiene: "Which events have not fired in 30 days?" catches broken tracking.
- Cross-source joins: with Postgres connected, compare in-product behaviour with plan and billing state.
Troubleshooting
| Symptom | Likely fix |
|---|---|
| The bot searched the marketplace instead of adding the server | Resend the message with the words "custom server" in it. |
| The server is not listed under Settings → Plugins → Yours | The registration did not complete. Resend the message and confirm the name and URL when the bot reads them back. |
| The bot answers without touching your data | You did not attach it. Type @ in the chat and pick sequel before asking. |
| Invalid or unauthorized key | Recreate the personal API key with all six read scopes and paste it again. |
| Wrong project or a connection failure | Confirm the host matches your region, and that the project ID is the number from the PostHog URL. |
| Queries return nothing | Check that data exists in the date range, and confirm the event name with a "list events" question first. |

