How to connect VS Code to PostHog

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

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

Paste it into VS Code under Chat: Open Customizations, MCP Servers, Add Server. See the steps

See pricing

By Ira Bodnar, Ryze AI · Updated · Connector tested November 13, 2026

Quick answer

The main way to connect VS Code to PostHog is the Ryze AI connector. Save a phx_ personal API key and your PostHog host in Ryze AI and pick the project. Then, with Copilot as the session target, run Chat: Open Customizations, select MCP Servers and add an HTTP server with https://connector.get-ryze.ai/mcp and the server ID ryze. Trust it and finish the Ryze AI sign-in in your browser.

  1. In PostHog create a personal API key (phx_) with read access, including the Query and Insight scopes
  2. In Ryze AI connect PostHog with the key and host, then pick the Project
  3. In VS Code run Chat: Open Customizations, select MCP Servers and add an HTTP server with the connector URL
  4. Trust the server, sign in to Ryze AI, allow the workspace and ask Copilot Chat about your project

VS Code to PostHog at a glance

FactDetail
Main way to connectThe Ryze AI connector, stored in VS Code as one HTTP MCP server named ryze that Copilot Chat calls
Server addresshttps://connector.get-ryze.ai/mcp, identical for every user
Where it goes in VS CodeChat: Open Customizations > MCP Servers > Add Server (+), or the MCP: Add Server command. A personal entry is saved to Copilot Global, ~/.copilot/mcp-config.json
Sign-inVS Code handles the OAuth sign-in to Ryze AI, which opens in your browser. You do not paste the phx_ key into VS Code: it is saved with the PostHog connection in Ryze AI
What PostHog needsA phx_ personal API key with read access to the project and the Query and Insight scopes, plus your host. Each connection holds one project
PostHog tools3: posthog__read, posthog__write and posthog__delete
Can Copilot change PostHogOnly when the key carries write scopes, since PostHog rejects every change from a read-only key. New VS Code sessions also start on Manual permissions by default, which hold a call that is not auto-approved until you answer
Copilot planGitHub's plans tables include MCP on every Copilot plan. Business and Enterprise seats also need the MCP servers in Copilot policy, which is off by default
Ryze AI pricePaid Ads is $89 per month with a 7-day free trial, and any active plan or trial runs the PostHog tools. Adding the connector is free
PostHog's own option for VS CodeA free hosted MCP server at https://mcp.posthog.com/mcp. PostHog's docs have a VS Code page for it, and its setup wizard lists VS Code
Last testedConnector checked November 13, 2026. No PostHog call and no step inside VS Code were run

Before you start

  • GitHub Copilot in a current VS Code. GitHub's MCP article asks for access to Copilot and VS Code 1.99 or later, and GitHub's plans tables count MCP in every plan from Copilot Free and Student up to Enterprise. The steps below save the server to Copilot Global, a destination that arrived in VS Code 1.140, so update an older install first. An eligible GitHub account with no plan is enrolled in Copilot Free when it signs in to VS Code.
  • The MCP policy, if Copilot comes from an organization. For members of an organization or enterprise on Copilot Business or Copilot Enterprise, the MCP servers in Copilot policy must be enabled. GitHub ships it disabled, so an administrator has to turn it on. Copilot Free, Pro, Pro+ and Max are not governed by the organization MCP policy.
  • A local project folder, with Copilot as the session target. Microsoft's walkthrough asks for AI features turned on, a local folder open and Copilot picked in the Session Target dropdown before a server is added.
  • A PostHog personal API key and host. The key starts with phx_ and needs read access to the projects you want, including the Query and Insight scopes. Add write scopes only if Copilot Chat should change objects. PostHog shows the value once, so copy it straight away. The host is 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. Adding the connector is free, but the 3 PostHog tools need an active plan or trial.

How to connect VS Code to PostHog with the Customizations editor

The first two steps happen in PostHog and Ryze AI, the other four in VS Code. The connector URL is the same for every user.

  1. Create a personal API key in PostHog

    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 Copilot Chat should change. Copy the phx_ key right away, because PostHog shows its value only once.

  2. Connect PostHog in Ryze AI

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

  3. Open the MCP Servers list in VS Code

    Open a local project folder and choose Copilot in the Session Target dropdown, since the editor lists the servers of the selected harness. Run Chat: Open Customizations from the Command Palette, select MCP Servers and select Add Server (+) in the User group. Microsoft's overview page also mentions a Workspace group.

  4. Add the HTTP server

    Choose HTTP (HTTP or Server-Sent Events) and enter https://connector.get-ryze.ai/mcp. Enter ryze as the server ID. For a personal setup, select Global, then Copilot Global. There is no client ID or secret to enter.

  5. Trust the server and sign in

    If VS Code shows a trust prompt, review it before you accept, then complete the Ryze AI sign-in in the browser. If the sign-in does not open, select the ellipsis (...) next to ryze in MCP Servers and choose Authenticate. On the Ryze AI page choose the workspace that holds your PostHog connection and click Allow connection.

  6. Ask your first question in Copilot Chat

    Open Copilot Chat and ask: Run a HogQL query that counts pageviews per day for the last 7 days, 100 rows at most. Approve the tool call when VS Code asks, then expand the call in the conversation to confirm that the ryze server answered. Microsoft's docs note that an answer without a tool call does not show the connection works.

The Ryze AI help center page for PostHog covers the PostHog side of the connection, and the VS Code MCP servers documentation covers the editor side.

Sources: VS Code MCP servers, GitHub: extend Copilot Chat with MCP, GitHub Copilot plans, Ryze AI help center page for PostHog. Checked November 14, 2026.

Command Palette and config files

The Customizations editor, the guided command and the config files all end in the same server entry. Pick the route that fits how you manage VS Code.

Guided flow

Run MCP: Add Server from the Command Palette and follow the prompts with the same URL and server ID. It saves a trip to the Customizations editor.

Portable config file

To write the entry by hand, use the portable format that the Copilot harness reads: ~/.copilot/mcp-config.json for you alone ($COPILOT_HOME/mcp-config.json when that variable is set) or .mcp.json at the workspace root. Both start with mcpServers. Microsoft's portable HTTP examples all carry a tools field, so this one does too:

{ "mcpServers": { "ryze": { "type": "http", "url": "https://connector.get-ryze.ai/mcp", "tools": ["*"] } } }

Older VS Code format

The older format uses the key servers and lives in .vscode/mcp.json or the user mcp.json. It belongs to the Local harness, which VS Code 1.146 deprecated on November 11, 2026, with removal announced for February 2027. Copilot harness sessions do not read these files directly, though the editor can forward eligible entries, and Microsoft's MCP developer guide calls them deprecated destinations in the guided flow. PostHog's own VS Code page and GitHub's Copilot article still show this shape, so many tutorials point here:

{ "servers": { "ryze": { "type": "http", "url": "https://connector.get-ryze.ai/mcp" } } }

In the portable entry, ["*"] makes every tool of the server available and leaves approvals in place. Portable files do not support VS Code input variables, envFile or SecretStorage. A workspace .mcp.json is made to be committed for a team, so keep the phx_ key out of it. With this connector the entry holds only the address: the key lives in Ryze AI, and the connector asks for a sign-in instead.

Limits of VS Code to know

  • The type field sets the transport: http for Streamable HTTP, stdio for a local command and sse for older endpoints that Microsoft calls legacy. The ryze entry uses http.
  • Trust lets a server start, authentication gives it access, and approvals cover single tool calls. VS Code handles them as three separate steps.
  • Servers whose old-format entry needs ${input:...} or ${command:...} prompts are not forwarded to Copilot harness sessions.
  • Copilot Global does not sync to your other machines, and a remote host or Dev Container does not read the local file. Add the server on the host where the session runs.
  • Microsoft's MCP developer guide says VS Code signs in to providers other than GitHub and Microsoft Entra through Dynamic Client Registration or a pre-registered OAuth client, and the connector publishes a register endpoint. Ryze AI was not tested inside VS Code for this guide, so if the sign-in does not start, email Ryze AI support using the link at the end of this page.

VS Code, Copilot and MCP in one table

TopicWhat Microsoft and GitHub document
Screen for adding a serverChat: Open Customizations opens the Agent Customizations editor, whose MCP Servers page holds Add Server (+). The Chat view title bar and the Agents window sidebar open the same editor
Files the Copilot harness readsCopilot Global at ~/.copilot/mcp-config.json for one person, and .mcp.json at the workspace root for a shared setup. Each has a top-level mcpServers object
Legacy files.vscode/mcp.json and the profile mcp.json with a servers object, kept only for the deprecated Local harness
Transportstype stdio starts a command, http speaks Streamable HTTP and sse reaches older endpoints that have no Streamable HTTP
Sign-inWhen a server asks for OAuth, the Copilot runtime hands the sign-in to VS Code, which keeps the credentials. GitHub and Microsoft Entra are built in; other providers go through Dynamic Client Registration or a pre-registered client. Redirects return to http://127.0.0.1:33418 or https://vscode.dev/redirect
Keys and headersHTTP entries take a headers object whose values can read environment variables as ${NAME}. Input prompts, envFile and SecretStorage do not work in the portable files
Tool approvalNew sessions start on Manual permissions: a call that is not auto-approved shows the tool name and its inputs first. The dropdown in the chat input also offers Assisted permissions, which lets an LLM judge each call, and Allow all, which skips confirmation. Autopilot mode approves every tool
PlanGitHub includes MCP on Copilot Free, Student, Pro, Pro+, Max, Business and Enterprise. Business and Enterprise seats also need the MCP servers in Copilot policy, which ships disabled
Admin controlsallowedMcpServers and deniedMcpServers in enterprise-managed settings match a server by URL, command or name, and a local file cannot lift a block. chat.mcp.access set to none switches MCP off
Managing a serverEach entry in MCP Servers has a toggle and an ellipsis menu with Start, Stop, Enable or Disable, Uninstall and Show Output, plus Authenticate when a sign-in is needed. Restart is for editor-managed servers; a Copilot server is stopped and started again. MCP: List Servers reaches the same actions
Tool cap128 enabled tools per chat request. Above that, VS Code answers Cannot have more than 128 tools per request.

Sources: VS Code MCP servers, VS Code MCP configuration reference, VS Code: manage MCP servers, VS Code MCP developer guide, VS Code tool approvals, VS Code agent harnesses, VS Code enterprise AI settings, GitHub: extend Copilot Chat with MCP, GitHub Copilot plans. Checked November 14, 2026.

Other editors and assistants

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

Cursor

Cursor keeps its own mcp.json, and its entry uses the key mcpServers with a url field, while the older VS Code format uses servers. Check the key before you copy a file from one editor to the other. How to connect Cursor to PostHog.

Claude and Claude Code

The same connector URL is added in Claude under Customize, Connectors, or from the Claude Code command line. How to connect Claude to PostHog.

Codex

Codex takes the same URL. Its menus and config files differ from VS Code, so follow its own guide. How to connect Codex to PostHog.

PostHog API key and scopes

Three things decide what Copilot Chat can do in PostHog.

Which project
Each connection is one PostHog project. You pick the Project in Ryze AI after connecting. To use another project in the same workspace, click View on the PostHog card, disconnect with the trash icon and connect again. A different project can also live in a different Ryze AI workspace.
What Copilot Chat can change
The scopes on the personal API key. A key with read scopes only keeps Copilot Chat read-only, because PostHog rejects any change. Add write scopes when you want it to edit insights, dashboards, feature flags or cohorts.
What VS Code asks
First, a server saved in Copilot Global may ask for your trust before it starts, and it might ask again after its entry changes. Second, the Ryze AI sign-in runs when the connector asks for it, and Authenticate in the server's ellipsis menu starts it again. Third, Manual permissions hold each PostHog call that is not auto-approved and show its tool name and inputs for review.

Scopes behind each action

PostHog shows the full scope list when you create a key. The table lists the requirements Ryze AI documents, so you can match them against that screen.

Action in Ryze AIPostHog key requirement
Read insights, dashboards, feature flags, cohorts, persons and event definitionsRead access to the project, including the Query and Insight scopes
Run HogQL queriesThe Query scope
Create or update insights, dashboards, feature flags and cohortsWrite scopes for those objects
Delete an object such as a cohortWrite scope for that object type

What each PostHog scope opens

The phx_ key is not entered in VS Code. It is saved in Ryze AI, and PostHog treats every call made with it as the user who created the key, narrowed to the projects and scopes set on it. PostHog splits each scope into a read level and a write level, and write includes read. The middle column paraphrases PostHog's scope page.

PostHog scopeWhat it opens, per PostHogIn the key from the Ryze AI steps
query:readSQL and insight queries over the project's data, along with event, session and web vitals lookups. There is no write levelYes, as the Query scope. Every HogQL request from Copilot depends on it
insight:read, insight:writeSaved insights with their queries, results and explanations, plus anomaly rates on trends insightsRead yes, as the Insight scope. Write only if Copilot should save or edit insights
dashboard:read, dashboard:writeDashboards with their tiles, text cards, widgets and layout, and running the insights placed on themNot named in the Ryze AI steps. Add read if a dashboard request comes back with a 403 that names it
feature_flag:read, feature_flag:writeFlags with their release conditions, variants, payloads and rollout historyNot named. Write is required before Copilot creates or edits a flag
cohort:read, cohort:writeCohorts with their filters, static member lists, calculation history and the places that use themNot named. Write is required before Copilot creates or deletes a cohort
person:read, person:writePersons and their properties; the write level also updates, splits and deletes personsNot named
event_definition:read, event_definition:writeEvent definitions, schemas and property groups, including tags, verification and generated typesNot named. Add read if listing events is refused with a 403

Left out of the key the Ryze AI steps describe: every write scope, a second project in the same workspace, and the MCP Server key preset, which PostHog made for its own MCP server and CLI. Ryze AI's tool descriptions do not name session recordings, experiments, surveys or error tracking, so this page does not claim Copilot reaches them through Ryze AI. The connector's discovery files name two OAuth scopes of its own, mcp:read and mcp:write. They belong to the sign-in to Ryze AI, and what Copilot can change in PostHog still depends on the scopes of the phx_ key.

PostHog's key rules matter for a VS Code setup. A key can cover the whole organization, chosen projects or every project, and its scopes can be changed later, so a missing scope does not force a new key. If GitHub secret scanning finds a phx_ key in a repository, PostHog rolls it and emails its owner, one more reason to keep keys out of a shared .mcp.json.

Sources: PostHog API scopes, PostHog personal API keys, PostHog API overview, Ryze AI help center page for PostHog. Checked November 14, 2026.

Removing access

To stop access from VS Code, open Chat: Open Customizations, select MCP Servers and use the ellipsis menu on the ryze server to disable or uninstall it. Stop is weaker: it ends the current run, and a later request can start the server again. To end PostHog access, click View on the PostHog card in Ryze AI and disconnect with the trash icon, or delete the personal API key in PostHog.

What Copilot Chat can do in PostHog

The Ryze AI connector exposes 3 PostHog tools: 1 read, 1 write and 1 delete. They work on the one 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.

A new VS Code session uses Manual permissions unless a setting or an organization default says otherwise, so a PostHog call that is not auto-approved shows its tool name and inputs before it runs. Take care with Chat: Manage Tool Approval: its top-level checkbox for ryze trusts every tool on the server, posthog__delete included. Setting a tool to false in chat.tools.eligibleForAutoApproval keeps it on manual approval, while Allow all and Autopilot approve everything. The Ryze AI chat itself starts on Skip all approvals, and its Tool approvals picker can switch to Approve write & delete or Manual approve. Scheduled tasks run without an approval step. For a hard stop, use a key with read scopes only.

Limits in numbers

Only the first row is a Ryze AI rule and only the last is VS Code's. The rows between are PostHog's published figures, in PostHog's units, and none was measured for this guide. Most of them count per personal API key, and through Ryze AI that is the phx_ key you saved there.

LimitFigureSource
HogQL through Ryze AIA time window and 1,000 rows at most in every queryRyze AI tool rules; no PostHog page states it
Analytics endpoints240 calls a minute and 1,200 an hour per personal API key, for work such as calculating insights, retrieving persons and session recordingsPostHog API overview
Query endpoint2,400 an hour on the API overview. The queries page sets it per project: 240 a minute, 3 queries at once, 60 threads and 10 seconds of execution per query, up to 30 seconds waiting in a queue. Some older accounts keep 120 queries an hourPostHog queries
Hourly read budgetQueries sent with a personal API key spend a per-project budget counted in bytes read, with no published figure. An empty budget returns 429 api_queries_budget_exceeded with Retry-After; cached results still loadPostHog queries
Other endpoints480 calls a minute and 4,800 an hour per personal API key for the remaining create, read, update and delete endpointsPostHog API overview
Rows per API query100 by default and up to 50,000 with your own LIMIT. OFFSET returns HTTP 400 with a personal API key; PostHog suggests paging on timestampPostHog queries
Who the limits count againstMostly the personal API key, not the team. Requests made with OAuth or a logged-in session do not count against key limits, and PostHog offers no higher onesPostHog API overview
Keys per userUp to 10 personal API keysPostHog personal API keys
Dynamic cohortsRecalculated once every 24 hoursPostHog cohorts
PostHog's own MCP server480 requests a minute and 4,800 an hour per credential; opening a session and listing tools count. Over that, 429 with Retry-After. This applies to PostHog's server, not to the Ryze AI connectorPostHog MCP FAQ
VS Code128 enabled tools per chat requestVS Code tools

PostHog and VS Code figures checked November 14, 2026.

First 3 prompts to run

These prompts use only what the 3 tools document. What comes back depends on your own project, so no sample output is shown.

1. 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 project. Ryze AI expects each HogQL query to set a time window and to stay at 1,000 rows or fewer, and this prompt does both.

2. List dashboards and their insights

List the dashboards in my PostHog project and name the insights each one holds.

Tools used: posthog__read

What comes back: Your dashboards with the insights on each, read from the connected project. Listing dashboards may need the dashboard:read scope, which the Ryze AI setup steps do not name; if PostHog answers with a 403 that names it, add the scope to the key.

3. Create a feature flag

Create a feature flag named new-checkout-copy that is off for everyone, then tell me what you created.

Tools used: posthog__write

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

Ask for a delete only when you mean it, because the delete tool is irreversible. Read each write and delete call before you approve it in VS Code.

10 jobs to hand to Copilot Chat

Ten jobs to type into Copilot Chat once the ryze server is running, each with the tool it calls and the PostHog scope behind it. None was run for this guide. The last column assumes the key from the setup steps: read access to the project with the Query and Insight scopes and no write scope.

JobAsk CopilotToolPostHog scopeWorks on the default key
Daily pageviewsCount pageviews per day for the last 7 days with a HogQL query, capped at 1,000 rows.posthog__readquery:readYes
Campaign trafficSplit last month's sessions by UTM source with a HogQL query over sessions.posthog__readquery:readYes
Funnel read-outOpen my saved signup funnel insight and report how many people reach each step.posthog__readinsight:read, query:readYes
Dashboard inventoryGive me the name of every dashboard in this project.posthog__readdashboard:readWorks if the key also has dashboard:read, which the setup steps do not name. A missing scope gets a 403 that names it
Flag reviewBefore the launch, list each feature flag with its rollout settings.posthog__readfeature_flag:readWorks if the key also has feature_flag:read
Cohort definitionsList the cohorts and what defines each one.posthog__readcohort:readWorks if the key also has cohort:read
Event checkWhich event definitions exist in this project?posthog__readevent_definition:readWorks if the key also has event_definition:read
Signup dashboardBuild a trends insight for landing page signups and put it on a new campaign dashboard.posthog__writeinsight:write, dashboard:writeNo. Both write scopes are needed
Campaign cohortMake a cohort of the people who arrived from one campaign.posthog__writecohort:writeNo. cohort:write is needed
Old test cohortDelete the test cohort I name. I understand it cannot be restored.posthog__deletecohort:writeNo. It needs cohort:write, and under Manual permissions VS Code asks before the call

4 ways to connect VS Code to PostHog

Four ways give GitHub Copilot in VS Code tools for PostHog, and each comes from a vendor page that names VS Code. This guide treats the Ryze AI connector as the main way: Copilot holds one address and a browser sign-in while the phx_ key stays in Ryze AI. The other three were read on their own pages on November 14, 2026, and each row says how it is set up in VS Code. None was run for this guide.

WayRuns whereSetup in VS CodeWhat it reaches in PostHogPrice
Ryze AI connector (the main way)Hosted by Ryze AI at one addressChat: Open Customizations > MCP Servers > Add Server (+), HTTP, ID ryze, saved to Copilot Global; or an mcpServers entry in a portable file. Sign in to Ryze AI in the browser3 tools on one project: insights, dashboards, feature flags, cohorts, persons, event definitions and HogQL queries. Writes and deletes need write scopes on the phx_ keyPaid Ads is $89 per month with a 7-day free trial; any active Ryze AI plan or trial runs the tools
PostHog MCP serverHosted by PostHog at https://mcp.posthog.com/mcp. The sign-in routes you to your US or EU regionPostHog's VS Code page: run MCP: Open User Configuration and add a posthog entry of type http under servers, the older format. Its wizard, npx @posthog/wizard mcp add, also names VS Code. In current VS Code the same address fits an HTTP server in Copilot Global. Log in to PostHog when it first asksRead and write across product and web analytics, session replay, feature flags, experiments, error tracking, logs, surveys, SQL, the data warehouse, data pipeline destinations, support tickets and more: 1,284 tools in 78 categories. ?readonly=true strips the tools that change data, and ?features= or ?tools= narrows the listFree to connect and to call tools. Some tools use LLMs internally and may be billed as PostHog AI spend
ComposioHostedAdd https://connect.composio.dev/mcp as an HTTP server, choose Authenticate in its server menu, log in to Composio and click Allow access. Inside Composio, PostHog is linked with your own API key. GitHub also lists Composio among its 26 Copilot connectors in preview, without saying which Composio tools that route carries686 tools and 11 triggers in the Posthog toolkit. A second toolkit, PostHog MCP, offers 1 tool (Exec) behind DCR OAuthFree up to 10,000 tool calls a month. Standard is $18 per seat per month
Zapier MCPHostedAdd Zapier as an MCP server and sign in to Zapier, which creates a default server and turns on actions for the apps already linked to your Zapier account. VS Code is on Zapier's client listOne action, Capture Event. Zapier lists no read of insights, dashboards, flags or cohortsEach successful tool call uses two tasks from your Zapier plan; failed calls use none

PostHog options that do not fit VS Code

  • The PostHog AI plugin. It bundles PostHog's hosted server with skills and slash commands. Its install steps cover Claude Code, Cursor, Codex, Antigravity, Gemini CLI, Grok and Claude Cowork. VS Code is not on that list, so this guide gives no VS Code steps for it.
  • PostHog's Claude connector, ChatGPT plugin and managed sign-in. The Claude directory listing names Claude only, the ChatGPT plugin listing names ChatGPT only, and enterprise-managed authorization is documented for Claude alone. In VS Code, add https://mcp.posthog.com/mcp directly instead.
  • PostHog CLI (posthog-cli). It calls PostHog's API and MCP tool catalog from a shell. Its page names Claude Code, Codex and "another coding agent" and does not name VS Code. PostHog's CLI page points to MCP for agents that cannot run terminal commands.
  • The PostHog VS Code extension. It shows feature flags and analytics inside the editor. PostHog's docs call it different from the PostHog MCP server for VS Code, so this guide does not count it as a way to connect Copilot.
  • A Copilot connector for PostHog. GitHub's supported connectors page listed 26 services on November 14, 2026, and PostHog was not one of them. The list is in public preview and can change.
  • Windsor.ai, Coupler.io and AnythingMCP. None names VS Code. Windsor.ai names ChatGPT, Claude, Perplexity, Cursor, Grok, Gemini Enterprise, Copilot Agent, Manus, Lovable and Antigravity. Coupler.io lists Claude, ChatGPT, Gemini, Copilot, Cursor, Perplexity, OpenClaw and a Custom MCP destination. AnythingMCP says it works with any MCP-compatible client, yet its PostHog guide names ChatGPT, Claude, Gemini, Cursor, Copilot, OpenClaw and Meta Muse.
  • viaSocket, Improvado and Pipedream. viaSocket names ChatGPT, Claude and Cursor. Improvado names Claude and Cursor and gives setup for Claude Desktop or Cursor. Pipedream's PostHog MCP page, as read for this guide, does not name VS Code.
  • Retired packages. The standalone PostHog/mcp repository is archived, with its server moved into PostHog's main repository, and @posthog/agent-toolkit is deprecated in favor of the MCP server. The npm package @posthog/mcp tracks tool use in your own MCP server and does not connect Copilot to PostHog data.

Which one to pick

Ryze AI is the best way to connect VS Code to PostHog when Copilot should read one project's product analytics beside your ads and SEO data through a single ryze entry, with one caveat: it covers less of PostHog than PostHog's own server, with three tools on one project per connection, and the tools need a Ryze AI plan or trial. If PostHog is all you want in VS Code, PostHog's server is the simpler choice. It is free, signs in with your PostHog login and also reaches session replay, experiments, error tracking, surveys and logs. Its CLI mode ships a single exec tool and its tools mode registers every tool, and PostHog's pages do not say which one VS Code gets. VS Code caps a chat request at 128 tools, so ?features= or ?tools= on the address keeps a long list short. Composio suits a team that already runs it for other apps. Zapier lists one PostHog action, Capture Event, so it fits only when sending events is the goal. Ryze AI publishes this guide.

The two hosted servers count their limits differently. Ryze AI calls PostHog with your phx_ key, so the per-key rows of the limits table apply to it. PostHog's own server counts per credential, and PostHog says requests made with OAuth do not count against personal API key limits.

Sources: PostHog MCP overview, PostHog MCP for VS Code, PostHog MCP FAQ, posthog.com/mcp, PostHog AI plugin, PostHog CLI, PostHog VS Code extension, PostHog enterprise-managed authorization, GitHub supported connectors, Composio Posthog toolkit, Composio pricing, Zapier PostHog MCP, Zapier MCP quickstart, Windsor.ai PostHog fields, Coupler.io PostHog source, AnythingMCP PostHog guide, viaSocket PostHog MCP, Pipedream PostHog MCP, Improvado PostHog MCP, Ryze AI help center page for PostHog. Checked November 14, 2026.

PostHog, Copilot and MCP: dates that matter

DateWhat happened
March 7, 2025@posthog/wizard 0.1.0 reached npm. Its mcp add command now lists VS Code among the clients it sets up.
April 4, 2025VS Code 1.99, the March 2025 release, came out with support for MCP servers in agent mode. GitHub's changelog entry on Copilot in 1.99 carries this date.
May 14, 2025PostHog created the PostHog/mcp repository for its MCP server. It is archived now, and the server lives in PostHog's main repository.
July 14, 2025GitHub called MCP in VS Code generally available and moved organization access to the MCP servers in Copilot policy, disabled by default.
May 4, 2026PostHog's MCP server gained an explicit switch between tools mode and CLI mode, through the x-posthog-mcp-mode header or the mode query parameter.
September 30, 2026VS Code 1.140 added Copilot Global and the workspace .mcp.json as destinations in MCP: Add Server.
October 1, 2026PostHog stopped asking MCP clients with non-rotating refresh tokens to authorize again after roughly 67 days.
October 22, 2026VS Code 1.143 made the Copilot harness the default for new sessions.
October 28, 2026VS Code 1.144 and GitHub opened Copilot connectors in preview with 26 services. PostHog was not among them on November 14, 2026.
November 11, 2026VS Code 1.146 deprecated the Local harness that reads .vscode/mcp.json, with removal announced for February 2027. Microsoft's MCP docs pages carry this date.
November 13, 2026@posthog/wizard 2.94.0 was published, and the Ryze AI connector checks for this guide ran.
November 14, 2026PostHog's MCP page counted 1,284 tools in 78 categories. Both fact packs behind this guide were read that day.

Sources: @posthog/wizard on npm, VS Code 1.99, GitHub changelog, April 4, 2025, PostHog/mcp on GitHub, GitHub changelog, July 14, 2025, PostHog changelog, VS Code 1.140, VS Code 1.143, VS Code 1.144, GitHub changelog, October 28, 2026, VS Code 1.146, posthog.com/mcp. Checked November 14, 2026.

How this guide was tested

Two checks ran against the live Ryze AI connector on November 13, 2026, at about 04:20 UTC. Neither one needed PostHog or VS Code. The table shows what each returned.

What was runWhat came back
A request to the connector address with no sign-inHTTP 401 with a WWW-Authenticate header that points to the sign-in details. Per Microsoft's docs, when a server needs OAuth the Copilot runtime asks VS Code to run the sign-in.
The connector's two discovery filesBoth loaded. They name the authorize, token and register endpoints, the authorization code and refresh token grants, PKCE with S256, and the scopes mcp:read and mcp:write. The register endpoint is the piece Dynamic Client Registration needs, and Microsoft's MCP developer guide names that method for VS Code.

Not run for this page: any call to PostHog. No PostHog test account was connected, so the page has no table of tested calls and no error message from a test. No step inside VS Code was run either: the ryze server was not added to Copilot Global, no trust prompt or sign-in was seen, and Copilot Chat sent no tool call. The VS Code steps follow Microsoft's documentation pages dated November 11, 2026 and GitHub's Copilot docs, both read on November 14, 2026. The PostHog figures follow PostHog's pages read the same day. The three tool names come from Ryze AI's own record of the connector, not from a tool list in a signed-in client.

Errors and fixes

No PostHog call ran for this guide, so no message below was seen in a test. The fixes follow the documentation of Ryze AI, PostHog, Microsoft and GitHub.

The MCP server does not start in VS Code
On Copilot Business or Enterprise, ask an administrator to enable the MCP servers in Copilot policy; it is disabled by default. Admins can also block a server with deniedMcpServers or turn MCP off with chat.mcp.access set to none, and a local file cannot override either. Also check the version: MCP needs VS Code 1.99 or later, and Copilot Global needs 1.140.
The sign-in never opens
Trusting the server and authenticating are separate steps, so trust it first. Then choose Authenticate from the ellipsis menu of ryze in MCP Servers, or run MCP: List Servers from the Command Palette to check the state. Show Output in the same menu opens the server's log. Email Ryze AI support if it stays stuck.
I followed an older tutorial and nothing happens
Tutorials built on .vscode/mcp.json target the Local harness. Since VS Code 1.143 new sessions use the Copilot harness, which reads ~/.copilot/mcp-config.json and the workspace .mcp.json and does not read .vscode/mcp.json directly. Re-add the server through Chat: Open Customizations.
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.
Invalid Personal API key.
PostHog's API overview lists this 401 message, code invalid_personal_api_key, for a key it cannot accept. Create a new phx_ key, then disconnect and connect PostHog again in Ryze AI with it.
A query is stopped or returns nothing
Ryze AI expects each HogQL query to set a time window and return 1,000 rows or fewer, and PostHog stops a query after 10 seconds of execution time. Ask for a shorter period or fewer rows.
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.
No PostHog tools appear
If the connector was added before PostHog was connected in Ryze AI, remove the ryze server, add it again and start a new chat so the tool list refreshes.
Cannot have more than 128 tools per request.
VS Code allows 128 enabled tools in one chat request. Deselect tools or whole MCP servers in the tools picker of the Chat view until the count drops.
The one-time connection link is refused
The link from the Ryze AI agent is refused while PostHog is already connected in the workspace. Switch projects or keys in the Ryze AI app instead.
The tool replies that a subscription is required
The PostHog tools need an active Ryze AI plan or free trial. Start the trial in Ryze AI, then retry.

Terms on this page

Agent Customizations editor
The VS Code screen opened by Chat: Open Customizations; its MCP Servers page adds, lists and manages servers.
Copilot Global
The personal MCP destination in VS Code, ~/.copilot/mcp-config.json, read in every workspace and by compatible Copilot experiences such as Copilot CLI on the same machine.
Copilot harness
The runtime behind Copilot sessions in VS Code, built on the Copilot SDK and the default for new sessions since VS Code 1.143. It reads the portable mcpServers files.
Personal API key
A PostHog key starting with phx_ that acts as the user who created it, within the projects and scopes set on it.
Scope
One part of PostHog a key may reach, such as insights or feature flags, granted at a read level or at a write level that includes read.
HogQL
PostHog's name for its SQL, a wrapper around ClickHouse SQL.
Insight
One of the main building blocks of product analytics in PostHog. Trends, funnels and retention are kinds of insight.

Sources: VS Code MCP servers, VS Code MCP configuration reference, PostHog personal API keys, PostHog API scopes, PostHog SQL, PostHog insights. Checked November 14, 2026.

Frequently asked questions

How do I connect VS Code to PostHog?

Connect PostHog in Ryze AI under Integrations with a phx_ personal API key and your host, then pick the Project. In VS Code, with Copilot as the session target, run Chat: Open Customizations, select MCP Servers, choose Add Server, pick HTTP, enter https://connector.get-ryze.ai/mcp and the server ID ryze, trust the server and finish the Ryze AI sign-in.

Is there a PostHog MCP server for VS Code?

Yes. PostHog runs a free hosted server at https://mcp.posthog.com/mcp and documents a VS Code setup: run npx @posthog/wizard mcp add, or add a posthog entry of type http through MCP: Open User Configuration. That page uses the older servers format, so in current VS Code you can also add the same address as an HTTP server in Copilot Global. It asks you to log in to PostHog on first use. The Ryze AI connector at https://connector.get-ryze.ai/mcp also exposes 3 PostHog tools.

Which PostHog server should I use in VS Code?

If PostHog is the only tool you want in VS Code, PostHog's own server covers more of PostHog and signs in with your PostHog login. Ryze AI is the best PostHog connector for VS Code when you want one URL and one workspace for PostHog and your other Ryze AI platforms, but it has 3 tools and needs a Ryze AI plan.

Is there a Copilot connector for PostHog?

Not as of November 14, 2026, when GitHub's supported connectors page named 26 services and PostHog was not one of them. That list is a public preview. For now, add PostHog through a server address, such as the Ryze AI connector or PostHog's own server.

What PostHog access 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 Copilot Chat should change objects. You also enter your host: US Cloud, EU Cloud or a self-hosted URL.

Which Copilot plan do I need?

Any plan. GitHub's plans tables include MCP on Copilot Free, Student, Pro, Pro+, Max, Business and Enterprise, and GitHub's MCP article asks for VS Code 1.99 or later. Copilot Free, Pro, Pro+ and Max are not governed by the MCP policy. On Copilot Business or Enterprise through an organization or enterprise, an administrator must enable the MCP servers in Copilot policy, which is disabled by default.

Can Copilot Chat edit or delete PostHog objects?

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.

Can Copilot see session replays or experiments through Ryze AI?

Ryze AI does not list them. Its PostHog tools cover insights, dashboards, feature flags, cohorts, persons, event definitions, projects and HogQL queries over events, persons and sessions. PostHog's own server lists session replay, experiments, error tracking and surveys among its tools.

Does Copilot Chat ask before it changes PostHog?

By default it asks for any call that is not auto-approved, because new VS Code sessions use Manual permissions and show the tool name and inputs first. Allow all, Autopilot or a server-wide approval in Chat: Manage Tool Approval removes that check. The Ryze AI chat starts on Skip all approvals and scheduled tasks run without an approval step. A key with read scopes only is the firm way to keep it read-only.

Which config file should I use?

For new setups use the portable format, ~/.copilot/mcp-config.json or .mcp.json at the workspace root, with the key mcpServers. The .vscode/mcp.json file with the key servers belongs to the Local harness, which VS Code 1.146 deprecated, with removal announced for February 2027. Copilot harness sessions do not read it directly.

Can I connect more than one PostHog project?

One connection per workspace holds one project. To switch, click View on the PostHog card, disconnect with the trash icon and connect again. Another project can live in another Ryze AI workspace, and you choose the workspace on the Ryze AI page during the sign-in from VS Code.

Why do the PostHog tools not show up in VS Code?

If you added the connector before connecting PostHog in Ryze AI, remove the ryze server, add it again and start a new chat. Also confirm that you trusted the server and finished the Ryze AI sign-in, which are separate steps, and expand a tool call in the conversation to see which server answered.

How much does it cost to connect VS Code 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, Agency is $279 per month, and SEO Starter is $129 per month with a 3-day free trial. Annual billing takes 30% off the first year.

How do I disconnect PostHog from VS Code?

In Chat: Open Customizations, select MCP Servers and disable or uninstall the ryze server from its ellipsis menu. To remove PostHog access itself, disconnect PostHog on its card in Ryze AI and delete the personal API key in PostHog.

Connect PostHog to VS Code with Ryze AI

One Ryze AI connector URL carries the 3 PostHog tools to GitHub Copilot Chat in VS Code. 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.