opensre integrations setup posthog.
Tools
The agent typically calls
list_posthog_tools first to discover what is available for your project, then call_posthog_tool with the chosen tool name and arguments.
The hosted PostHog MCP server exposes 240+ tools, each with a full input schema. Returning all of them at once is far larger than any model’s context window, so list_posthog_tools returns a compact, bounded listing — tool names plus short descriptions, without schemas. To work with it efficiently:
- Pass
name_filter(space- or comma-separated terms, e.g."events query sql") to narrow the list to relevant tools. - Pass
include_schema=trueon a narrowed list to fetch the full input schema for the specific tool you intend to call.
call_posthog_tool with tool_name="execute-sql" and a HogQL query (e.g. SELECT event, count() FROM events WHERE ... GROUP BY event). There is no search_events tool.
Prerequisites
- A PostHog account (US or EU — the hosted server routes you automatically)
- A PostHog personal API key created with the MCP Server preset. See PostHog’s personal API keys docs.
OpenSRE defaults to read-only access (
x-posthog-read-only: true) so investigations cannot mutate your PostHog project. Set POSTHOG_MCP_READ_ONLY=false only if you explicitly want the agent to perform writes.Setup
Option 1: Interactive CLI
POSTHOG_MCP_MODE=stdio via environment variables (see below).
To skip the menu, name the service directly:
Option 2: Environment variables
Add to your.env:
To run a local PostHog MCP server instead of the hosted endpoint, use
stdio mode:
Option 3: Persistent store
Verify
MCP Server preset and that outbound HTTPS to mcp.posthog.com is allowed.
Metric report (scheduled)
Deliver a per-metric PostHog analytics pulse to Telegram, Slack, or Rocket.Chat, on demand or on a schedule — coworker-style digests (what moved and why it matters), not a raw dashboard dump. Slack delivery needs a bot token (a webhook alone cannot honor--chat-id). This uses the headless posthog-summary skill path (schema discovery, then one bounded HogQL query per metric), not the investigation pipeline or generic opensre cron kinds. It requires the PostHog MCP integration above — the REST posthog integration alone cannot serve it.
Example — every Monday at 08:00 London time to Telegram:
C… member/channel id):
SLACK_BOT_TOKEN. A SLACK_WEBHOOK_URL alone will not work here: a webhook always posts to the one channel it was created for, so it cannot honour --chat-id.
--period accepts a relative window (24h, 7d, 30d; default 7d). Optional --metrics narrows the report to a comma-separated set instead of the default metric set.
The gateway daemon picks up scheduled reports automatically when it is running. If the LLM is unavailable, the run fails with an error (no deterministic fallback).
The report compares the current window against the previous comparable window per metric. Real zeros are reported as zeros; failed queries are called out as failures — never silently widened or fabricated, and never presented as zero when the query did not run.