# PostHog MCP

> Lets your agent query your PostHog analytics, triage errors, and create feature flags and experiments from plain-language asks.

PostHog's own hosted MCP server. It gives your agent PostHog's products as tools, so you can ask about your product data, dig into errors and logs, and create feature flags, experiments, dashboards and surveys in plain words. Connecting and calling its tools is free; standard PostHog usage and billing apply to the data your queries use.

What you can do with it
- Ask analytics questions and get answers from real trends, funnel, paths and retention queries, or run SQL (HogQL)
- Find your top errors, pull full stack traces and propose fixes, then resolve issues and set assignment rules
- Search logs and check ingestion warnings to see why events were dropped
- Create and roll out feature flags, multivariate flags, A/B experiments and early access features
- Build dashboards, insights, cohorts, surveys and notebooks
- Set up CDP destinations and workflows, such as a Slack message when someone signs up
- Triage support tickets, act on change requests, set reminders and search PostHog's docs

How it connects
PostHog hosts it at https://mcp.posthog.com/mcp. Sign in with OAuth, PostHog's recommended way, and it routes you to your US or EU data region based on your account. If your agent doesn't support OAuth, use a personal API key made with the MCP Server preset as a bearer token. PostHog's wizard (npx @posthog/wizard mcp add) installs it in Claude Code, Claude Desktop, Cursor, Codex, VS Code and Zed, and it's in Claude's connectors directory. PostHog also documents setup for Windsurf, Lovable, Replit and v0.

Good to know
- Add ?readonly=true to the address to expose only tools that read, never ones that create, update or delete.
- Use ?features= or ?tools= to limit it to particular products or tools, and pin it to one organization or project with headers or query parameters.
- Most agents see a single exec tool that finds and runs PostHog's tools on demand, which saves context; Cursor gets every tool individually. Add ?mode=tools or ?mode=cli to choose.
- Some tools use LLMs and count as PostHog AI spend; they only appear when AI data processing is enabled for your organization.
- PostHog advises reviewing tool calls before they run, because of prompt injection.
- PostHog also offers a plugin for Claude Code, Codex, Cursor and Gemini CLI that adds slash commands on top of this server.

- Type: Plugin
- Made by: posthog
- Category: Data & analytics
- Formats: Remote MCP
- Version: 1.0.1
- Website: https://posthog.com/docs/model-context-protocol
- Source: https://github.com/posthog/posthog/tree/HEAD/services/mcp
- Page: https://pluginboard.ai/plugins/posthog-mcp

## Works with

- ChatGPT
- Claude
- Muse
- Grok Bot
- Gemini
- Grok
- GitHub Copilot
- Cursor
- Claude Code
- Codex
- Antigravity
- Gemini CLI
- Replit
- OpenClaw
- OpenCode
- Hermes Agent

## Install

You'll need:

- `Authorization` (required): Bearer token with your PostHog personal API key. Create one at https://us.posthog.com/settings/user-api-keys with the 'MCP Server' preset.

Replace each `<NAME>` placeholder with your own value.

### ChatGPT

In ChatGPT on the web: Plugins → + → Add custom MCP server, then paste https://mcp.posthog.com/mcp under Connection. Business and Enterprise plans; Pro can add read-only servers.

### Claude

In Claude (web or desktop): Customize → Connectors → Add custom connector, then paste https://mcp.posthog.com/mcp

### Muse

In Muse: In a Muse chat, ask it to create a custom connector for the MCP server at https://mcp.posthog.com/mcp. Then tap Connect on the card it shows and sign in, or add your key.

### Grok Bot

In Grok Bot: In a chat with your Bot, say "Add this MCP server: https://mcp.posthog.com/mcp". It confirms the details with you and sets it up, and the tools are ready from your next message.

### Grok

In Grok on the web: At grok.com/connectors: New Connector → Custom, then enter https://mcp.posthog.com/mcp and sign in if it asks.

### GitHub Copilot

Add to VS Code: vscode:mcp/install?%7B%22name%22%3A%22posthog-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fmcp.posthog.com%2Fmcp%22%7D

Copilot CLI:

```shell
copilot mcp add --transport http --header 'Authorization: <Authorization>' posthog-mcp https://mcp.posthog.com/mcp
```

### Cursor

Add to Cursor: cursor://anysphere.cursor-deeplink/mcp/install?name=posthog-mcp&config=eyJ1cmwiOiJodHRwczovL21jcC5wb3N0aG9nLmNvbS9tY3AiLCJoZWFkZXJzIjp7IkF1dGhvcml6YXRpb24iOiI8QXV0aG9yaXphdGlvbj4ifX0%3D

Add to .cursor/mcp.json:

```json
{
  "mcpServers": {
    "posthog-mcp": {
      "url": "https://mcp.posthog.com/mcp",
      "headers": {
        "Authorization": "<Authorization>"
      }
    }
  }
}
```

### Claude Code

Run in your terminal:

```shell
claude mcp add --transport http --header 'Authorization: <Authorization>' posthog-mcp https://mcp.posthog.com/mcp
```

### Codex

Run in your terminal:

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

### Antigravity

Add to ~/.gemini/config/mcp_config.json:

```json
{
  "mcpServers": {
    "posthog-mcp": {
      "url": "https://mcp.posthog.com/mcp",
      "headers": {
        "Authorization": "<Authorization>"
      }
    }
  }
}
```

### Gemini CLI

Run in your terminal:

```shell
gemini mcp add --transport http --header 'Authorization: <Authorization>' posthog-mcp https://mcp.posthog.com/mcp
```

### Replit

In Replit: At replit.com/integrations, open MCP Servers → + Add MCP server, paste https://mcp.posthog.com/mcp (add any headers under Advanced settings), then click Test & save.

### OpenClaw

Run in your terminal:

```shell
openclaw mcp add posthog-mcp --url https://mcp.posthog.com/mcp --transport streamable-http
```

If it needs a key or sign-in: For https://mcp.posthog.com/mcp, add --header NAME=value for each header it needs, or --auth oauth and then run openclaw mcp login posthog-mcp.

### OpenCode

Run in your terminal:

```shell
opencode mcp add posthog-mcp --url https://mcp.posthog.com/mcp
```

If it needs a key: For https://mcp.posthog.com/mcp, add --header 'NAME=value' for each header it needs. Add --global to use it in every project.

### Hermes Agent

Run in your terminal:

```shell
hermes mcp add posthog-mcp --url https://mcp.posthog.com/mcp
```

Add to ~/.hermes/config.yaml:

```json
{
  "mcp_servers": {
    "posthog-mcp": {
      "url": "https://mcp.posthog.com/mcp",
      "headers": {
        "Authorization": "<Authorization>"
      }
    }
  }
}
```

If it signs in with OAuth: If https://mcp.posthog.com/mcp asks you to sign in, add --auth oauth to the command, or auth: oauth to its entry.

---
From Pluginboard (https://pluginboard.ai).
