← All tips
FREEMCP server

PostHog MCP prompt

INSTALL PROMPTPASTE INTO CLAUDE CODE
Set up the PostHog MCP server in my Claude Code so you (Claude Code) can read my
product's real analytics - what users actually do, which features land, and where
they drop off - instead of me guessing what to build next. It's a free, hosted
server and works in every project.

Safety first: check whether an MCP server for PostHog is already configured - run
`claude mcp list` and look for "posthog". If one already exists and points at
https://mcp.posthog.com/mcp, tell me, change nothing, and skip to the verify step.
Never overwrite my existing config.

(If a bare `claude ...` command is blocked inside this session, re-run just that
command with CLAUDECODE cleared: `CLAUDECODE= claude ...` on macOS/Linux, or
`$env:CLAUDECODE=''; claude ...` in PowerShell.)

STEP 0 - Make sure I have a PostHog account. PostHog is free to start (generous
free tier, no credit card). If I don't already have one, tell me to sign up at
https://posthog.com first and come back - I need to be logged in for the connect
step.

STEP 1 - Add the server. It's free and hosted, and needs NO API key - you
authenticate with a browser login, not a pasted secret. Use USER scope so it works
in every project:

  claude mcp add --transport http posthog https://mcp.posthog.com/mcp -s user

STEP 2 - Connect it. Tell me to run `/mcp` in this session and choose "posthog" -
a browser window opens to log in to PostHog and authorize the connection. PostHog
auto-routes me to my data region (US or EU) based on the account I log in with, so
the URL is the same either way - I don't change it for EU.

STEP 3 - Verify it actually works. Once I've authorized, run `claude mcp list` and
confirm "posthog" shows as connected. Then, as a real test, ask PostHog for
something small from my account - for example list my projects, or pull a recent
insight or a few recent events - so we both see you reading real analytics. Tell me
what you found.

If the browser login doesn't appear or the connection fails, the usual fixes are:
confirm I'm logged in to PostHog in that browser, re-run `/mcp` and choose
"Reconnect", and make sure my Claude Code is up to date (`claude update`). Walk me
through these one at a time rather than dumping them all at once.

When you ship a new feature, you usually have no idea what happens to it. Did people find it? Use it? Get confused and leave? You can't see any of it, so you ship the next thing on a gut feeling - and Claude Code is flying just as blind as you are, writing code with zero idea of how the product is actually being used.

PostHog MCP fixes that. PostHog is a free product-analytics tool, and its MCP server connects that real analytics data straight into Claude Code. Once it's wired in, Claude can pull the actual numbers about your product - which features get used, where people drop off, what's quietly broken - and answer from real insight instead of guesses. So instead of "what should I build next," you ask "where are people leaving and what needs fixing," and Claude reads the data and tells you.

It's free and there's no API key to paste - you authorize it with a quick browser login, and PostHog sends you to your own region (US or EU) automatically. The prompt below adds the server at user scope so it works in every project, checks whether you've already got it before changing anything, connects it, and verifies Claude can read your analytics at the end - all in about 30 seconds.