You can install the MCP server automatically into popular clients by running the following command:
npx @posthog/wizard@latest mcp add
Obtain a personal API key using the MCP Server preset here.
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/mcp", // You can replace this with https://mcp.posthog.com/sse if your client does not support Streamable HTTP "--header", "Authorization:${POSTHOG_AUTH_HEADER}" ], "env": { "POSTHOG_AUTH_HEADER": "Bearer {INSERT_YOUR_PERSONAL_API_KEY_HERE}" } } } }
The MCP server is hosted on a Cloudflare worker, this can be located outside of the EU / US, so there is no gaurantee that the data will be processed solely within a specific region.
Using self-hosted instancesIf you're using a self-hosted instance of PostHog, you can specify a custom base URL by adding the POSTHOG_BASE_URL
environment variable when running the MCP server locally or on your own infrastructure, e.g. POSTHOG_BASE_URL=https://posthog.example.com
Here are some examples of prompts you can use:
To run the MCP server locally, run the following command:
And replace https://mcp.posthog.com/mcp
with http://localhost:8787/mcp
in the MCP configuration.
This repository is organized to support multiple language implementations:
typescript/
- TypeScript implementation of the MCP server & toolsschema/
- Shared schema files generated from TypeScriptpnpm run dev
- Start development serverpnpm run schema:build:json
- Generate JSON schema for other language implementationspnpm run lint:typescript
- Format and lint code.dev.vars
in the rootdocs-search
tool (see Inkeep API key - mcp
)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/mcp --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:
Arguments:
-y mcp-remote@latest http://localhost:8787/mcp --header "Authorization: Bearer {INSERT_YOUR_PERSONAL_API_KEY_HERE}"
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4