# Run agents with PostHog

PostHog AI agents on Rush: connect PostHog once, then name it on any run. The agent works in its own cloud computer, with a record of every run.

[Connect PostHog](https://cloud.getrush.ai/console/settings/?section=connections) in the console under Settings → Connections.

## What an agent can do in PostHog

Query product analytics, feature flags, experiments, error tracking and logs, and build insights and dashboards.

Skills from PostHog's agent plugin that join every run reaching this server:

- [investigating-error-issue](https://github.com/PostHog/ai-plugin/tree/e0fbf5e742fb4242c4ea509b395b2e343642f0b7/skills/investigating-error-issue)
- [investigating-logs](https://github.com/PostHog/ai-plugin/tree/e0fbf5e742fb4242c4ea509b395b2e343642f0b7/skills/investigating-logs)
- [building-a-dashboard](https://github.com/PostHog/ai-plugin/tree/e0fbf5e742fb4242c4ea509b395b2e343642f0b7/skills/building-a-dashboard)

## Jobs on Rush that use PostHog

- [Summarize Each Customer's Product Usage From PostHog Through an API](https://getrush.ai/run/account-activity-summary/posthog/)
- [Summarize PostHog Experiment Results](https://getrush.ai/run/experiment-results/posthog/)
- [Find Where Users Drop Off in a PostHog Funnel](https://getrush.ai/run/funnel-drop-off-report/posthog/)
- [Build a Retention Cohort Report From PostHog](https://getrush.ai/run/retention-cohort-report/posthog/)
- [Find Stale Feature Flags in PostHog](https://getrush.ai/run/stale-feature-flags/posthog/)
- [Get a Weekly Product Metrics Report From PostHog](https://getrush.ai/run/weekly-product-metrics/posthog/)
- [Fix Angular Exceptions From PostHog Error Tracking](https://getrush.ai/run/fix-posthog-exceptions/angular/)
- [Fix Django Exceptions From PostHog Error Tracking](https://getrush.ai/run/fix-posthog-exceptions/django/)
- [Fix Next.js Exceptions From PostHog Error Tracking](https://getrush.ai/run/fix-posthog-exceptions/nextjs/)
- [Fix Nuxt Exceptions From PostHog Error Tracking](https://getrush.ai/run/fix-posthog-exceptions/nuxt/)
- [Fix React Exceptions From PostHog Error Tracking](https://getrush.ai/run/fix-posthog-exceptions/react/)
- [Fix SvelteKit Exceptions From PostHog Error Tracking](https://getrush.ai/run/fix-posthog-exceptions/sveltekit/)
- [Fix Vue Exceptions From PostHog Error Tracking](https://getrush.ai/run/fix-posthog-exceptions/vue/)
- [Find Why Signups Dropped in a Next.js App](https://getrush.ai/run/investigate-conversion-drop/nextjs/)

## How PostHog connects

PostHog is a remote MCP server, published by PostHog, at `https://mcp.posthog.com/mcp`. Connecting it signs in through the MCP OAuth flow on PostHog's side.

From PostHog: [PostHog's MCP documentation](https://posthog.com/docs/model-context-protocol) · [source code](https://github.com/PostHog/ai-plugin).

Connect it once in the console under Settings → Connections, or from your server with `POST /me/connections`. The sign-in finishes in a browser signed in to the console as the same person, and a link not finished within 10 minutes expires.

After that, a run that names `posthog` in `connections`, or runs a saved agent that names it, gets it; your connections reach no run that does not name them.

```http
POST https://api.phoenix.so/me/connections

{
  "type": "mcp",
  "name": "PostHog",
  "url": "https://mcp.posthog.com/mcp"
}
```

## Whose PostHog account the agent uses

Your PostHog connection is personal: it belongs to the person who signed in. A run started in the console uses that person's PostHog, and a run started with an API key uses the PostHog of the member who created the key.

To act for your own app's users, make each user an agent from your template and show them, signed in to your app, the sign-in link `POST /o/{org}/agents/{agent}/connections` returns. They sign in to their own PostHog, and that agent's runs use their account and nothing else: never yours, never another user's.

## Frequently asked questions

### How do I connect PostHog to Rush?

Open Settings → Connections in the console and connect PostHog, or send `POST /me/connections` with `{"type":"mcp","name":"PostHog","url":"https://mcp.posthog.com/mcp"}` and open the `authorize_url` it returns while signed in to the console. The connection reads `pending` until the sign-in finishes, then `connected`.

### Does every run get my PostHog account?

No. A run gets your PostHog connection only when it names it in `connections` (`"connections": ["posthog"]`), or runs a saved agent that names it. A saved agent names its connections once, and every run of it gets them.

### What can an agent do in PostHog?

Query product analytics, feature flags, experiments, error tracking and logs, and build insights and dashboards. 14 published jobs use it; this page lists them.

### Which skills come with PostHog?

`investigating-error-issue`, `investigating-logs`, `building-a-dashboard`, from PostHog's own agent plugin, pinned to a commit. They join every run that reaches PostHog's MCP server, inside the run's 96 KiB skills limit.

## Keep reading

- [AI agents for product and project management teams: every job and app for them](https://getrush.ai/solutions/product/)
- [How connections work: sign in once, then every run that names a connection gets it](https://getrush.ai/docs/concepts/connections/)
- [Start your first run from the developer API quickstart](https://getrush.ai/docs/quickstart/)
- [Pricing: one price per member, hours shared by the team](https://getrush.ai/pricing/)
- [How Rush compares with other cloud agents](https://getrush.ai/compare/)
- [Every app and MCP server Rush connects to](https://getrush.ai/integrations/)
