Skip to main content
Back to the PostHog MCP server

MCP Gateway · Claude

PostHog icon

Connect PostHog to Claude

Product managers, marketers and founders can ask Claude about their PostHog data in plain language. Claude runs the query, finds an insight someone already built, or reports how a survey is performing. Each person connects through the organization's custom connector, and the gateway limits them to the PostHog tools their role allows.

Category
Data & analytics
Tools
172
Authentication
API key
Claude
Web, desktop and mobile

Behind the MCP Gateway

Run PostHog MCP behind the MCP Gateway

One URL for every agent, sign-in through your IdP, RBAC down to the tool, and every PostHog call inspected and logged.

Deploy on MCP Gateway

Set up

Add PostHog to Claude in 4 steps

  1. 01

    Add PostHog from the catalog

    An admin finds PostHog in the MCP Catalog (MCP Gateway > MCP > Catalog) and clicks Add. Speakeasy registers the vendor's server as a remote MCP server and proxies sessions to it. Nothing is copied or re-hosted.

    PostHog authenticates with an API key. Enter it under Upstream headers in the install dialog, or later on the server's Settings tab. The key is stored on the server, sent with every upstream request, and never reaches anyone's client configuration.

    Where MCP-scoped policies are enabled, the install offers a recommended risk policy for the new server that detects secrets and PII and inspects tool requests and responses.

  2. 02

    Choose who can use PostHog

    Give teams the mcp:connect scope on the PostHog server through team access or a role. The organization gateway works out each person's servers from their live access, so granting access adds PostHog to their gateway on the next call, and removing it takes it away.

  3. 03

    Connect Claude

    Add the gateway URL as a custom connector, then connect it from Customize > Connectors.

    On Team and Enterprise plans, an Owner opens Organization settings > Connectors, chooses Add > Custom > Web and pastes the gateway URL.

    Each person opens Customize > Connectors and clicks Connect to sign in.

    On Pro and Max plans, each person adds it themselves under Customize > Connectors, with + Add > Add custom connector.

  4. 04

    Sign in and use PostHog from Claude

    The first time Claude connects, it opens a browser so the person can sign in to Speakeasy through your identity provider.

    From then on, PostHog's tools appear in Claude, limited to what the person's access allows, and every call lands in the gateway's tool logs.

No client ID or secret is needed: the gateway's sign-in handles client registration. Each person only sees the servers their role can reach.

Use cases

What Claude users do with PostHog

Answer a product question

Ask how many people signed up last week, or which pages new users visit first. Claude writes and runs the query against your PostHog data and explains the result.

query-run

Find an insight someone built

Describe the chart you remember. Claude searches PostHog entities by name and description, finds the insight and returns its current results.

entity-searchinsight-query

Check how a survey is doing

Claude gets response statistics for a survey, including how often it was shown, dismissed and answered, and summarizes whether it needs changes.

survey-stats

Tools

172 tools

Each PostHog tool can be allowed or denied per team and role at the MCP Gateway before Claude sees it.

experiment-get-all

Get all experiments in the project.

experiment-create

Create a comprehensive A/B test experiment. , ['product_view', 'add_to_cart', 'purchase']) and use funnel_steps parameter 6) Configure variants (default 50/50 control/test unless they specify otherwise) 7) Set targeting criteria if needed.

experiment-delete

Delete an experiment by ID.

experiment-update

Update an existing experiment by ID. Can update name, description, lifecycle state, variants, metrics, and other properties. RESTART WORKFLOW: To restart a concluded experiment, set end_date=null, conclusion=null, conclusion_comment=null, and optionally set a new start_date.

experiment-get

Get details of a specific experiment by ID.

See all 172 tools

Control

What Speakeasy can see and stop in Claude

The gateway covers every client the same way. The rest depends on what Claude exposes to Speakeasy.

Tool logs

Gateway

Every PostHog call is logged with the person and the client that made it.

Access by role

Gateway

People reach only the PostHog tools their team or role allows.

Request and response blocking

Gateway

A risk policy scoped to PostHog can reject a tool request before it reaches the server, or withhold a result from Claude. MCP-scoped policies are enabled per organization.

Anthropic inference hooks

Claude

On Claude Enterprise, each prompt is sent to Speakeasy before inference and denied prompts are blocked (beta). Inference hooks can't rewrite or redact a prompt.

Conversation import

Claude

Claude conversations can be imported through Anthropic's Compliance API for review after the fact.

  • Custom connectors need a Claude plan that supports them.
  • Budgets don't cover Claude web and desktop usage.

Questions

Frequently asked questions

Can product managers use PostHog in Claude without changing flags?
Yes. Tools are allowed or denied per team and role at the gateway, so a product role can query data and read surveys without tools such as update-feature-flag.
Can PostHog prompts in Claude be checked before they run?
On Claude Enterprise, Anthropic inference hooks send each prompt to Speakeasy before inference and block denied prompts (beta). The hooks can't rewrite or redact a prompt.
How do Claude users get PostHog?
An admin adds PostHog from the Speakeasy MCP Catalog and grants access by team or role. Add the gateway URL as a custom connector, then connect it from Customize > Connectors. Each person then sees only the PostHog tools their access allows.
Are PostHog calls from Claude logged?
Yes. PostHog calls go through the MCP Gateway, which logs each tool call and attributes it to the person and the client that made it.

Connect more

PostHog in other clients

AI everywhere.

Control here.