MCP Directory

PostHog MCP Server (Official Remote)

Official

Official PostHog server: product analytics, feature flags, experiments, error tracking and SQL.

Verified
stdio (local)
API key
TypeScript

Add to your client

Copy the config for your MCP client and paste it into its config file.

Install / run
npx @posthog/wizard@latest mcp add

Paste into ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "posthog-mcp-server-official-remote": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote@latest",
        "https://mcp.posthog.com/mcp",
        "--header",
        "Authorization:${POSTHOG_AUTH_HEADER}"
      ],
      "env": {
        "POSTHOG_AUTH_HEADER": "Bearer <your-personal-api-key>"
      }
    }
  }
}

Before you start

  • A PostHog account (PostHog Cloud US or EU)
  • A PostHog personal API key, created under Settings → Personal API keys; the key is passed as a Bearer token in the POSTHOG_AUTH_HEADER
  • An MCP-compatible client (Claude Desktop/Code, Cursor, VS Code, Windsurf, Zed, etc.)
  • Node.js (for the npx wizard installer) when using local stdio setup; the remote server needs no local runtime
  • Optional: AI data processing enabled in PostHog for LLM-powered tools (e.g. natural-language SQL)

About PostHog MCP Server (Official Remote)

The official PostHog MCP server connects AI agents and IDEs to your PostHog project so they can read and write across PostHog's products: product analytics, feature flags, experiments, dashboards, error tracking, SQL/HogQL queries, and LLM observability. It is most commonly used as a hosted remote server at https://mcp.posthog.com/mcp, which automatically routes to the correct US or EU data region based on your login.

The agent can do real work, not just read metrics: create and toggle feature flags, run insight and SQL queries, build dashboards, triage error-tracking issues, launch and analyze experiments, and inspect LLM traces and cost breakdowns. This makes it useful for natural-language analytics ("how many signups last week?") as well as for shipping flags and debugging production errors from inside your editor.

The original PostHog/mcp repository was archived in January 2026 and the code now lives in the PostHog monorepo (PostHog/posthog), but it remains actively maintained and officially supported. The fastest way to install it into a client is the PostHog wizard: npx @posthog/wizard@latest mcp add.

Tools & capabilities (12)

feature-flag-get-all

List all feature flags in the project, with create/update/delete and status tools

create-feature-flag

Create a new feature flag, including rollout and targeting conditions

insight-query

Run an insight/trend query and return product-analytics results

execute-sql

Run a HogQL/SQL query against PostHog event and warehouse data

dashboard-create

Create dashboards and add insight tiles (with get/update/delete tools)

experiment-create

Create A/B experiments; launch, pause, end, and read results

experiment-results-get

Fetch statistical results and timeseries for a running experiment

query-error-tracking-issues-list

List error-tracking issues; fetch issue details, events, and merge/triage

query-llm-traces-list

Inspect LLM traces and observability data captured by PostHog

get-llm-total-costs-for-project

Return LLM usage and cost breakdowns for the project

read-data-warehouse-schema

Read the available event/warehouse schema to write correct queries

switch-project

Switch active organization/project and read org/project settings

When to use it

  • Use it when you want to ask analytics questions in natural language and have the agent write the HogQL/SQL and run the insight for you
  • Use it when you want to create, toggle, or roll out a feature flag without leaving your editor
  • Use it when you need to triage and merge error-tracking issues from production
  • Use it when you want to spin up or analyze an A/B experiment and read its statistical results
  • Use it when you want to build or update a dashboard from a conversation
  • Use it when you want to inspect LLM traces and monitor token spend on your AI features

Quick setup

  1. 1Create a personal API key in PostHog under Settings → Personal API keys
  2. 2Run `npx @posthog/wizard@latest mcp add` and pick your client, or manually point your client at the remote endpoint `https://mcp.posthog.com/mcp`
  3. 3Supply the key as a Bearer token via the POSTHOG_AUTH_HEADER (the wizard prompts for it)
  4. 4Restart your MCP client so it picks up the new server
  5. 5Verify by asking the agent to list your feature flags or run a simple insight query

Security notes

The personal API key is sent as a Bearer token and can read analytics, feature flags, and error data; scope it tightly and rotate it if exposed. The connection goes out to PostHog Cloud, so confirm you log in with the correct US/EU region account to keep data in-region.

PostHog MCP Server (Official Remote) FAQ

Is this the official PostHog MCP server?

Yes. It is built and maintained by PostHog. The standalone PostHog/mcp repo was archived in January 2026 and the code now lives in the PostHog monorepo, but it is still the official, supported server.

Do I need to run anything locally?

No. The recommended setup is the hosted remote server at https://mcp.posthog.com/mcp. The npx wizard just writes the config into your client; the remote endpoint handles execution and region routing.

How do I authenticate?

Create a PostHog personal API key and pass it as a Bearer token in the POSTHOG_AUTH_HEADER. The wizard sets this up for you.

Does it work with the EU data region?

Yes. The remote endpoint automatically routes to the US or EU instance based on the account your API key belongs to.

What can it actually do besides read data?

It can write: create/update feature flags, build dashboards, create and launch experiments, run SQL, and triage error-tracking issues, in addition to querying analytics and LLM observability.

Alternatives to PostHog MCP Server (Official Remote)

Official Elastic server: list indices, read mappings, and search with Query DSL.

Verified
stdio (local)
API key
TypeScript
5 tools
Updated 4 months agoRepo

Run PromQL queries and analyze Prometheus metrics from any MCP client.

Verified
stdio (local)
No auth
Python
6 tools
Updated 1 month agoRepo

Datadog's managed remote server: query logs, metrics, traces, monitors and incidents.

Verified
HTTP (remote)
OAuth
TypeScript
11 tools
Updated 1 month agoRepo