Skip to main content
Connect a PostHog project so CloudThinker can rank the errors hurting users, report on feature flags, insights, dashboards, and surveys, and answer usage questions with HogQL (PostHog’s SQL-like query language). The connection uses a PostHog personal API key, and the key’s scopes decide what CloudThinker can reach.

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

Your first PostHog prompt may pause for approval, even though it only reads. CloudThinker treats every PostHog call as a write. See Write access.
Success state: CloudThinker names your organization and active project and lists its flags, insights, dashboards, surveys, and tracked errors. A project with no flags or insights returns empty lists, not an error. An invalid-key error means the key or region is wrong; see Troubleshooting.

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 as insight:read. CloudThinker can’t reach anything the scopes leave out.
Start with read scopes only. Add write scopes, for example for feature flags, only if you want CloudThinker to propose changes there.

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.
A feature flag change affects real users as soon as it runs, and switching the active project changes which project the rest of the conversation reads. Check the exact inputs in the approval prompt before you approve.

Troubleshooting

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.
The key is missing that scope. PostHog hides tools the key can’t reach, which can look like a project with no flags or no errors. Open the key in PostHog, add the scope or create a new key with the MCP Server preset, then update the connection.
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.
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.
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.
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.

Sentry Connection

Investigate application errors and performance in Sentry

Approvals

Decide which connection writes run without asking you