Posthog MCP Server logo

Posthog MCP Server

Connects AI assistants to PostHog for analytics, feature flags, cohorts, dashboards, and experiment data.

Install Posthog MCP Server

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "posthog-mcp-server-2": {
      "command": "npx",
      "args": [
        "-y",
        "posthog-mcp-server"
      ],
      "env": {
        "POSTHOG_API_KEY": "YOUR_VALUE_HERE",
        "POSTHOG_HOST": "YOUR_VALUE_HERE",
        "POSTHOG_PROJECT": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Claude Code command
claude mcp add --env POSTHOG_API_KEY=YOUR_VALUE_HERE --env POSTHOG_HOST=YOUR_VALUE_HERE --env POSTHOG_PROJECT=YOUR_VALUE_HERE --transport stdio posthog-mcp-server-2 -- npx -y posthog-mcp-server

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

Automated check passed— started and listed 13 tools correctly ().

Overview

The posthog-mcp-server MCP server connects AI assistants to PostHog through the PostHog REST API. It exposes tools for querying events and persons, reading dashboards and saved insights, inspecting feature flags, cohorts, experiments, actions, and project information. Configure it with a PostHog personal API key, host, and optional default project ID, then run it through an MCP client such as Claude Desktop or Cursor. Reach for it when an assistant needs access to product analytics or experimentation data without leaving the MCP workflow.

Use cases

  • Query recent product events
  • Inspect users and their activity
  • Review dashboards and saved insights
  • Check feature flags and experiment results

Key features

  • Filter and list PostHog events
  • Search persons and retrieve user details
  • Read dashboards and execute saved insights
  • List and evaluate feature flags
  • Inspect cohorts and experiments
  • Read project and action metadata

Tools13

What Posthog MCP Server lets your agent do. Expand a tool for its parameters.

Verified live~1.3k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

Not checked yetLast checked

We have not completed a health check for this listing yet.

0/13 checks healthy over the last 58d

What it can do

From the 13 tools this server returned when we ran it.

Runs commands · 1Read-only tools · 12
Network at startup3 connections
Files written at startupNone
Install scriptsNone
npm provenanceNot published
Package age158 days
Maintainers1

Observed 2026-11-11 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 9d ago via OSV.dev · posthog-mcp-server (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

npm downloads250Package downloads in the last 30 days.
Last commit6mo agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed13Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Posthog MCP Server works

What posthog-mcp-server MCP server does

posthog-mcp-server MCP server gives MCP-compatible AI clients access to selected PostHog project data. Its tools cover event queries, user records, dashboards, saved insights, feature flags, cohorts, experiments, actions, and project settings. The server is intended for analysis and inspection: the documented capabilities retrieve data, execute saved insights, and evaluate feature flags for specific users.

Event queries can be filtered by event name, person, date range, and properties. Person tools support lookup by distinct_id as well as paginated searches. Dashboard and insight tools expose dashboard structure, widgets, and results from saved trends, funnels, and other insight types. Experiment tools return test metadata and result information, including variant data and statistical significance.

How it works

The server wraps PostHog REST API v1 and presents its operations as MCP tools. An MCP client starts the server as a Node process, commonly with npx -y posthog-mcp-server, and supplies configuration through environment variables. The assistant can then call the available tools using natural-language requests that map to PostHog queries and lookups.

The available tool groups include:

  • Events and people: list_events, get_person, and list_persons
  • Analytics assets: list_dashboards, get_dashboard, and execute_insight
  • Product controls: list_feature_flags and evaluate_feature_flag
  • Segmentation and testing: list_cohorts, list_experiments, and get_experiment
  • Project metadata: list_actions and get_project_info

Setup and configuration

Create a PostHog personal API key with read access under PostHog settings. Add the server to the MCP client's configuration with the npx command and an env object. POSTHOG_API_KEY is required and should contain the personal key. POSTHOG_HOST defaults to https://us.i.posthog.com; use https://eu.i.posthog.com for the EU region or set it to the URL of a self-hosted PostHog instance.

POSTHOG_PROJECT is optional. When set, it supplies the default project ID for calls. When omitted or empty, the project must be provided for each call. For local testing, clone the repository, run npm install, build with npm run build, and start node dist/index.js with the required environment variables.

Tools and capabilities

The server can list active or available feature flags and evaluate a flag for a named user, returning its variant value. It can list cohorts with their type and person count, inspect experiment status and dates, and retrieve experiment results. Dashboard responses include names, tags, widget counts, and the insights or widgets belonging to a selected dashboard. Project information includes the project name, ID, settings, and data region.

Limitations and notes

The documented API key setup uses read access, and the listed tools focus on retrieval, analysis, execution of saved insights, and flag evaluation rather than creating or updating PostHog resources. A default project is not mandatory, but calls need project context when POSTHOG_PROJECT is unset. The host must match the relevant PostHog cloud region or self-hosted deployment. The server depends on an MCP-compatible client and the PostHog REST API.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Posthog MCP Server

posthog-mcp-server is an MCP server that connects AI assistants to PostHog through its REST API. Its main tools query events, retrieve persons, inspect dashboards and insights, list or evaluate feature flags, review cohorts and experiments, list actions, and return project information for a configured PostHog project.

Install it by configuring your MCP client to run `npx -y posthog-mcp-server`. Add `POSTHOG_API_KEY`, and optionally `POSTHOG_HOST` and `POSTHOG_PROJECT`, to the server environment. For manual testing, clone the repository, run `npm install`, build it, and start `node dist/index.js`.

Yes, posthog-mcp-server works with Cursor. Add an `mcpServers` entry to `.cursor/mcp.json` that runs `npx -y posthog-mcp-server` and supplies the PostHog environment variables. The README also names Claude Desktop, Windsurf, Cline, Continue, and other MCP-compatible clients.

Yes, posthog-mcp-server can connect to self-hosted PostHog by setting `POSTHOG_HOST` to the URL of your PostHog instance. The same variable can select the EU PostHog cloud endpoint, while `POSTHOG_API_KEY` provides authentication.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewPosthog MCP Server AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/posthog-mcp-server-2?style=directory)](https://allmcps.com/mcp/posthog-mcp-server-2)
HTML Embed
<a href="https://allmcps.com/mcp/posthog-mcp-server-2"><img src="https://allmcps.com/api/badge/posthog-mcp-server-2?style=directory" alt="Posthog MCP Server on AllMCPs" /></a>