
PostHog is the one source in SourcetoMCP with no consent screen. You generate a personal API key inside PostHog, paste it in, and then add SourcetoMCP as a custom app inside ChatGPT's developer mode. For what your agent can query once both halves are done, see the PostHog MCP server page.
Before you start
You need a SourcetoMCP account with a brand created, a PostHog account (Cloud or self-hosted) with at least one project, and a ChatGPT account on a Pro, Plus, Business, Enterprise or Education plan. Custom MCP connectors run through developer mode, which works on ChatGPT on the web only.
Start the connection in SourcetoMCP
- 1From your dashboard, go to
Connectors→Add a connection. - 2Find the PostHog card and select Connect.
- 3Pick your region: PostHog Cloud (US), PostHog Cloud (EU), or Self-hosted with your instance's URL. The address you log into PostHog with tells you which one you are on.
Generate a personal API key in PostHog
- 1In PostHog, open your account menu (top left) → Settings.
- 2Go to Personal API Keys, then select + Create personal API key.
- 3Label it something you will recognise in six months, e.g.
SourcetoMCP. - 4Scope it to the projects you want, with read access to queries, persons and feature flags. Add write access to feature flags only if you want ChatGPT to be able to turn a flag on or off. Everything else works on a read-only key.
- 5Save and copy the key. It starts with
phx_and PostHog shows it once.
Finish connecting
- 1Paste the key into the Personal API key field back in SourcetoMCP.
- 2Select Connect PostHog, which checks the key against PostHog straight away.
- 3Choose your project(s) and confirm.
Add SourcetoMCP as a connector in ChatGPT
- 1In SourcetoMCP, open
Connect an agentfrom the dashboard sidebar and copy your server address (it looks likehttps://sourcetomcp.com/api/mcp). - 2In ChatGPT, open Settings, then Security and login, and turn on Developer mode. Custom MCP connectors sit behind this toggle, and it only appears on ChatGPT on the web.
- 3Open the Plugins menu and select the “+” button to create a developer-mode app.
- 4Enter the name
SourcetoMCP, paste in your server address, and pick OAuth as the authentication type. - 5Save. The app now sits under Drafts in your app settings, where you can switch individual tools on or off.
- 6The first time ChatGPT calls it, you'll be asked to sign in to SourcetoMCP and approve access. After that it reconnects on its own.
Switching individual tools off is useful here. If you gave the API key write access to feature flags but want a session that only reports, turn the flag-toggle tool off in the app's settings rather than issuing a new key.
Ask ChatGPT about your product data
A developer-mode app stays off until you pick it. Open the Plus menu, choose Developer mode, and select SourcetoMCP for that conversation. Naming the app in your question helps ChatGPT reach for the right tool.
The flagship operation writes HogQL, PostHog's own SQL dialect, so questions are not limited to a fixed set of report types. Try something like:
- 1
What are our top 10 pages by unique visitors this month? - 2
Compare week-one retention for users who saw the new onboarding. - 3
Find the person with this distinct id and show their properties. - 4
List the feature flags that are currently switched on.
A note on the one write action
Three of the four PostHog operations only read. The fourth turns a feature flag on or off and takes effect immediately against real users. ChatGPT asks you to confirm first and shows the JSON payload it plans to send, which for this operation is small enough to read properly: check the flag key and whether it says active true or false. The operation cannot create or delete a flag, and it never changes who a flag targets.
Troubleshooting
“That API key was rejected”: the key is wrong, was revoked, lacks project read access, or was created under a different host or region than the one you picked. Check the region first, then issue a fresh key.
Developer mode is missing from Settings: it is available on Pro, Plus, Business, Enterprise and Education accounts, and only on ChatGPT on the web. The mobile apps do not show it.
Reads work but toggling a flag fails: the key is read-only. Create a new one with write access to feature flags and reconnect.
ChatGPT says it can't find the tool or has no data: open the app's details page and use Refresh to pull the current tool list from the server, then confirm the project still shows under Active connections.
Revoking access
Disconnect the project from your Connections page, or delete the personal API key in PostHog under Settings → Personal API Keys, which cuts access no matter what SourcetoMCP thinks. Turning Developer mode off in ChatGPT hides every custom app at once without deleting any of them.
Still stuck?
Reach us at [email protected].