← Back to articles

Connecting PostHog

Published August 3, 2026 · Written by Aanart

PostHog connects differently to every other source in SourcetoMCP: instead of signing in through a Google- or Meta-style consent screen, you generate a personal API key inside PostHog and paste it in. It takes about two minutes.

Before you start

You'll need a SourcetoMCP account with at least one brand created, and access to a PostHog account (Cloud or self-hosted) with at least one project you want to connect.

1. Start the connection in SourcetoMCP

  1. 1From your dashboard, go to ConnectorsAdd a connection.
  2. 2Find the PostHog card and select Connect.
  3. 3Choose where your PostHog account lives: PostHog Cloud (US), PostHog Cloud (EU), or Self-hosted(if self-hosted, you'll also need your instance's URL, e.g. https://posthog.yourcompany.com). If you're not sure which cloud region you're on, check the URL you use to log into PostHog itself.

2. Generate a personal API key in PostHog

Keep this tab open, and open PostHog in another one.

  1. 1In PostHog, open your account menu (top left) → Settings.
  2. 2Go to Personal API Keys, then select + Create personal API key.
  3. 3Give it a label you'll recognise later, e.g. SourcetoMCP.
  4. 4Scope it to read-only access for the projects you want to connect. SourcetoMCP only ever reads from PostHog, so a key with write access is more than it needs. Narrower is safer.
  5. 5Save, then copy the key. It starts with phx_ and is only shown once.

3. Finish connecting

  1. 1Back in SourcetoMCP, paste the key into the Personal API key field.
  2. 2Select Connect PostHog. This verifies the key against PostHog directly.
  3. 3Choose which project(s) to connect, then confirm.

Connected projects then appear on your Connections page like any other source.

Troubleshooting

“That API key was rejected”: the key is wrong, was revoked, doesn't have project read access, or was created under a different host/region than the one you selected. Double-check the region and generate a fresh key if needed.

“Couldn't reach PostHog at that host”: only shown for self-hosted instances. Confirm the URL is correct, includes https://, and is reachable from the internet (not just your local network).

No projects showing up: the key is valid but can't see any projects. Confirm the PostHog user the key belongs to is actually a member of the project(s) you expect.

Revoking access

You can disconnect PostHog from your Connections page at any time. For extra certainty, you can also delete the personal API key directly in PostHog under Settings → Personal API Keys. Either side revokes access.

Still stuck?

Reach us at [email protected].