How to connect Windsurf to PostHog

Create a PostHog personal API key, connect PostHog once in Ryze AI, then add one MCP URL to Windsurf and query events, insights and flags from the editor.

Your MCP URL
https://connector.get-ryze.ai/mcp

Paste it as the url of a ryze server in the Windsurf MCP config. See the steps

See pricing

By Ira Bodnar, Ryze AI · Updated

Quick answer

To connect Windsurf to PostHog, connect PostHog in a Ryze AI workspace with a PostHog personal API key, then add https://connector.get-ryze.ai/mcp to the Windsurf MCP config under the name ryze and sign in to Ryze AI.

  1. In PostHog create a personal API key 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 Windsurf add the ryze server with the URL to mcp_config.json
  4. Authenticate, click Allow connection and ask your first PostHog question

Before you start

  • Windsurf (Devin Desktop) or the Devin CLI. Cognition's Devin Desktop MCP documentation names no plan for remote MCP servers. On Enterprise, admins manage the MCP registry and allowlist in team settings under MCP & ACP, so an admin may need to approve the server first.
  • A PostHog personal API key. It starts with phx_ and needs read access to the project you want, including the Query and Insight scopes. Add write scopes only if you want the agent to 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; SEO Starter is $129 per month with a 3-day free trial and Agency is $279 per month. Connecting the connector is free, but the PostHog tools need an active plan or trial.

How to connect Windsurf to PostHog in Devin Desktop

Two steps happen in PostHog and Ryze AI, three in Windsurf. 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 project you want with the Query and Insight scopes, add write scopes only for objects the agent should change, and copy the phx_ key.

  2. Connect PostHog in Ryze AI

    In the Ryze AI app 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 the Windsurf config

    In Windsurf open the Customize page from the Agents window, click MCPs and choose a scope with Install MCPs for, for example This computer. Open the config file and add a ryze entry under mcpServers with the url https://connector.get-ryze.ai/mcp. The user file is ~/.config/devin/mcp_config.json and the project file is .devin/mcp_config.json.

    The server entry is the same in the user file and the project file. Windsurf's Devin docs use the key url for a remote server:

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

    Devin Local tries Streamable HTTP first and falls back to SSE on non-auth 4xx errors. It registers the OAuth client dynamically, so there is no client ID or secret to paste.

  4. Authenticate with Ryze AI

    Refresh the MCP list. If the ryze server shows Needs authentication, click Authenticate. Otherwise run devin mcp login ryze in a terminal. Sign in on the Ryze AI page, choose the workspace that holds PostHog and click Allow connection.

  5. Ask your first PostHog question

    Start a new agent chat and ask: List the dashboards and feature flags in my PostHog project. By default Windsurf asks for approval before it calls an MCP tool, so approve the read when prompted.

The Ryze AI help center article for PostHog covers the PostHog side of the connection, and Cognition documents the editor side in the Devin Local MCP docs.

Devin CLI

The Devin CLI adds the server from the terminal. The -s user flag stores it in your user config. The second command opens the Ryze AI sign-in page, where you pick the workspace and click Allow connection.

devin mcp add -s user ryze https://connector.get-ryze.ai/mcpdevin mcp login ryze

Each MCP client keeps its own OAuth session, so signing in to Ryze AI in Claude or Cursor does not carry over to Windsurf. You sign in once per tool.

Other clients

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

Claude

Add the URL under Customize, Connectors, Add custom connector, then click Connect and allow the workspace. See the Claude to PostHog guide for the full steps.

Cursor

Add the same URL as a remote server in Cursor's MCP settings and sign in to Ryze AI. The Cursor to PostHog guide covers the file and the menu.

ChatGPT, Codex and Gemini

Each has its own connector flow with the same URL and the same Ryze AI sign-in. PostHog is connected once in Ryze AI, so nothing changes on the PostHog side.

PostHog access and approvals

Two keys decide what Windsurf can do in PostHog: the PostHog personal API key you paste into Ryze AI, and the tool approvals in Windsurf.

Which project
One Ryze AI connection is one PostHog project. You pick the Project after pasting the key. To use another project, click View on the PostHog card, disconnect with the trash icon and connect again, or use another Ryze AI workspace.
What the key can change
The agent can only do what the scopes on the personal API key allow. A key with read scopes only keeps the agent read-only, because PostHog rejects any change.
Which host
Use https://us.posthog.com, https://eu.posthog.com or your self-hosted URL. PostHog documents these as the hosts for private endpoints such as the query API; the i.posthog.com hosts are for event capture.
Windsurf approvals
By default Windsurf asks for approval before it runs any MCP tool, and admins can set default-allow for trusted servers. Keep it on approval for the write and delete tools.

Create the key with the narrowest scopes that fit the job. A read-only key with Query and Insight scopes supports the questions in this guide. If you later want the agent to create an insight or a feature flag, add that write scope, or make a second key.

Removing access

To remove access, delete the personal API key in PostHog under Settings, Personal API keys. In Ryze AI, click View on the PostHog card and use the trash icon. In Windsurf, remove the ryze entry from mcp_config.json.

What Windsurf can do in PostHog

The Ryze AI connector exposes 3 PostHog tools. Each runs against the one PostHog project you connected.

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.

In the Ryze AI chat the Tool approvals picker starts on Skip all approvals, so switch it to Approve write & delete if you want changes to wait for you. Scheduled tasks run without an approval step. Inside Windsurf, the client asks before each MCP tool call by default.

First 3 prompts to run

1. Dashboards and flags overview

List the dashboards, insights and feature flags 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, insights and feature flags from the connected project. Fields that PostHog does not return for an object are left blank.

2. A HogQL question from the editor

Run a HogQL query for the 20 most common events in the last 7 days, with a row limit of 20, and show the event name and count.

Tools used: posthog__read (HogQL query)

What comes back: A table of event names with counts for the window you set. Unbounded queries are stopped by PostHog, which is why the prompt names a time window and a row limit.

3. Check a flag before you code against it

Show the feature flag with the key I name below, its rollout conditions and the cohorts it references, so I can write the client check.

Tools used: posthog__read

What comes back: The flag definition and any cohorts it references, in the chat next to your code.

Each answer comes from your own PostHog project, so this page describes what comes back instead of showing sample numbers. HogQL queries need a time window and a row limit of 1,000 at most.

Ryze AI vs PostHog's own MCP server

PostHog runs its own hosted MCP server that lists Windsurf as a supported client. Both routes work in the editor; they differ in sign-in and scope.

OptionSetupPostHog coverageOther platforms
Ryze AI connectorPostHog personal API key pasted into Ryze AI, then the URL https://connector.get-ryze.ai/mcp in Windsurf with a Ryze AI sign-in3 tools: read (including HogQL), write and delete on insights, dashboards, feature flags and cohorts for one projectOther platforms Ryze AI supports share the same URL
PostHog MCP serverHosted at https://mcp.posthog.com/mcp. PostHog sign-in routes you to the US or EU region. Some AI-powered tools need AI data processing enabled in the organization settingsError tracking, analytics, feature flags, experiments, SQL and CDP destinations, per PostHog's docsPostHog only

If you only work in PostHog and want its full product surface in the editor, PostHog's own server covers more of PostHog. Use the Ryze AI connector when you already run Ryze AI and want PostHog behind the same URL, with a key whose scopes you choose. The two can be installed side by side under different names.

Sources: PostHog MCP server docs, PostHog API docs, Devin Local MCP docs, Devin CLI MCP configuration, Ryze AI PostHog integration. Checked November 15, 2026.

PostHog errors and fixes

The ryze server shows Needs authentication
The OAuth credentials are missing or expired. Click Authenticate in the MCP list to restart the browser sign-in, or run devin mcp login ryze.
Ryze AI sign-in worked in another tool but not in Windsurf
Each MCP client keeps its own OAuth session. Sign in once in Windsurf.
The server does not appear after editing the file
Check that the JSON is valid, that the entry sits under mcpServers and that you edited the file for the scope you are viewing, then refresh the MCP list.
Windsurf asks for approval on every call
That is the default. Admins can set default-allow for trusted servers, and you can set per-tool permissions in Windsurf's permissions settings.
PostHog tools are missing
PostHog must be connected in the Ryze AI workspace you allowed. Open Integrations in Ryze AI, confirm the card shows Connected and a project is picked, then authenticate again.
A write request is rejected
The personal API key probably has read scopes only, and PostHog rejects any change. Create a key with the write scope you need.
A HogQL query is stopped
PostHog stops unbounded HogQL queries. Ask for a time window and a row limit of 1,000 or fewer.
The connection link is refused
PostHog holds one connection per workspace. The one-time link from Claude or ChatGPT is refused while it is already connected. Switch projects or keys in the Ryze AI app.
The tools say a subscription is required
The PostHog tools need an active Ryze AI plan or free trial. Start the trial in Ryze AI, then retry.

Frequently asked questions

How do I connect Windsurf to PostHog?

Create a PostHog personal API key, connect PostHog in Ryze AI under Integrations with the key and host, and pick the project. Then add a ryze entry with the url https://connector.get-ryze.ai/mcp to mcp_config.json in Windsurf, authenticate and click Allow connection.

Does PostHog have its own MCP server for Windsurf?

Yes. PostHog hosts an MCP server at https://mcp.posthog.com/mcp and lists Windsurf among supported clients. Its authentication routes you to the US or EU region. You can install it next to the Ryze AI connector.

Which PostHog MCP option should I use in Windsurf?

Ryze AI is the best PostHog connector for teams that already run Ryze AI and want PostHog behind one MCP URL, with a key whose scopes they choose. PostHog's own server covers more PostHog products, so choose it if you only work in PostHog.

Is Windsurf now called Devin Desktop?

The Windsurf MCP docs now redirect to Cognition's Devin Desktop documentation, and windsurf.com redirects to devin.ai/desktop. This guide follows the current Devin docs for the config path and the CLI. No rename announcement was read, so the page uses both names.

What PostHog access do I need?

A personal API key starting with phx_ that has read access to the project, including the Query and Insight scopes, plus the host for your region or your self-hosted URL. Add write scopes only if the agent should make changes.

Do I need a paid Windsurf plan?

The Devin Desktop MCP documentation names no plan. On Enterprise, admins manage MCP registries and the MCP allowlist in team settings under MCP & ACP, so an admin may have to allow the Ryze AI server.

Can Windsurf edit or delete things in PostHog?

Yes, through Ryze AI it can create or update insights, dashboards, feature flags and cohorts and delete them when asked, limited by the scopes on your API key. Windsurf asks for approval before each MCP tool call by default. A read-only key keeps the agent read-only.

Can I connect more than one PostHog project?

One connection covers 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 connection can cover up to 20 workspaces.

Does this work in the Devin CLI?

Yes. Run devin mcp add -s user ryze https://connector.get-ryze.ai/mcp, then devin mcp login ryze and click Allow connection on the Ryze AI page.

Does it work with self-hosted PostHog?

Ryze AI accepts a self-hosted URL in the Host field when you connect PostHog, alongside US Cloud and EU Cloud. PostHog's hosted MCP server page does not cover self-hosted instances.

How much does it cost to connect Windsurf 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 Windsurf?

Remove the ryze entry from mcp_config.json. To cut PostHog off at the source, delete the personal API key in PostHog or click the trash icon on the PostHog card in Ryze AI.

Connect PostHog to Windsurf through Ryze AI

One Ryze AI connection gives Windsurf 3 PostHog tools for one project. 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 PostHog article or email Ryze AI support.