analytics
PostHog MCP Gateway for AI Agents
Expose PostHog tools to Claude Code, Cursor, Codex, and other MCP clients through the local KosmoKrator MCP gateway.
15 functions 11 read 4 write API token auth
PostHog MCP Gateway
Expose PostHog to MCP clients with `kosmokrator mcp:serve --integration=posthog`.
If the client has never used KosmoKrator before, install it first, then register this integration as a stdio MCP server. The gateway exposes only the selected integration in the example below.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash kosmokrator mcp:gateway:install --integration=posthog --write=deny --json {
"mcpServers": {
"kosmokrator-posthog": {
"type": "stdio",
"command": "kosmo",
"args": [
"mcp:serve",
"--integration=posthog",
"--write=deny"
]
}
}
} Serve Manually
kosmokrator mcp:serve --integration=posthog --write=deny MCP Tool Names
KosmoKrator exposes integration tools through the gateway with stable names:
MCP Tool Names (15 tools)
| MCP tool | Source function | Type |
|---|---|---|
integration__posthog__posthog_capture_event | posthog.posthog_capture_event | Write write |
integration__posthog__posthog_list_events | posthog.posthog_list_events | Read read |
integration__posthog__posthog_get_event | posthog.posthog_get_event | Read read |
integration__posthog__posthog_list_persons | posthog.posthog_list_persons | Read read |
integration__posthog__posthog_get_person | posthog.posthog_get_person | Read read |
integration__posthog__posthog_list_feature_flags | posthog.posthog_list_feature_flags | Read read |
integration__posthog__posthog_get_feature_flag | posthog.posthog_get_feature_flag | Read read |
integration__posthog__posthog_create_feature_flag | posthog.posthog_create_feature_flag | Write write |
integration__posthog__posthog_update_feature_flag | posthog.posthog_update_feature_flag | Write write |
integration__posthog__posthog_delete_feature_flag | posthog.posthog_delete_feature_flag | Write write |
integration__posthog__posthog_list_insights | posthog.posthog_list_insights | Read read |
integration__posthog__posthog_get_insight | posthog.posthog_get_insight | Read read |
integration__posthog__posthog_list_dashboards | posthog.posthog_list_dashboards | Read read |
integration__posthog__posthog_get_dashboard | posthog.posthog_get_dashboard | Read read |
integration__posthog__posthog_list_cohorts | posthog.posthog_list_cohorts | Read read |
Write Access
Start with --write=deny for read-only MCP clients. Use --write=ask or
--write=allow only when the client and workspace are trusted.