Skip to main content
TerminalSync
Connectors

PostHog

Your product analytics, within reach of the agent

Ask your product analytics in plain language

Official PostHog server: feature flags, insights, experiments, and error tracking.

PostHog is the product analytics platform your team uses to see how people actually use your app: events and funnels, feature flags, A/B experiments, dashboards, and error tracking, all in one place. The official connector, published by PostHog, is a hosted MCP server (https://mcp.posthog.com/mcp) that acts as a proxy to your PostHog instance — it turns what you ask into calls against your project and returns the results directly to your AI client.

Ask "How many unique users signed up in the last 7 days, broken down by day?" and the query-run tool executes a trends query and answers with daily counts. Say "Create a feature flag called 'new-checkout-flow' that's enabled for 20% of users" and it creates the flag and shows the configuration. It talks to PostHog with your personal API key, so it can do what that key is allowed to do in your account.

What you can ask

  • "Create a feature flag called 'new-checkout-flow' that's enabled for 20% of users, and show me the configuration."
  • "How many unique users signed up in the last 7 days, broken down by day?"
  • "Create an A/B test for our pricing page that measures conversion to the checkout page."
  • "What are the top 5 errors in my project this week and how many users are affected?"

For simpler queries you can use shorter prompts, straight from the README: "What feature flags do I have active?", "Show me my LLM costs this week", "List my dashboards", "What events are being tracked?"

What token you need

You need a PostHog personal API key — the key that lets software act on your PostHog account.

  1. Sign in to PostHog and open the personal API keys settings with the MCP Server preset.
  2. Create the key with that preset — it sets the scopes the MCP server needs — then copy it.
  3. Paste it when the Lab asks for POSTHOG_API_KEY. It's stored encrypted in your Keychain, and injected as the Authorization: Bearer header (POSTHOG_AUTH_HEADER) the server expects.

Honest disclosure, straight from PostHog's docs: this is a hosted/remote server, not a local one — it runs in PostHog's US and EU Kubernetes clusters and stores session state (your active project/organization) in the region you connect to, cached temporarily and keyed by your API key hash. A stateless Cloudflare Worker sits in front of it only to authenticate requests and route them to your cloud region; "it does not store any sensitive data." The server "acts as a proxy to your PostHog instance. It does not store your analytics data — all queries are executed against your PostHog project and results are returned directly to your AI client." What the agent can read or change is bounded by your personal API key's scopes. EU users should use the mcp-eu.posthog.com endpoint so OAuth flows route to the EU instance.

Add to Terminal Sync

We open the app and set it up in Claude Code (and your other Macs).

Don't have Terminal Sync yet?Download

How it works with Terminal Sync

Set up the connector once on one machine. Terminal Sync keeps your claude_desktop_config.json encrypted in your Drive, so on any other machine where you open Claude Code, the connector is already there.