PostHog AI plugin

Official PostHog plugin: an MCP server with 27+ tools and dozens of skills for flags, experiments, analytics and errors.

  • 100 ★ on the repository
  • Last commit
PluginEditors’ pick

Broad access

Why this level

  • Tools create and change feature flags, experiments and dashboards in a live PostHog project.
  • When enabled, Claude Code sessions go to PostHog together with prompts and outputs.
All reasons and checks

posthog/ai-plugin

Install

Manual install

claude plugin install posthog

Then OAuth sign-in through `/mcp`. Through the marketplace: `claude plugin marketplace add PostHog/ai-plugin` and `claude plugin install posthog@posthog`.

Access and checks

How we review

Broad accessThe tool can change data, run commands or handle secrets.

  • Tools create and change feature flags, experiments and dashboards in a live PostHog project.
  • When enabled, Claude Code sessions go to PostHog together with prompts and outputs.

This is third-party code. Review the repository files before installing.

What it does

The plugin connects PostHog products to AI clients: Claude Code, Cursor, Codex, Gemini CLI, Antigravity, Grok and Claude Cowork. Through the remote MCP server `https://mcp.posthog.com/mcp` with OAuth sign-in the agent manages feature flags, runs and reads A/B experiments, builds insights and dashboards, views errors, tracks LLM costs and searches PostHog documentation. The plugin ships more than 30 skills with PostHog practices: HogQL queries, experiment lifecycle, flags, data warehouse setup and troubleshooting and LLM analytics. For Claude Code there is a hook that approves known reads and asks for confirmation on writes, an `error-analyzer` subagent and optional sending of Claude Code sessions to PostHog LLM Analytics.

Who it is for. Product teams and developers who run analytics, flags and experiments in PostHog and want to ask an agent about them.

Good fit when

  • The signup count for the week and the checkout funnel conversion must be found.
  • A `new-onboarding` flag is switched on for half of the users.
  • The errors that hit the most people over the last day must be identified.
  • LLM cost and usage in the product must be brought onto one dashboard.

Not a fit when

  • Analytics live outside PostHog; the plugin works only with it.
  • The agent must not be allowed to change flags and experiments in production.
  • Offline use without sign-in is needed; every tool works through the PostHog cloud.

Example request

Show which errors over the last 24 hours affected the most users and suggest which to fix first. Do not change flags or experiments.

Limitations

A PostHog account is required, and sign-in uses OAuth in a browser. Tools create and change feature flags, experiments and dashboards in your project, so changes touch a live product. In Codex the hook approves only known read operations. Codex with approval policy `never` and full access passes calls before the hook, so the checks do not run. In Cursor session capture and the write guard do not apply. Sending Claude Code sessions to LLM Analytics transmits prompts and outputs on exit unless `POSTHOG_LLMA_PRIVACY_MODE` is enabled.

How to disable. In Claude Code run `claude plugin uninstall posthog`. Remove the `POSTHOG_LLMA_*` variables from `settings.json` and revoke the OAuth access in PostHog settings.

FAQ

How do I install the plugin in Claude Code?

With `claude plugin install posthog` or through the marketplace: `claude plugin marketplace add PostHog/ai-plugin`, then `claude plugin install posthog@posthog`. Afterwards sign in via OAuth through `/mcp`.

How do I install it in Codex or Gemini CLI?

For Codex: `codex plugin marketplace add PostHog/ai-plugin` and install through `/plugins`. For Gemini CLI: `gemini extensions install https://github.com/PostHog/ai-plugin`.

How do I send Claude Code sessions to LLM Analytics?

Add `POSTHOG_LLMA_CC_ENABLED=true` and `POSTHOG_API_KEY` to `settings.json`. A session is sent on exit, and `POSTHOG_LLMA_PRIVACY_MODE=true` redacts prompt and output content.

Can I install session capture only?

Yes, the `posthog-telemetry@posthog` plugin registers one `SessionEnd` hook and nothing else. Install it instead of `posthog`, not together, or sessions upload twice.

What can I ask?

About feature flags, experiments and their results, dashboards, funnels and signups, errors over the last day and survey responses. The README has examples.

Discussion

No questions or reviews yet.

Plugins
Official

The official PostHog skills marketplace for Claude Code: analytics integration, feature flags, error tracking and LLM analytics

PluginExtended access79Repository stars
Official

Humblytics MCP gives an agent live site analytics, funnels and A/B tests plus 12 marketing skills for finding conversion problems.

MCP serverExtended access85Repository stars
Official

A plugin with an MCP server and skills: Claude Code crawls a site, finds broken links and SEO and GEO errors and suggests fixes.

PluginExtended access123Repository stars

All-In-One Free SEO Tool

All-In-One-Free-SEO-Tool

A self-hosted SEO suite with an MCP server and five skills for audits, keywords and site fixes in Claude Code and Cursor.

PluginBroad access126Repository stars

A free Claude Code plugin for SEO, AEO and GEO: site audit, content planning, schema markup, link checks and llms.txt.

PluginExtended access80Repository stars
Official

HitKeep is open source cookieless web analytics in one binary with a read-only MCP server that gives assistants aggregate data.

MCP serverExtended access106Repository stars

README in short

The plugin is built for several clients: manifests for Claude Code, Codex, Cursor, Gemini CLI and Antigravity sit side by side and skills sync from a common source. A hook checks write calls.

README badge

Report a problem