Skip to content

PostHog/mcp

Repository files navigation

PostHog MCP

Use the MCP Server

Quick install

You can install the MCP server automatically into popular clients by running the following command:

npx @posthog/wizard@latest mcp add

Manual install

  1. Obtain a personal API key using the MCP Server preset here.

  2. Add the MCP configuration to your desktop client (e.g. Cursor, Windsurf, Claude Desktop) and add your personal API key

{
  "mcpServers": {
    "posthog": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote@latest",
        "https://mcp.posthog.com/sse",
        "--header",
        "Authorization:${POSTHOG_AUTH_HEADER}"
      ],
      "env": {
        "POSTHOG_AUTH_HEADER": "Bearer {INSERT_YOUR_PERSONAL_API_KEY_HERE}"
      }
    }
  }
}

Here are some examples of prompts you can use:

  • What feature flags do I have active?
  • Add a new feature flag for our homepage redesign
  • What are my most common errors?

Development

To run the MCP server locally, run the following command:

pnpm run dev

And replace https://mcp.posthog.com/sse with http://localhost:8787/sse in the MCP configuration.

Environment variables

  • Create .dev.vars in the root
  • Add Inkeep API key to enable docs-search tool (see Inkeep API key - mcp)
INKEEP_API_KEY="..."

Configuring the Model Context Protocol Inspector

During development you can directly inspect the MCP tool call results using the MCP Inspector.

You can run it using the following command:

npx @modelcontextprotocol/inspector npx -y mcp-remote@latest http://localhost:8787/sse --header "\"Authorization: Bearer {INSERT_YOUR_PERSONAL_API_KEY_HERE}\""

Alternatively, you can use the following configuration in the MCP Inspector:

Use transport type STDIO.

Command:

npx

Arguments:

-y mcp-remote@latest http://localhost:8787/sse --header "Authorization: Bearer {INSERT_YOUR_PERSONAL_API_KEY_HERE}"

About

Official PostHog MCP Server 🦔

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy