PostHog MCP: Connecting Your Product Analytics to Claude, Cursor and Codex
You connect your PostHog account to your assistant (Claude, Cursor, Codex, VS Code and others) once; then you write "what are the top 5 errors this week?" or "where do we lose people in the signup funnel?" PostHog's official MCP server runs queries in your project with your permissions, summarizes errors and experiments, and, if you ask, also creates feature flags, experiments and dashboards. The server runs on PostHog's own servers and nothing is installed on your computer. It connects with one click from the directory in Claude and with one command in Claude Code. Because write tools change a live project, a session can be limited to read-only.
- What it does
- Lets your assistant query product data and create flags and experiments
- Type
- Connector (remote MCP hosted by PostHog)
- Made by
- PostHog (official)
- Where
- Claude, Claude Code, Cursor, Codex, VS Code
- Writes
- Flags, experiments, dashboards; delete tools too
- Data region
- US or EU, picked from your account
- Price
- MCP is free; PostHog charges by usage
What Is PostHog MCP For?
PostHog is a product analytics service you add to your app or website to see what users do: which page was visited, at which step users dropped off, how many people a given error hit. Looking at those numbers means hopping between dashboards. PostHog MCP lets you ask your assistant instead: you write "who signed up but didn't finish the first step?" and the assistant runs a real query in PostHog and explains the result.
MCP is the common standard that lets an AI assistant connect to an outside service. PostHog's server sits in the middle of that bridge: the assistant passes the request to the server, the server asks your project with your PostHog permissions and brings the answer back.
Write tools change your project; delete tools exist too.
Who it helps: software teams building an app or website, product managers asking which feature gets used, SaaS founders. For example, the developer of an online shop has the errors on the payment page listed from the editor and the stack trace read out; a marketing lead asks "how many signups did we get on Monday?" without opening a dashboard; a team has a flag created that opens the new checkout flow to 20 percent of users.
How Does PostHog MCP Work?
› execute-sqlA read or write toolAccording to PostHog, the server doesn't store your analytics data: queries run in your PostHog project and the result goes straight back to the assistant. Authorization uses the server's own OAuth screen; you don't have to create an API key, which is only a route for clients without OAuth support.
To avoid loading a huge number of tools into the assistant's context window, the server runs in two modes. In most clients (Claude, Claude Code, Cowork, Codex) the default is "CLI mode": there is a single exec tool, and the assistant uses it to search for tools, look at their schema and call them. In clients that handle long tool lists well, such as Cursor, tools are registered one by one. The mode is detected from the client; you can change it with ?mode=cli or ?mode=tools.
What Do You Type, What Do You Get? Sample Prompts
The requests are adapted from the examples on PostHog's "use cases" page; the output is described only as far as the documentation describes it.
For flag and experiment requests, ask the assistant to say what it will do first. Make your first attempts with a read-only connection (see "What can it access?").
How Do You Connect PostHog MCP? Steps by Assistant
There's nothing to install on the PostHog side. If you don't have an account, first create a free one at PostHog. When you connect, a PostHog sign-in opens in the browser; the server picks the US or EU region from the account you sign in with.
- In Claude, open Customize then Connectors, find PostHog in the directory and click Connect.
- When prompted, sign in to PostHog and approve access.
- Write what you want to ask PostHog in a chat; confirm in the chat tools menu that the connector is on.
PostHog's documentation describes the connector with the path "Settings > Connectors"; the current Claude path is Customize then Connectors. If you added PostHog to your team as an admin, your own account still isn't connected: if the connector shows "Remove from your team" instead of "Connect", each member connects their own account separately. On Claude Team and Enterprise, the Owner first enables the connector for the organization.
› claude mcp add --transport http posthog https://mcp.posthog.com/mcp -s userThe command adds the server at user scope. On first use you are asked to sign in to PostHog; inside Claude Code you can see the connection status with /mcp.
› claude plugin install posthogPostHog's Claude Code plugin adds the same MCP tools and brings two hooks: a gate that asks for approval before write tools (it asks on sensitive writes such as deletions) and, only if you turn on two environment variables yourself, an end-of-session hook that sends Claude Code sessions to PostHog's AI analytics. After installing the plugin you sign in through the browser with /mcp.
PostHog has a setup page for each of Cursor, Codex, VS Code, Windsurf and Zed. The documentation also has a wizard that installs with one command:
› npx @posthog/wizard mcp addIf your client doesn't support OAuth, you create a personal API key at PostHog with the "MCP Server" preset and pass it as a header (the example from the documentation, for Cursor):
› {
"mcpServers": {
"posthog": {
"url": "https://mcp.posthog.com/mcp",
"headers": {
"Authorization": "Bearer phx_your_api_key_here"
}
}
}
}Don't share the API key or commit it to a repository; the key is scoped to a project, so pick only the project you need.
Which Tools Does PostHog MCP Offer?
PostHog's tools reference lists tools in 72 categories as of November 23, 2026, and the category counts add up to about 1,320; the Claude connector directory shows 57 tools. The two numbers differ and the list changes fast; for the current list, list the tools in your client or check PostHog's tools reference. Tool names are stable and can be used with the tools parameter to narrow a session to certain tools.
| Category | Tool count | What for |
|---|---|---|
| Error tracking | 35 | List error groups, read stack traces, mark an issue resolved, write assignment rules |
| Feature flags | 33 | Create, update and delete flags |
| Experiments | 51 | Set up an A/B experiment and read its results |
| Product analytics and insights | 18 + 3 | Trend, funnel and path queries; create insights |
| Dashboards | 19 | Create dashboards, add insights, delete them |
| SQL and data warehouse | 28 (+ 1 SQL) | Run HogQL and SQL (execute-sql), manage tables |
| Logs and session replays | 24 + 9 | Query logs and look at recordings |
| Surveys, persons, workflows | 11 + 7 + 61 | Manage surveys, read and delete person records, build workflows |
| CDP destinations and functions | 14 + 2 | Set up and test destinations such as Slack |
!This table is picked from the category headings in the tools reference; categories change over time. PostHog's documentation says some tools use a language model: those are listed only if the organization admin has turned on PostHog AI data processing, and they can be billed as PostHog AI spend.
Which Assistants Does PostHog MCP Work With?
| ClaudeYes | As a directory connector, on the Claude Desktop page and on the web. |
|---|---|
| Claude CodeYes | One command or the plugin. |
| Cursor, VS Code, CodexYes | PostHog has a setup page for each client. |
| Windsurf, Zed, PostHog DesktopYes | Listed on PostHog's MCP overview page. |
| Lovable, Replit, v0Yes | PostHog gives separate integration pages for these platforms. |
| ChatGPTUnclear | PostHog's documentation gives no separate setup page for ChatGPT; it says it "works with any MCP-compatible client." Check in ChatGPT's settings whether it can connect to a remote MCP server. |
What Can PostHog MCP Access and Change? Read-only Mode
- Events, properties, insights, dashboards
- Flags, experiments, surveys, error records, logs
- Session recordings, person and group records, data warehouse tables
Creates and updates flags, experiments, surveys, dashboards, insights, alerts, notes and actions; marks an error issue resolved and writes assignment rules; sets up CDP destinations and workflows; writes email templates. The examples in the documentation also include enabling a workflow and linking an issue to a Jira record. An enabled workflow or a CDP destination you set up goes live and can send messages and data to your users or to outside targets such as email or Slack; ask the assistant for confirmation before enabling it.
The tools reference has delete tools: dashboards (dashboard-delete), person records (persons-bulk-delete), flags, alerts, notes and more. The reference doesn't describe a separate way to undo.
With the permissions of the PostHog account you sign in with. It works in the projects that account can reach; the assistant can switch to another project (switch-project).
!If the assistant misreads a request, it can switch a live feature flag on or off or write to the wrong project; so in the first days make the connection read-only, and have it show the list before deletions and bulk changes. PostHog also asks you to review tool calls before they run.
Four ways to narrow permissions (PostHog docs)
Read-only: if readonly=true is added to the server address (or the header x-posthog-read-only: true), the tools that create, update and delete data are removed from the list.
› https://mcp.posthog.com/mcp?readonly=trueTool filter: a parameter such as features=flags,dashboards,insights opens only the tools in those categories; tools= also takes individual tool names.
Project restriction: on the OAuth screen choose "Projects" under "Organization & project access" and tick only the projects the assistant should reach; other projects are refused with a 403. With a personal API key, use a project-scoped key.
Approving writes separately: with split_writes=true, exec-read and exec-write are listed instead of exec; your client can always allow one and ask every time for the other.
Rate limit: before a request reaches the PostHog API, the server applies its own limit: 480 requests a minute and 4,800 an hour per credential (an OAuth token or a personal API key). Over the limit you get a 429 with a Retry-After header; opening a session and asking for the tool list count too.
Where Does the Data Go? EU and US Region
PostHog's authentication server routes you to the US or EU region based on the account you sign in with. An account in each region needs its own connection; with one account in the EU and one in the US you set up two connections.
According to PostHog, the MCP server doesn't store your analytics data; the query runs in your project and the result goes to the assistant.
Query results enter the chat and are subject to the data settings of the assistant's company. Product analytics can carry personal data such as person profiles and session recordings; data-protection duties such as KVKK are yours. Claude's pricing page shows the model training row as "Opt-out" for Free, Pro, Max and Ultra; check your chat setting.
Some tools that use a third-party language model internally are listed only if the organization admin has turned on PostHog AI data analysis (Settings then Organization then General).
Source: PostHog MCP FAQ, the PostHog AI access page, claude.com/pricing, November 23, 2026. This is not legal advice.
Is PostHog MCP Free? Which Plan Do You Need?
According to PostHog, connecting to the MCP server and calling its tools is free. The data you query counts toward PostHog's normal usage bill; on the free plan each product has a monthly free allowance. Some tools that use a language model internally can be billed as PostHog AI spend. On the Claude side, web connectors are available to all users according to Anthropic. Enterprise-managed authorization (bulk connection through your identity provider) needs the Scale or Enterprise platform add-on at PostHog, and a Team or Enterprise plan and the Owner role in Claude.
- Product analytics: 1 million events a month
- Session replay: 5,000 recordings a month
- Feature flags: 1 million requests a month
- Surveys: 1,500 responses a month
- 1 project, 1 year of data retention
- Usage above the free allowance
- 6 projects and 2-year retention
- The same monthly free allowance on every product
- Above that, by usage; the unit price drops as volume grows
- 6 projects, 2-year retention
- Email support
There are no per-seat charges. The pricing page doesn't mention MCP separately; the numbers above are from the general plan summary. For example, in product analytics the price after the first 1 million events starts at $0.00005 per event.
Source: posthog.com/pricing, November 23, 2026. PostHog has no Turkish price page or TL price; paying by card from Turkey isn't clear in the official sources. This is not financial advice.
Official pricing page last checked on .
Does It Work in Turkish?
| PostHog interfaceUnclear | PostHog's documentation doesn't mention a Turkish interface option; check the interface language list in PostHog's settings. |
|---|---|
| Turkish requests and repliesUnclear | The reply language depends on the assistant; PostHog's MCP documentation says nothing specific about Turkish. Your event and property names can be in Turkish. |
| MCP documentationNo | The documentation is in English. |
Common Problems and Fixes
| What happens | What to do |
|---|---|
| The connector shows "Remove from your team" instead of "Connect" | PostHog was added to your team but your account isn't connected. In Claude's settings click Connect on PostHog and sign in. |
| A 429 error | You went over the rate limit (480 a minute, 4,800 an hour per credential). Wait the Retry-After time; if you keep hitting it, use batch exports or endpoints. Each client session also spends requests before any tool call. |
| Tools that use a language model are missing | The organization admin may not have turned on PostHog AI data analysis: Settings then Organization then General. |
| I signed in but no project is found | The region (US or EU) of the account you signed in with may not match the project's region; each region's account needs its own connection. |
| The assistant works in the wrong project | Pin the connection to the project (the project_id parameter or the x-posthog-project-id header) and limit projects on the OAuth screen. Pinning is not an access limit, only the starting project. |
| It mixes up several accounts | Add a separately named server entry for each account; take care not to authorize all of them with the same account through OAuth. A personal API key ties each entry to one account. |
For help, use PostHog's questions page and in-app support; the documentation recommends reviewing tool calls before they run (a prompt-injection risk).
How Do You Disconnect It?
- Claude: find PostHog under Customize then Connectors and disconnect it.
- Claude Code: remove the server with
claude mcp remove posthog; if you installed the plugin, remove it from the/pluginmenu. - If you used an API key: invalidate the old connection by deleting the personal API key in PostHog.
After you disconnect, the flags, experiments and dashboards the assistant created in PostHog stay where they are.
Related Tools in the Atlas
Frequently asked questions
What is PostHog MCP?
The official MCP server hosted by PostHog. It opens your PostHog project to assistants such as Claude, Cursor, Codex and VS Code with your permissions: it queries events, summarizes errors and experiments, and creates flags, experiments and dashboards. The server runs at PostHog and needs no installation.
How do I connect PostHog to Claude?
In Claude, open Customize, then Connectors, find PostHog in the directory and click Connect; sign in to PostHog. If it was added to your team but isn't connected, click Connect on the connector yourself. On a team account, the Owner first enables the connector for the organization.
What is the PostHog MCP server URL?
The address is https://mcp.posthog.com/mcp. PostHog's authentication server picks the US or EU region from the account you sign in with.
Can I use PostHog MCP in Claude Code?
Yes. You can add the server with the claude mcp add command from the PostHog documentation, or install the plugin with claude plugin install posthog; then sign in through the browser with /mcp. The plugin also brings a hook that asks for approval before write tools.
Is PostHog MCP paid?
According to PostHog, connecting to the MCP and calling its tools is free. The data you query counts toward your PostHog usage bill; on the free plan each product has a monthly free allowance (for example 1 million events a month). Some tools that use a language model internally can be billed as PostHog AI spend.
Can PostHog MCP delete my data, and is it safe?
It works with your PostHog permissions; delete tools exist (for example for dashboards and person records). You can narrow permissions by adding readonly=true to the server address or by limiting projects on the OAuth screen. Review the assistant's tool calls before they run and have it show the list before deleting.
Does PostHog MCP keep data in the EU region?
The server routes you to the region of the account you sign in with (US or EU) and, according to the documentation, doesn't store your analytics data; the query runs in your project. The results do pass into the chat and are subject to the assistant company's data settings. EU and US need separate connections.
Related guides
Sources
- PostHog docs: Model Context Protocol
- PostHog docs: PostHog MCP for Claude Desktop
- PostHog docs: PostHog MCP for Claude Code
- PostHog docs: MCP FAQ and advanced setup
- PostHog docs: MCP tools reference
- PostHog docs: MCP use cases
- PostHog docs: Enterprise-managed authorization for Claude
- PostHog docs: Allow PostHog AI access
- PostHog pricing
- PostHog/ai-plugin (Claude Code plugin)
- Claude connector directory: PostHog
- Using connectors (Claude, general)
- Claude pricing (model training row)
Not clear in the official sources: The tool count (the Claude directory shows 57, the tools reference counts about 1,320) · whether it connects to ChatGPT (the documentation only says "any MCP-compatible client") · a Turkish PostHog interface (check PostHog's language settings) · paying by card from Turkey and a TL price. Each is covered in its section, along with what you can do.
You can do it yourself; if you’d like support
The guide is free and needs no sign-up; you can follow the steps here yourself. If you’d like professional support at some point, choose the option that fits your needs. This doesn’t affect the rankings in the guide.





