How to connect Cursor to PostHog

Connect one PostHog project once in Ryze AI, add one MCP URL to Cursor, then ask Cursor about insights, dashboards, feature flags, cohorts and HogQL queries.

Your MCP URL
https://connector.get-ryze.ai/mcpAdd to Cursor

Copies the link and opens the Cursor install prompt for the ryze server. See the steps

See pricing

By Ira Bodnar, Ryze AI · Updated

Quick answer

To connect Cursor to PostHog, connect a PostHog project in Ryze AI with a personal API key and your PostHog host, then add https://connector.get-ryze.ai/mcp to Cursor with the Add to Cursor link or a url entry in mcp.json, and sign in when Cursor asks.

  1. In PostHog create a personal API key (phx_) with the Query and Insight scopes
  2. In Ryze AI open Integrations, click Connect on PostHog, paste the key, enter the host and pick the Project
  3. In Cursor add the Ryze AI server (Add to Cursor link or mcp.json) and finish the sign-in
  4. Start a new Cursor chat, approve the tool call and ask about your PostHog data

Before you start

  • A Cursor install. Cursor's MCP documentation names no plan for using MCP servers. On Enterprise, admins can control which MCP servers users may run in Team Settings > MCP Configuration, so a blocked server needs an admin to allow it.
  • A PostHog personal API key. It starts with phx_ and needs read access to the projects you want, including the Query and Insight scopes. Add write scopes only if Cursor should change insights, dashboards, feature flags or cohorts. You also need the host: https://us.posthog.com for US Cloud, https://eu.posthog.com for EU Cloud, or your self-hosted URL.
  • A Ryze AI workspace on a plan or free trial. Paid Ads is $89 per month with a 7-day free trial; the PostHog tools also work on SEO Starter ($129 per month, 3-day free trial) and Agency ($279 per month). Adding the connector is free, but the PostHog tools need an active plan or trial.

How to connect Cursor to PostHog

Two steps happen in PostHog and Ryze AI, two in Cursor, and one when you ask. The connector URL is the same for every user.

  1. Create a PostHog personal API key

    In PostHog go to Settings, Personal API keys and click Create key. Grant read access to the projects you want, with the Query and Insight scopes, add write scopes only for objects Cursor should change, and copy the phx_ key.

  2. Connect PostHog in Ryze AI

    Create a Ryze AI account or sign in, open Integrations, click Connect on the PostHog card, paste the key, enter the Host (US Cloud, EU Cloud or your self-hosted URL) and click Continue. Then pick the Project and click Save.

  3. Add the Ryze AI server to Cursor

    Either use the Add to Cursor link on this page or the Ryze AI developers page, which opens a cursor:// install link for a server named ryze at https://connector.get-ryze.ai/mcp, or create ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project) with the url entry shown below.

    { "mcpServers": { "ryze": { "url": "https://connector.get-ryze.ai/mcp" } } }
  4. Sign in from Cursor

    Confirm the install in Cursor. Cursor runs OAuth with PKCE and dynamic client registration, so there is no client ID or secret to enter. Sign in on the Ryze AI page and click Allow connection. You can manage or toggle the server from the Customize page in the sidebar.

  5. Ask your first question in Cursor

    Start a new chat in Cursor, approve the tool call when Cursor asks, and try: List the dashboards and feature flags in my PostHog project.

The Ryze AI help center page for PostHog covers the PostHog side of the connection. Cursor does not have its own Ryze AI help page; the Ryze AI developers page has the Add to Cursor link and the matching config.

Sources: Cursor MCP documentation, Ryze AI PostHog guide. Checked November 11, 2026.

mcp.json, API key and Cloud Agents

mcp.json

Save this as ~/.cursor/mcp.json for every project or .cursor/mcp.json for one project. Cursor accepts remote servers through the url field and handles the OAuth sign-in itself.

{ "mcpServers": { "ryze": { "url": "https://connector.get-ryze.ai/mcp" } } }

Cursor supports stdio, SSE and Streamable HTTP transports. For OAuth it reads the server's protected resource metadata (RFC 9728) and registers as a public client through dynamic client registration. After sign-in, manage or toggle the server from the Customize page in the sidebar.

mcp.json with a Ryze AI API key

If you prefer a key to the browser sign-in, add a headers entry and set RYZE_API_KEY in your environment to the rk_live_ key from Ryze AI under Workspace Settings > Profile > API keys. This is a Ryze AI key and is separate from the phx_ PostHog key. Keep both out of files you commit.

{ "mcpServers": { "ryze": { "url": "https://connector.get-ryze.ai/mcp", "headers": { "Authorization": "Bearer ${env:RYZE_API_KEY}" } } } }

Cloud Agents

Cursor Cloud Agents keep their own MCP sign-ins on Cursor's servers, separate from the sign-in on your desktop. If a Cloud Agent needs PostHog data, connect the Ryze AI server for it as well.

Claude and ChatGPT

The same URL works in other MCP clients. PostHog is connected once in Ryze AI, so nothing changes on the PostHog side.

Claude

Add https://connector.get-ryze.ai/mcp as a custom connector under Customize > Connectors, pick the workspace and start a new chat. If the connector was added before PostHog was connected, remove and re-add it, then start a new chat.

ChatGPT

Add the same URL as an app under Settings > Apps, pick the workspace and start a new chat. Re-add the app if PostHog was connected in Ryze AI afterwards, so the tool list refreshes.

PostHog access and scopes

Two sign-ins are involved: a PostHog personal API key for PostHog access and Ryze AI for the connector. Three things decide what Cursor can reach.

Which project
One PostHog project per connection. The key can cover several projects, but you pick one Project after connecting. Another project can live in another Ryze AI workspace, and one connection can cover up to 20 workspaces.
What Cursor can change
The scopes on the personal API key. A key with read scopes only keeps Cursor read-only, because PostHog rejects any change. Add write scopes when you want Cursor to edit objects.
What Cursor asks first
Cursor asks for approval before using MCP tools by default and follows the same Run Modes as terminal commands, so an insight edit or a flag change waits for your click unless you allowlist the tool.

The key scopes

Ryze AI documents the key requirements below. PostHog shows the full scope list when you create the key.

Action in Ryze AIPostHog access
Read events, insights, dashboards, flags, cohorts and personsRead access to the project, including the Query and Insight scopes
Run HogQL queriesQuery scope
Create or update insights, dashboards, flags and cohortsWrite scopes for those objects
Delete an objectWrite scope for that object type

Removing access

To remove access, click View on the PostHog card in Ryze AI and disconnect with the trash icon, or delete the personal API key in PostHog. In Cursor, toggle the ryze server off from Customize or delete its entry from mcp.json.

What Cursor can do in PostHog

The Ryze AI connector exposes three PostHog tools: one read, one write and one delete. Each works on the project you picked.

ToolTypeWhat it does
posthog__readReadReads PostHog data for the connected project (projects, insights, dashboards, feature flags, cohorts, persons, event definitions) and runs HogQL analytics queries.
posthog__writeWriteCreates or updates PostHog objects such as insights, dashboards, feature flags and cohorts.
posthog__deleteDeleteDeletes a PostHog object by path, for example a cohort. The deletion is irreversible.

PostHog stops unbounded HogQL queries, so a query needs a time window and a row limit of 1,000 at most. The tools work only while the Ryze AI workspace has an active plan or free trial.

Cursor asks before it runs an MCP tool by default. Keep that default if you want to review each change. Separately, the Ryze AI chat has its own Tool approvals picker that starts on Skip all approvals, so the agent runs PostHog tools on its own there until you switch it to Approve write & delete or Manual approve. Scheduled tasks run without an approval step.

First 3 prompts to run

1. Review what exists in the project

List the dashboards, feature flags and cohorts in my PostHog project, with each name and when it was last changed if that is available.

Tools used: posthog__read

What comes back: Lists of dashboards, flags and cohorts as plain text in Cursor. Nothing in PostHog is changed.

2. Run a bounded HogQL query

Run a HogQL query on pageview events for the last 14 days, grouped by day, with a limit of 100 rows, and show the result as a table.

Tools used: posthog__read

What comes back: A table of daily pageview counts from your own project. The query carries a time window and a row limit because PostHog stops unbounded queries.

3. Draft a feature flag

Create a feature flag named new-onboarding-test that is off for everyone, and tell me its key and the URL path to open it.

Tools used: posthog__write

What comes back: A new flag in your project, if the API key has write scopes. With a read-only key, PostHog rejects the change and Cursor reports the error.

Each answer comes from your own PostHog project, so this page describes what comes back instead of showing sample numbers. Replace the names in the prompts with ones from your project.

Ryze AI vs PostHog's own MCP server

PostHog runs its own hosted MCP server, documented for Cursor. The two suit different setups.

OptionSetupPostHog coverageAccess
Ryze AI connectorConnect PostHog in Ryze AI with a personal API key and host, then add one URL to Cursor (Add to Cursor link or mcp.json). OAuth with PKCE for the Ryze AI sign-in3 tools: read (including HogQL), write and delete, for one project per connectionThe personal API key scopes you grant; one project per connection
PostHog MCP server (PostHog)Add https://mcp.posthog.com/mcp to Cursor in mcp.json, run npx @posthog/wizard mcp add, or install the PostHog plugin from the Cursor Marketplace. You log in to PostHog and it routes to your US or EU regionFeature flags, product analytics, error tracking, experiments, SQL queries, CDP, surveys and more, according to PostHogOAuth (recommended) or a personal API key with the MCP Server preset; 480 requests per minute and 4,800 per hour per credential; optional read-only and tool filtering parameters

PostHog's own server covers more of PostHog, including error tracking, experiments and CDP, and has read-only and feature-filter options. The Ryze AI connector has three PostHog tools. It fits when you already use the Ryze AI connector in Cursor for other platforms and want PostHog on the same URL. If PostHog is the only platform you need in Cursor, PostHog's own server is the simpler pick.

Sources: PostHog MCP for Cursor, PostHog MCP FAQ, Cursor MCP documentation, Ryze AI PostHog guide. Checked November 11, 2026.

Cursor and PostHog errors and fixes

The PostHog tools do not appear in Cursor
If PostHog was connected in Ryze AI after the server was added, remove the ryze entry and add it again, then start a new chat so the tool list refreshes.
Cursor never asks me to sign in
Open Customize in the sidebar, find the ryze server and reconnect it. Cursor reads the connector's protected resource metadata and registers itself, so no client ID is needed.
PostHog rejects a change
The personal API key has read scopes only. Create a key with the write scopes you need and reconnect PostHog in Ryze AI.
A query is stopped or returns nothing
PostHog stops unbounded HogQL queries. Ask for a time window and a row limit of 1,000 at most.
The wrong project or region answers
One project per connection, and the host decides the region: https://us.posthog.com, https://eu.posthog.com or your self-hosted URL. Click View on the PostHog card, disconnect with the trash icon and connect again with the right host and Project.
A Cloud Agent cannot reach PostHog
Cloud Agents keep their own MCP sign-ins on Cursor's servers. Connect the Ryze AI server for the agent separately from your desktop.
The server is blocked on a team account
Enterprise admins can allowlist which servers and tools the team may run. Ask an admin to allow the Ryze AI server in Team Settings > MCP Configuration.
The one-time connection link is refused
PostHog holds one connection per workspace, and the link is refused while it is already connected. Switch projects or keys in the Ryze AI app.
The tools reply that a subscription is required
The PostHog tools need an active Ryze AI plan or free trial. Start the trial, then retry.

Frequently asked questions

How do I connect Cursor to PostHog?

Connect PostHog in Ryze AI under Integrations with a phx_ personal API key and your host, pick the Project, then add https://connector.get-ryze.ai/mcp to Cursor with the Add to Cursor link or a url entry in mcp.json. Sign in when Cursor asks.

Is there a PostHog MCP server for Cursor?

Yes. PostHog documents a hosted server at https://mcp.posthog.com/mcp for Cursor, installable by mcp.json, the PostHog Wizard or the Cursor Marketplace plugin. The Ryze AI connector at https://connector.get-ryze.ai/mcp also exposes 3 PostHog tools.

Which should I use, Ryze AI or PostHog's own server?

Ryze AI is the best way to bring PostHog into Cursor next to the other platforms on the same connector URL, but it has 3 PostHog tools and one project per connection. PostHog's own server covers more of PostHog, such as error tracking and experiments.

Which PostHog API key do I need?

A personal API key starting with phx_, with read access to the projects you want and the Query and Insight scopes. Add write scopes only if Cursor should change objects. Also enter your host: US Cloud, EU Cloud or a self-hosted URL.

Can Cursor change my PostHog project?

Yes, within the key's scopes. Through Ryze AI it can create or update insights, dashboards, feature flags and cohorts, and delete those objects when you ask. A read-only key keeps it read-only, because PostHog rejects any change.

Which Cursor plan do I need?

Cursor's MCP documentation names no plan. On Enterprise, admins can control which MCP servers users may run in Team Settings > MCP Configuration.

Does Cursor ask before changing a flag or insight?

By default, yes. Cursor asks for approval before using MCP tools and follows the same Run Modes as terminal commands. You can allowlist tools if you want them to run without a prompt.

Can I connect more than one PostHog project?

Each connection holds one project. To switch, click View on the PostHog card in Ryze AI, disconnect with the trash icon and connect again. Another project can live in another Ryze AI workspace, and one Cursor connection can cover up to 20 workspaces.

Can I use a Ryze AI API key instead of the browser sign-in?

Yes. Add a headers entry with Authorization set to Bearer followed by your rk_live_ key from Workspace Settings > Profile > API keys, and keep the key in an environment variable such as RYZE_API_KEY.

Does it work with self-hosted PostHog?

Yes. When you connect PostHog in Ryze AI, enter your self-hosted URL as the Host instead of the US Cloud or EU Cloud address.

How much does it cost to connect Cursor to PostHog?

Adding the connector costs nothing, but the PostHog tools need an active Ryze AI plan or free trial. Paid Ads is $89 per month with a 7-day free trial, SEO Starter is $129 per month with a 3-day free trial, and Agency is $279 per month. Annual billing takes 30% off the first year.

How do I disconnect PostHog from Cursor?

Toggle the ryze server off from Customize in Cursor or remove its entry from mcp.json. To remove PostHog access itself, disconnect PostHog on its card in Ryze AI and delete the personal API key in PostHog.

Connect PostHog to Cursor

PostHog connects once in Ryze AI, then Cursor reads and changes insights, dashboards, flags and cohorts in the project you pick. Paid Ads is $89 per month with a 7-day free trial; annual billing takes 30% off the first year.

PostHog MCP server

Need help? Read the Ryze AI help center page for PostHog or email Ryze AI support.