Skip to main content

Connect PostHog to Claude Code and ChatGPT, read only

Let Claude Code, ChatGPT and Codex query your PostHog data without letting them flip flags or edit dashboards. One sign-in, one set of rules for every app.

By Troy FortinUpdated 3 min read

I check our numbers through my AI apps now. How many people read a page this week. Which page they came from. Whether a sign-up started on a guide or on the home page. I ask an agent, and it asks PostHog.

What I didn't want was an agent that could flip a feature flag or rebuild a dashboard because it misread what I asked. So here's how I set it up. Every app can ask PostHog questions. None of them can change anything without me.

Why not paste a PostHog key into each app

You can. PostHog has a personal API key and its own MCP server, and most AI apps take one or the other.

The trouble starts with the second app. Now the key sits in two config files. Then three. Each app has its own idea of what it may do with it, and none of them tells you what the others did. If you want to take access away, you rotate the key and fix every app at once.

I wanted one sign-in, one set of rules, and one record of what every app asked.

Step 1. Connect PostHog in Kin

In Kin, open Access, choose Connect a service, pick PostHog and sign in on PostHog's own page. Kin uses PostHog's MCP server and keeps the sign-in. No app ever sees it.

Step 2. Pick Read only, or keep Ask me for changes

Open the connection and choose a level.

Read only lets every app look and never change. Every PostHog action that changes something is blocked for every app.

Ask me for changes is the default. Reads run, and anything PostHog marks as a change waits for your yes.

I use Ask me. A few PostHog actions that only compute, like running a dashboard's insights, come marked as changes, and I set those to Allow one at a time. You can do the same on any single action.

Step 3. Add Kin to Claude Code, ChatGPT and the rest

Each app adds one address, https://app.kinlab.ai/mcp, and signs in to Kin. The steps for Claude Code, ChatGPT and Codex are in the docs. Once an app is in, it sees the PostHog actions your rules allow and nothing else.

Step 4. Ask it something real

Try "How many page views did the blog get this month, by page?" or "Which pages did people see before they signed up last week?"

The app writes the HogQL and runs it through Kin. Kin holds each SQL call to one SELECT. When one of my agents sent a query that started with SHOW, Kin refused it and nothing reached PostHog.

What you get on top

Every call lands in Kin's Activity, with the app, the account, the action and how your rules answered. If something looks off, you can pause every AI app at once.

And it isn't only PostHog. Connect GitHub, Stripe or Notion the same way and every app gets them under the same kind of rules. That's what I mean by one plug for all your AI.

Which plan do I need?

Any plan. Connecting PostHog, rules, approvals and Activity are on every plan, Lite included. Pro adds more connections and AI apps, and every plan starts with a 14-day trial.

Questions

Does PostHog have an MCP server?
Yes. PostHog runs its own MCP server, and Kin connects to it when you sign in to PostHog in Kin. Your AI apps then reach PostHog through Kin, under your rules.
Can my AI app run SQL on PostHog without changing anything?
Yes. Kin treats PostHog's query tools as reads and holds each SQL call to a single SELECT. A query that starts with anything else is refused before it reaches PostHog.
Does Claude Code get my PostHog sign-in?
No. Kin keeps the sign-in and makes each call for the app. The app holds only its own Kin sign-in, which you can remove at any time.

Try Kin yourself

Try Pro free

Their models. Your rules.

14 days free.