Integration

PostHog integration

Open-source product analytics platform for tracking user behavior, feature flags, session recordings, and A/B testing. Build data-driven products with event tracking, funnel analysis, retention metrics, and user cohorts. Essential for product teams needing self-hosted analytics, experimentation, and real-time user insights.

Ask it in chat

Say what should happen.
The workflow builds itself.

When this happens, do that in PostHog.Built from the 38 PostHog tools below, on the connection you add once.

Common PostHog use cases

  • Modify targeting rules
  • Create NPS survey
  • End running survey
  • Launch new A/B test
  • End running experiment
  • Play back user session
  • Remove outdated survey
  • Discover tracked events
  • Fetch saved report data
  • List deployment markers

What you can do with PostHog

Each of these is one operation on one endpoint, available both as a workflow step and as a tool an AI agent can call on its own. Nothing bundles several operations into one action, so what a run did stays readable afterwards.

Most endpoints run on the free plan. A few, mainly the ones that publish on your behalf, need a paid plan.

Feature flag, 5 operations

  • create_feature_flagCreate feature flagPOSTCreate a new feature flag
  • evaluate_feature_flagsEvaluate feature flagsPOSTEvaluate feature flags for a user
  • get_feature_flagGet feature flagGETGet feature flag details by ID
  • list_feature_flagsList feature flagsGETList all feature flags in project
  • update_feature_flagUpdate feature flagPATCHUpdate feature flag configuration

Person, 5 operations

  • create_aliasCreate aliasPOSTCreate alias to merge user identities
  • delete_personDelete personDELETEDelete a person from PostHog
  • get_personGet personGETGet person details by ID
  • identify_userIdentify userPOSTIdentify and update user profile properties
  • list_personsList personsGETList all users/persons in project

Survey, 5 operations

  • create_surveyCreate surveyPOSTCreate a new survey
  • delete_surveyDelete surveyDELETEDelete a survey
  • get_surveyGet surveyGETGet survey details by ID
  • list_surveysList surveysGETList all surveys in project
  • update_surveyUpdate surveyPATCHUpdate survey configuration

Experiment, 4 operations

  • create_experimentCreate experimentPOSTCreate a new A/B test experiment
  • get_experimentGet experimentGETGet experiment details and results
  • list_experimentsList experimentsGETList all A/B test experiments
  • update_experimentUpdate experimentPATCHUpdate experiment configuration

Cohort, 3 operations

  • create_cohortCreate cohortPOSTCreate a new user cohort
  • get_cohortGet cohortGETGet cohort details by ID
  • list_cohortsList cohortsGETList all user cohorts

Annotation, 2 operations

  • create_annotationCreate annotationPOSTCreate annotation marker on graphs
  • list_annotationsList annotationsGETList all annotations in project

Dashboard, 2 operations

  • get_dashboardGet dashboardGETGet dashboard details by ID
  • list_dashboardsList dashboardsGETList all dashboards in project

Event, 2 operations

  • batch_captureBatch capturePOSTBatch capture multiple events in one request
  • capture_eventCapture eventPOSTCapture and track a user event

Group, 2 operations

  • group_identifyGroup identifyPOSTIdentify and update group properties
  • list_groupsList groupsGETList all groups by type

Insight, 2 operations

  • get_insightGet insightGETGet insight details and results
  • list_insightsList insightsGETList all saved insights and reports

Session recording, 2 operations

  • get_session_recordingGet session recordingGETGet session recording details
  • list_session_recordingsList session recordingsGETList session recordings

Action, 1 operation

  • list_actionsList actionsGETList all defined actions

Event definition, 1 operation

  • list_event_definitionsList event definitionsGETList all event definitions

Property definition, 1 operation

  • list_property_definitionsList property definitionsGETList all property definitions

Query, 1 operation

  • query_hogqlQuery hogqlPOSTExecute HogQL SQL query

Use PostHog from Claude Code, Cursor or Codex

Connect PostHog in LiveContext, create an API key in Settings, then add the LiveContext MCP server to your client. Its PostHog operations become tools the client can call, next to every other integration you connected.

Claude Code
claude mcp add --transport http livecontext https://livecontext.ai/mcp --header "X-API-Key: YOUR_API_KEY"
Codex (~/.codex/config.toml)
[mcp_servers.livecontext]
url = "https://livecontext.ai/mcp"

[mcp_servers.livecontext.http_headers]
"X-API-Key" = "YOUR_API_KEY"
Cursor, Claude Desktop and other JSON configs
{
  "mcpServers": {
    "livecontext": {
      "type": "http",
      "url": "https://livecontext.ai/mcp",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Set up the MCP server step by step

How to connect PostHog

  1. Create your workspace

    Sign up free. Nothing to install.

  2. Connect PostHog once

    Add your PostHog connection in Settings. Every tool from this integration reuses it, and secrets are encrypted at rest and visible only to you.

  3. Describe the job in chat

    The workflow builds itself in front of you and picks the endpoints it needs. Drag the steps yourself on the canvas whenever you would rather be explicit.

PostHog integration FAQ

What can you do with the PostHog integration?

LiveContext exposes 38 operations on PostHog, covering feature flag, person, survey and experiment. Common uses include Modify targeting rules, Create NPS survey and End running survey.

Popular integrations

Browse the whole catalog