Skip to content
skillsaggregatorskillsaggregator
Privacy: This guide links directly to PostHog's credential pages. We never ask you to enter, store, or transmit any credential through this site. Zero outbound calls to anything but the vendor's docs.

PostHog MCP — Auth Setup

PostHog uses a personal API key and project ID to authenticate requests to your analytics data.

1. Get your credentials

  1. Open PostHog Project Settings (opens PostHog — we never see your key)
  2. Navigate to Project Settings > Personal API Keys and click Create personal API key
  3. Copy the key — it will not be shown in full again after you leave the page
  4. Your Project ID is shown at the top of the Project Settings page

2. Set environment variables

macOS / Linux — add to ~/.zshrc or ~/.bashrc:

export POSTHOG_API_KEY=YOUR_PERSONAL_API_KEY_HERE
export POSTHOG_PROJECT_ID=YOUR_PROJECT_ID_HERE

Then run source ~/.zshrc (or open a new terminal).

Windows — run in Command Prompt (then restart):

setx POSTHOG_API_KEY "YOUR_PERSONAL_API_KEY_HERE"
setx POSTHOG_PROJECT_ID "YOUR_PROJECT_ID_HERE"

3. Verify

npx claude-skills doctor

You should see ✅ next to the PostHog MCP entry. If you see ❌, confirm the key is set: echo $POSTHOG_API_KEY.

4. Restart Claude Code

Quit and reopen Claude Code (or run /mcp list inside Claude Code to confirm the PostHog MCP appears).