Prerequisites
- A PostHog Cloud account (US or EU) with access to the project you want CloudThinker to read. Self-hosted PostHog isn’t supported: the connection only reaches PostHog’s US and EU clouds.
- Permission to create a personal API key in that account.
- A project that is receiving events. A project with no events gives empty answers, not a broken connection.
Setup
1
Create a personal API key in PostHog
In PostHog, open your account settings (personal API keys belong to your user, not to the project settings), go to Personal API keys, and click + Create a personal API Key. Label it
CloudThinker.2
Choose the MCP Server preset
Select the MCP Server preset. It scopes the key to one project. Before you create the key, review the scopes the preset selects, and clear any write scopes you don’t want CloudThinker to have. If you pick scopes by hand, choose only the areas in Required permissions.
3
Copy the key
Copy the key value (it starts with
phx_). PostHog shows it once and hides it after you refresh the page.4
Connect in CloudThinker
In the sidebar, click More → Workspace settings → Connections, stay on the Builtin Connections tab, and select PostHog. Paste the key into POSTHOG_PERSONAL_API_KEY, pick your POSTHOG_REGION, and click Connect. CloudThinker tests the connection by opening a session with PostHog’s MCP server for that region.Success state: the PostHog connection shows a Connected status. Run the verify prompt below to confirm the key reads your project.
Verify the connection
Connection details
A key belongs to one PostHog cloud. Sent to the other region, it fails with an invalid-key error. One connection works with one active project; to cover a second project, add a second PostHog connection with its own key.
Required permissions
A personal API key carries per-resource scopes, such asinsight:read. CloudThinker can’t reach anything the scopes leave out.
Agent capabilities
Example prompts
Write access
PostHog serves its whole tool surface through one command tool, and that tool can reach every change PostHog allows. CloudThinker therefore treats every PostHog call as a write, including calls that only read. Every change an agent makes goes through your workspace’s Approvals first. On the default Auto · Rules + AI · Ask me mode, AI judgment can let a safe change run without asking — and an Allow Rule can too, once CloudThinker turns on Rule enforcement for your workspace. Choose Manual to approve every change yourself. Choose Manual so a person approves every PostHog call, read or write. Because PostHog has one command tool, no Rule can tell a PostHog read from a write — so once CloudThinker turns on Rule enforcement for your workspace, an Allow Rule for PostHog calls would let feature flag changes through as well.Troubleshooting
Every call fails with an invalid-key error
Every call fails with an invalid-key error
The key comes from the other PostHog cloud, or it was revoked. Set POSTHOG_REGION to match the host you sign in to. If that’s already right, create a new key and update the connection.
CloudThinker reads the wrong project
CloudThinker reads the wrong project
One connection has one active project. Ask
Which PostHog project is active? to check. To change it, ask CloudThinker to switch projects: the switch shows up as an approval prompt. Or add a second PostHog connection with a key for the other project.A read paused for approval
A read paused for approval
Expected. CloudThinker treats every PostHog call as a write, so reads can pause too. See Write access for what each Approval mode does with PostHog calls.
Calls fail with 429 after heavy use
Calls fail with 429 after heavy use
PostHog returned a 429 rate-limit error. PostHog rate limits are shared across all users and keys in your organization. Wait for the limit to reset, then ask a narrower question so CloudThinker reads less.
I lost the key value
I lost the key value
PostHog shows a personal API key once. Create a new key and update the connection.
Security
- Least privilege — grant only the permissions the agents need for your use case; start read-only and widen later.
- Read-only by default — use read-only credentials unless you want agents to make changes through this connection.
- Rotate credentials — rotate keys and tokens on your normal schedule; CloudThinker picks up the new value when you update the connection.
- Revoke on offboarding — remove the credential at the provider when you delete a connection or a teammate leaves.
- Treat the key like a password: a personal API key can act as your PostHog user within its scopes. Use the MCP Server preset and keep the key for CloudThinker only, so you can revoke it alone.
- Project token stays out of chat: CloudThinker reads project details through a path that drops the project’s ingestion token, so the token never appears in a conversation.
Related
Sentry Connection
Investigate application errors and performance in Sentry
Approvals
Decide which connection writes run without asking you