Suggest a server AI tools directory →

PostHog MCP server

Last verified: 2026-09

Events and insights from PostHog.

Community Cloud & infra Needs a secret Claude Desktop, Cursor, Windsurf, Claude Code

What it does

Official PostHog MCP. Product analytics, feature flags, and project data through a personal API key. The README is short — connect and list tools, or use their hosted install.

It sits in Cloud & infra: Most of these are admin APIs.

Good for

  • Read one insight you already have, not 'dump all events'.
  • Inspect a feature flag on staging.
  • Keep flag-write off production cohorts.
  • Set POSTHOG_HOST if you are not on US cloud.

Tools

  • insights / flags / project tools — Read (and maybe write) analytics. Confirm names after connect.

Config (Claude Desktop / Cursor / Windsurf)

Paste the JSON below. Same mcpServers shape. Replace placeholder paths and secrets. Windows paths look like C:\\Users\\you\\project, not /path/to. Host-side steps →

Claude Desktop

OSConfig file
macOS~/Library/Application Support/Claude/claude_desktop_config.json
Windows%APPDATA%\Claude\claude_desktop_config.json (usually C:\Users\<you>\AppData\Roaming\Claude\)
Linux~/.config/Claude/claude_desktop_config.json

Cursor

ScopemacOS / LinuxWindows
This project.cursor/mcp.json in the repo root
This user~/.cursor/mcp.json %USERPROFILE%\.cursor\mcp.json

Windsurf

OSConfig file
macOS / Linux~/.codeium/windsurf/mcp_config.json
Windows%USERPROFILE%\.codeium\windsurf\mcp_config.json
{
  "mcpServers": {
    "posthog": {
      "command": "npx",
      "args": [
        "-y",
        "posthog-mcp"
      ],
      "env": {
        "POSTHOG_API_KEY": "phx_...",
        "POSTHOG_HOST": "https://us.i.posthog.com"
      }
    }
  }
}

Windsurf remote MCP: use serverUrl instead of url if the block below is HTTP.

One-liner: npx -y posthog-mcp

Secrets it wants: POSTHOG_API_KEY, POSTHOG_HOST

Source repo →

How to get started

  1. Create a PostHog personal API key with the smallest scopes. Set POSTHOG_HOST if you are not on app.posthog.com.
  2. Ask for one insight you already know exists.
  3. Do not give flag-write on production until you have seen the tool list.

Access risk

Analytics export is user behavior. Feature-flag write changes production cohorts.

When to skip it

Skip it for Datadog infra metrics or for Stripe billing events.

Instead: Datadog, Grafana, Stripe.

Vs alternatives

ServerOfficial?Needs a secret?Best for
PostHogNoYesEvents and insights from PostHog.
DatadogNoYesMetrics, logs, and monitors.
GrafanaNoYesDashboards and datasources.
StripeNoYesLook up customers, payments, and products.

More in Cloud & infra

All 15 in this category →

FAQ

Which key?

A personal API key with the smallest scopes. Analytics export is user behavior.

Can it change flags?

If the connected tools include flag write, yes — that changes production cohorts.

PostHog or Datadog?

Product analytics vs infra. Different questions.

Official?

Yes — PostHog/mcp. README is short; list tools after connect.