Skip to content

Integration · Company data

Connect Claude & ChatGPT to PostHog

Ask your AI which events grew last week, what a user did before they left, or which feature flags are live. It runs HogQL queries, reads saved insights and dashboards, looks up persons and cohorts, and can turn a feature flag on or off. You get answers from your product data without building a chart first.

Connect PostHog free

Free plan, no credit card. Takes about a minute.

Try asking

  • “Which events did we get the most of in the last 7 days?”

    The AI runs a HogQL query that counts events by name for the last 7 days and lists the top ones.

  • “What did [email protected] do in the product yesterday?”

    It finds the person by email and lists their events from yesterday, such as page views, with times and properties.

  • “Show me the numbers on our Weekly signups insight.”

    It finds the saved insight by name and reads its results, and recalculates them if you ask for fresh numbers.

What your AI can do

Queries and insights

Run HogQL queries for counts, trends and breakdowns. Read saved insights, trending insights and dashboards.

Events and persons

List raw events, event names and properties, look up persons by email or distinct id, and browse cohorts and their members.

Flags and annotations

Read feature flags with their release conditions and variants, and turn them on or off. List and add chart annotations.

  • “Turn off the new-checkout feature flag.”

    It finds the flag by key and sets it to inactive. The change reaches live users of your product right away.

  • “Add a note to our charts: version 3.2 released today.”

    It creates an annotation with that text and today's date, so it shows up on your charts.

  • “How many people are in the Power users cohort, and who are they?”

    It reads the cohort with its matching rules and person count, then lists the persons in it.

20 tools for PostHog

These tools are switched on when you connect. You can switch any of them off, or require your approval before it runs.

  • create_annotationChanges dataAdd an annotation to charts. Pass `content` (the note) and `date_marker` (when it happened, ISO date-time), and optionally `scope` (project or organization).
  • get_cohortGet one cohort by id, including its matching rules and person count.
  • get_dashboardGet one dashboard by id with its tiles and the insights on it.
  • get_eventGet one event by id with all its properties.
  • get_feature_flagGet one feature flag by id, including its release conditions and variants.
  • get_insightGet one saved insight by id or short id, including its query and cached results. Set `refresh` to blocking to recalculate.
  • get_personGet one person by id with their properties and distinct ids.
  • list_annotationsList annotations (notes shown on charts for releases, campaigns or incidents).
  • list_cohort_personsList the persons in one cohort. Pass the cohort id.
  • list_cohortsList cohorts (saved groups of persons) with their size.
  • list_dashboardsList dashboards. Use `search` to match by name, or `pinned` to show pinned ones.
  • list_event_definitionsList the event names tracked in this project, with their volume and last seen time. Use it to find the right event name before querying.
  • list_eventsList recent raw events, newest first. Filter by `event` name (for example $pageview), `distinct_id`, `person_id`, `properties`, or `before` a time.
  • list_feature_flagsList feature flags with their key, whether they are active and their rollout. Filter with `active` or `search`.
  • list_insightsList saved insights (charts). Use `search` to match by name or description and `basic` for a faster list without results.
  • list_property_definitionsList the event and person property names tracked in this project. Use `search` to find a property before filtering or querying on it.
  • list_trending_insightsList the insights most viewed in the project over recent days.
  • run_hogql_queryChanges dataRun an analytics query against the project and get the results. Pass `query` such as {"kind": "HogQLQuery", "query": "select event, count() from events where timestamp > now() - interval 7 day group by event order by count() desc limit 20"}. Read-only; use it for counts, trends and breakdowns.
  • search_personsFind persons (users being tracked) by email, name or distinct id using `search`, or by exact `email`.
  • update_feature_flagChanges dataChange a feature flag by id, most often to turn it on or off with `active`. Changes take effect for live users of your product right away.

Set up in three steps

  1. 1

    Pick the app

    Create a free PipMCP account and choose PostHog from the app list.

  2. 2

    Paste your key

    Enter your PostHog cloud region (us or eu), a personal API key and your project ID. In PostHog, open Settings > Personal API keys, click Create personal API key, choose the scopes and projects it can access, and copy the key. The project ID is the number after /project/ in your PostHog URL.

  3. 3

    Add the link to your AI

    You get a personal MCP link. Add it to Claude, ChatGPT or Cursor:

    Click your name, then Settings › Connectors › Add custom connector. Paste your link as the Remote MCP server URL. Switch it on from the + menu in a chat.

Questions

What can the AI do in PostHog?

The AI can run HogQL queries and read events, event and property definitions, persons, cohorts, insights, dashboards, feature flags and annotations. It can add annotations and change a feature flag, most often to turn it on or off. It works in the project you connect.

Which region and project ID do I enter?

Enter us or eu to match the PostHog cloud your account is on. You can tell from the address you log in at: us.posthog.com or eu.posthog.com. The project ID is the number after /project/ in your PostHog URL.

Does the AI see my PostHog API key?

No. Your personal API key is encrypted at rest and never shown to the AI. Once saved, it is not shown again, not even to you. The AI only works through the tools you switch on.

Can I control what the AI is allowed to do?

Yes. You choose which tools are switched on, so you can start read-only. Changing a feature flag affects live users right away, so you can require your approval before it runs. Every tool call is logged, so you can see what the AI did.

Does it work with ChatGPT?

Yes. In ChatGPT, go to Settings › Apps & Connectors › Advanced, turn on Developer mode and add your PipMCP link. Developer mode needs a paid ChatGPT plan: Plus, Pro, Business or Enterprise. The same link works in Claude under Settings › Connectors › Add custom connector, and in Cursor.

What does it cost?

PipMCP has a free plan, and you do not need a credit card to start. Paid plans bill per completed task, so you pay for work the AI actually finishes. You also need your own PostHog account.

Related integrations

Let your AI work in PostHog today.

Start free. Your key stays encrypted, and you decide what the AI may do.

Connect PostHog free

PipMCP is not affiliated with PostHog. Product names are trademarks of their owners.