/posthog:api-patternsfrom posthog
Documents PostHog API authentication via Conduit, personal API key scoping, and REST error handling. Use when debugging PostHog auth, rate limits, or understanding read-only enforcement.
Ships in posthog. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
PostHog's API is REST/JSON, reached here through PostHog's own MCP server via the WYRE Conduit gateway. This skill covers the mechanics that aren't guessable from the resource names: how auth is brokered, how PostHog's key scoping actually enforces (or fails to enforce) this plugin's read-only posture, and generic error handling.
insights-and-dashboards, feature-flags-and-experiments, or
cohorts-and-events.This plugin does not accept a local PostHog credential. The operator
connects a PostHog personal API key once, in Conduit's connect UI
(Connections → PostHog); Conduit stores it and injects it into every
upstream request server-side. This plugin's .mcp.json declares no headers
and no environment variables — there is nothing to configure on the client.
{
"mcpServers": {
"posthog": {
"type": "http",
"url": "https://conduit.wyre.ai/v1/posthog/mcp"
}
}
}
PostHog personal API keys carry their own permission model, independent of
whatever Conduit grants. Each key is scoped to specific resource:action
pairs at creation — for example insight:read, feature_flag:read,
dashboard:read. A key minted with only read-side scopes cannot be used
for a write call; PostHog's own API rejects it before the request reaches
this plugin's logic at all.
This is the primary reason this plugin can claim to be read-only, and it is also the primary gap: PostHog does not narrow a key's scopes by default, so a key minted without deliberately restricting scopes is read-write. Setup for this plugin depends on whoever connects PostHog to Conduit having scoped the key correctly — see GOVERNANCE.md, The scope decision happens outside Conduit, at key creation.
There is no second, independent layer for this vendor. PostHog's MCP
server exposes a single tool, exec, that dispatches every operation
through a free-text command string — Conduit's gateway-side allowlist
gates on the MCP tool NAME, and with only one name to gate on, it can only
admit or deny exec wholesale, never exclude specific write commands
within it. The key's own scope is the entire enforcement story for this
vendor; treat a connection as read-write unless you can confirm the
connecting operator actually scoped the key to read-only resources. See
GOVERNANCE.md, Tool permission tiers and The scope decision happens outside Conduit.
Standard REST conventions apply; PostHog does not layer a nonstandard error shape on top of them for the tool families this plugin uses:
| Code | Meaning | Action |
|---|---|---|
| 400 | Bad request | Check the tool's arguments against the target resource |
| 401 | Unauthorized | The connected personal API key is invalid or was revoked — reconnect in Conduit |
| 403 | Forbidden | The key's scopes don't cover the tool being called, or it belongs to the wrong PostHog organization |
| 404 | Not found | The referenced insight, dashboard, flag, cohort, or event doesn't exist in this project |
| 429 | Rate limited | Back off and retry; see Rate Limiting below |
| 5xx | Server error | Retry with backoff |
This plugin does not hardcode PostHog's rate-limit thresholds — they are
not part of the confirmed facts behind this plugin and are subject to
change on PostHog's side. Consult
PostHog's API documentation for current
limits. Treat a 429 the same as any REST API: honor a Retry-After
header if present, back off, and prefer bounded, targeted queries (a named
insight or dashboard, a date-bounded event query) over broad unbounded
pulls, which are the fastest way to hit a limit during a sweep across
multiple clients.
exec
is reachable or it isn't, and naming it in an allowlist is the same as
granting admin. See GOVERNANCE.md.What SKILL.md sets; muted values are Claude Code's defaults
When authenticating to PostHog, reasoning about key scopes, or debugging errors or rate limiting from the PostHog MCP server. Use when: posthog api, posthog auth, posthog authentication, posthog personal api key, posthog scope, posthog rate limit, or posthog error.
Three short reads, in order
4 skills in this plugin
/cohorts-and-eventsPostHog Cohorts & EventsPostHog cohorts (saved user/group segments), raw analytics events, and timeline annotations. Read-only lookups — listing and retrieving existing records, not defining new segments or emitting events.
/feature-flags-and-experimentsPostHog Feature Flags & ExperimentsRead-only lookups of PostHog early-access feature flags and experiments — rollout status, targeting, and configuration. Does not create, update, or delete flags or experiments.
/insights-and-dashboardsPostHog Insights & DashboardsPostHog saved insights (trends, funnels, retention, and similar analytics queries) and the dashboards that group them into a single view. Read-only: running and retrieving existing insights and dashboards, not authoring them.
npx claudepluginhub wyre-ai/msp-claude-plugins --plugin posthogOther plugins' skills for the same job