PostHog MCP: analytics, flags and experiments in your AI app
PostHog's MCP server brings product analytics, feature flags and experiments into your AI app: create insights, build dashboards from templates and manage flags while you code in Cursor. ContextGate connects it to Claude, ChatGPT and Cursor, and you can switch off flag changes and member invites so those stay with your team.
Ready to connect
Free
20 example tools
How to connect PostHog to Claude, ChatGPT or Cursor
1Click Connect PostHog free and sign in with your PostHog account.
2PostHog's tool list is long, and every tool is on. Keep insights, dashboards and notebooks; switch off tools that create or change feature flags, add organization members or bulk-invite people unless your AI app needs them.
3Add ContextGate to your AI app as a connector or MCP server. The steps for each app are on the Works with page.
4In Cursor, ask PostHog for an insight on how many users reached your new signup step this week, then open Activity to see the call.
PostHog tasks for Claude, ChatGPT or Cursor
Create insights for a project and build dashboards from a template.
Create and manage feature flags, including role-based access to a flag.
Set up an exposure cohort for an experiment.
Start a notebook in a project to write up what you found.
PostHog's tools cover far more than this; the full list appears in ContextGate after you connect.
Keep flags and access changes reviewed
Switch off feature flag edits so a release can't change state from a chat.
Switch off invites, member roles and SAML domain tools, so account administration stays in PostHog.
Activity keeps a record of every PostHog call, so a flag change can be traced to the AI app that made it.
What you get with PostHog and ContextGate
Your AI apps can use PostHogClaude, Cursor, ChatGPT and other AI apps reach PostHog through the one ContextGate connection you add to them.
You choose which tools they can useSwitch off any PostHog tool you don't want used. It's hidden from your AI apps and refused if called.
Every call is checked and recordedYour policies check each call (for example, personal data is hidden and secrets are blocked), and Activity keeps a record of it.
ContextGate sees only the tool calls that go through it, not your AI app's built-in tools or your chats.
PostHog tools
Examples of what your AI apps can do in PostHog. You'll see the exact list of tools after you connect it.