# PostHog (MCP Server)

> Query product analytics, feature flags, experiments and errors in PostHog

- Type: MCP server
- Publisher: PostHog (official)
- Categories: Data & Analytics, Development
- Website: https://posthog.com/docs/model-context-protocol
- Source: https://github.com/PostHog/posthog
- Transport: streamable-http
- Server URL: https://mcp.posthog.com/mcp
- Sign-in: oauth
- Listed: 2025-05-14

## About

PostHog's official hosted MCP server gives AI assistants access to analytics queries, SQL insights, feature flags, experiments, error tracking and CDP destinations. It is a free remote endpoint; you sign in through PostHog's auth server, which routes you to the US or EU region automatically, and a personal API key can be sent as a bearer token instead. The PostHog wizard (npx @posthog/wizard mcp add) can install it into Codex, Cursor, Claude and VS Code.

## Install

1. **Connect it in ChatGPT** Turn on Developer mode in ChatGPT (Settings → Security and login), open Plugins, select + and paste https://mcp.posthog.com/mcp as the MCP server URL, then sign in with OAuth. Add it to a chat from the composer's tools menu.

2. **Or add it to Codex or the API**

   Codex CLI:

   ```bash
   codex mcp add posthog --url https://mcp.posthog.com/mcp
   codex mcp login posthog
   ```

   config.toml:

   ```toml
   [mcp_servers.posthog]
   url = "https://mcp.posthog.com/mcp"
   ```

   Responses API:

   ```python
   import os
   from openai import OpenAI
   
   client = OpenAI()
   
   response = client.responses.create(
       model="gpt-6-astra",
       tools=[{
           "type": "mcp",
           "server_label": "posthog",
           "server_url": "https://mcp.posthog.com/mcp",
           "authorization": os.environ["POSTHOG_API_KEY"],
           "require_approval": "never",
       }],
       input="How many users signed up last week, broken down by referrer?",
   )
   print(response.output_text)
   ```

## Example prompts

- "How many users signed up last week, broken down by referrer?"
- "Create a feature flag called new-checkout rolled out to 10% of users"
- "What are the top errors in production over the last 24 hours?"
- "Summarize the results of our pricing page experiment"

## Also available as

- plugin: [PostHog](https://chatgptplugins.directory/plugins/posthog.md)
- app: [PostHog](https://chatgptplugins.directory/apps/posthog.md)

## Related

- [Chrome DevTools MCP](https://chatgptplugins.directory/mcp/chrome-devtools.md): Let coding agents control and debug a live Chrome browser
- [Playwright MCP](https://chatgptplugins.directory/mcp/playwright.md): Browser automation for agents via Playwright accessibility snapshots
- [GitHub](https://chatgptplugins.directory/mcp/github.md): Manage repos, issues, pull requests and Actions from your AI agent
- [Context7](https://chatgptplugins.directory/mcp/context7.md): Pull up-to-date, version-specific library docs into your coding agent
- [Supabase](https://chatgptplugins.directory/mcp/supabase.md): Manage Supabase databases, migrations, edge functions and logs
- [Stripe](https://chatgptplugins.directory/mcp/stripe.md): Query and act on your Stripe account and search Stripe docs from any agent

---
Source: https://chatgptplugins.directory/mcp/posthog · Index: https://chatgptplugins.directory/llms.txt · Independent and community-run. Not affiliated with or endorsed by OpenAI. ChatGPT is a trademark of OpenAI.
