How to connect PostHog to Hermes Agent
Connect PostHog to Hermes with ClawLink: paste your PostHog key once and 502 tools work from chat. No MCP server to run, nothing stored on your machine.


Track user behavior and feature flags. Once connected, Hermes Agent can read and act on PostHog from chat — pairing, token refresh, and tool wiring handled for you.
Most guides for giving Hermes Agent PostHog access start with registering your own OAuth app or pasting API keys into env files, then leave the token refresh and tool wiring to you. ClawLink gives Hermes a more practical PostHog setup: pair once in the browser and your always-on Hermes agent can act on PostHog for you, reading and doing real work on your behalf with no auth, token refresh, or tool wiring to build yourself.
Copy this prompt into Hermes to install the plugin and pair your account.
Set up ClawLink for Hermes and tell me when it's ready.
1. Install the plugin:
hermes plugins install ClawLink-HQ/hermes-plugin --enable
2. Start pairing. It prints an approval link, so show me the link and stop, don't wait:
hermes clawlink begin
3. I'll approve it in my browser, then reply "approved".
4. When I say approved, finish setup:
hermes clawlink finish
5. Then run `hermes clawlink test` and tell me whether ClawLink is ready.Setup
It takes three steps to connect Hermes to PostHog.
1Install and pair
Install the ClawLink plugin, then pair Hermes with a one-time browser approval:
hermes plugins install ClawLink-HQ/hermes-plugin --enable- 2
Connect PostHog
Paste your API key in the dashboard.
- 3
Use it from chat
Ask Hermes Agent: "What can you do with PostHog?"
Install by command
The prompt above walks Hermes through this. By hand, it is four commands and a browser approval:
hermes plugins install ClawLink-HQ/hermes-plugin --enable
hermes clawlink begin # prints an approval link — open it and approve
hermes clawlink finish # after approving in the browser
hermes clawlink testThen connect PostHog in the ClawLink dashboard — paste your PostHog API key once.
Verify the connection by asking Hermes:
Build a funnel in project <id> with posthog_create_query_in_project_by_id: signup to first feature use over the last 30 days, and tell me where the biggest drop-off is.
Using a different agent?
The Hermes plugin is one client of ClawLink's MCP server. Claude Code, Cursor, Codex, or any agent that can run a shell command pairs with the same ClawLink account through the CLI:
npx -y @useclawlink/cli loginlogin opens the same browser approval and stores a credential locally. Once PostHog is connected in the dashboard, that agent calls the same 502 PostHog tools over MCP. Full setup for MCP clients and shell agents: connect apps to any AI agent.
PostHog MCP for Hermes
Looking for a PostHog MCP server for Hermes Agent? ClawLink connects PostHog to Hermes Agent and exposes 502 PostHog tools your agent can call over MCP, with hosted auth and nothing to run or maintain yourself. Using OpenClaw instead? The OpenClaw PostHog integration works the same way.
Google's answer to "PostHog agent without an API key" opens with a true sentence: you cannot run an agent that interacts with your private PostHog data without a PostHog API key. The distinction this page draws is whose key, and who does the plumbing. You already have a PostHog personal API key, or can create one in your PostHog settings; the step that usually follows, wiring it into a config file, an MCP server, or a .env, is the step ClawLink removes. You paste your existing PostHog key once on a hosted setup page, Hermes pairs with hermes clawlink begin and hermes clawlink finish, and the 502 PostHog tools below become callable from chat. You create no key plumbing; you reuse the key you have, held server-side, where the agent never sees it and revoking it in the dashboard cuts access at once.
What the Hermes Agent PostHog integration can do
502 PostHog tools are ready for Hermes Agent once the account is connected. The 30 below are the ones people reach for most; your agent can call all 502.
30 of 502 PostHog tools for Hermes
| Tool | What it does |
|---|---|
Get event definitions posthog_get_event_definitions | List event definitions in a PostHog project |
Get experiment details posthog_get_experiment_details | Get details for a specific experiment |
Get experiments stats posthog_get_experiments_stats | Get statistics for experiments |
Get feature flag details posthog_get_feature_flag_details | Get details for a specific feature flag |
Get feature flag status posthog_get_feature_flag_status | Get the status of a feature flag |
Get funnel insights in project posthog_get_funnel_insights_in_project | Get funnel insights in a PostHog project |
Get group property definitions posthog_get_group_property_definitions | Get group property definitions |
Get project person trends posthog_get_project_person_trends | Get person trends for a PostHog project |
List and manage project feature flags posthog_list_and_manage_project_feature_flags | List feature flags in a PostHog project |
List groups by type posthog_list_groups_by_type | List groups by type in a PostHog project |
List organization members posthog_list_organization_members | List members of your PostHog organization |
List organization projects posthog_list_organization_projects | List all projects in your PostHog organization |
List project actions posthog_list_project_actions | List actions in a PostHog project |
List project dashboards posthog_list_project_dashboards | List dashboards in a PostHog project |
List project experiments posthog_list_project_experiments | List A/B experiments in a PostHog project |
List project session recordings posthog_list_project_session_recordings | List session recordings in a PostHog project |
List project surveys posthog_list_project_surveys | List surveys in a PostHog project |
Check pipeline destination updates posthog_check_pipeline_destination_updates | Check for available updates to a pipeline destination plugin by comparing the currently |
Check pipeline import app updates posthog_check_pipeline_import_app_updates | Retrieve the latest update information for a specific pipeline import app by its ID within an |
Check pipeline plugin update status posthog_check_pipeline_plugin_update_status | Get update status for a specific pipeline transformation plugin by its unique ID within an |
Check project demo data generation status posthog_check_project_demo_data_generation_status | Check if a project is currently generating demo data |
Create llm analytics summarization posthog_create_llm_analytics_summarization | Generate an AI-powered summary of an LLM trace or event |
Create llm analytics text representation posthog_create_llm_analytics_text_representation | Generate human-readable text representations of LLM trace events for display, logging, or |
Create person path posthog_create_person_path | Retrieve path analytics for a specific person within a PostHog project |
Create project retention insight posthog_create_project_retention_insight | Create and retrieve retention insights for a project using PostHog's Query API |
Create query in project by ID posthog_create_query_in_project_by_id | The /api/projects/\{project_id\}/query/ POST endpoint allows users to submit queries for a |
Create session recording summary posthog_create_session_recording_summary | Generate an AI-powered summary for a session recording |
Generate insight name posthog_generate_insight_name | Generate an AI-suggested name for a PostHog insight based on its query configuration |
Generate project funnel correlation insight posthog_generate_project_funnel_correlation_insight | The /api/projects/{project_id}/insights/funnel/correlation endpoint generates a correlation |
Get app metrics posthog_get_app_metrics | Retrieve performance and error metrics for a specific plugin configuration (app) in a PostHog |
Try it: find the PostHog tool you need
Browse the 30 PostHog tools
Click any tool to see exactly what Hermes can do and copy a ready-to-use prompt.
Example prompts
Build a funnel in project <id> with posthog_create_query_in_project_by_id: signup to first feature use over the last 30 days, and tell me where the biggest drop-off is.
Use posthog_get_project_person_trends for the last 14 days and describe the shape of the curve, plus the single biggest day-over-day change.
List my project's dashboards, feature flags, and surveys, and tell me which feature flags are active and which surveys are collecting responses.
Pull event definitions for project <id> and check whether <event name> exists and what properties it carries, then explain why my last query for it may have returned nothing.
How the PostHog tools behave
Details that decide whether a PostHog prompt is a quick insight or a region-shaped error.
- Projects are the unit of access. Tools take a project id, and the key's project scoping is the ceiling:
posthog_list_organization_projectsis the tool that shows what the connection can reach. - The Query API is the agent surface.
posthog_create_query_in_project_by_idruns HogQL against/api/projects/\{id\}/query, which is exactly the endpoint the engines teach searchers to use. - Definitions before queries.
posthog_get_event_definitionsandposthog_get_group_property_definitionslist the property names that actually exist, which is the difference between one clean query and a loop of HogQL errors. - Insights are writes. Creating a funnel, retention insight, or trend lands a new insight in the project. Analysis without creation is possible and is the safer default.
- Host region is part of the credential. US and EU PostHog hosts are different surfaces; a key and a project on mismatched regions look like a permissions failure.
- Feature flags and experiments are separate families. Flag status, experiment details, and stats have their own tools, and reading them is cheap; changing a flag is a write with product consequences.
ClawLink vs. building it yourself
The alternative to ClawLink is usually manual API key setup plus your own token handling, permission troubleshooting, and tool plumbing for Hermes Agent. That is fine if you want to build and maintain the integration yourself. Most teams just want PostHog working from chat.
| Manual | ClawLink | |
|---|---|---|
| Credential handling | Collect, validate, store, and rotate the PostHog API key yourself, then make sure every tool call uses the right account. | Users complete the hosted ClawLink setup once and the connected PostHog account becomes available to the agent without you building credential management. |
| Ongoing maintenance | You own refresh logic, permission debugging, environment config, and every provider-specific edge case for PostHog. | ClawLink handles the repetitive integration plumbing so your team can focus on the workflow instead of the infrastructure. |
| Agent usability | You still need to expose the right PostHog actions to the runtime in a format your agent can reliably use. | 502 tools for PostHog are already exposed through ClawLink, so the agent can read and act from chat immediately. |
ClawLink vs. Composio
Composio also exposes PostHog to AI agents. It is developer infrastructure: Python and TypeScript SDKs, an MCP server, and a catalog past 1,000 apps, aimed at teams shipping agent products. ClawLink is built for Hermes Agent users instead. You install the plugin once, connect PostHog in the browser, and the 502 tools above work from chat. There is no SDK and no config file, and the PostHog key you paste at setup is stored server-side rather than kept in your environment. Choosing between them? Read the full Composio alternatives comparison.
Troubleshooting
Hermes paired but still can't use PostHog
Pairing is a two-step handshake: run hermes clawlink begin, approve the link in your browser, then run hermes clawlink finish. If you ran finish before approving, or the approval link expired, run hermes clawlink begin again to get a fresh link. Confirm the plugin was installed with --enable, then verify with hermes clawlink test.
Connection succeeds but no tools appear
Reconnect PostHog from the dashboard, then start a fresh chat if the runtime still has the old tool catalog loaded.
"Tool schema not loaded yet" error when calling PostHog tools
PostHog tool schemas load on demand the first time a tool runs and are cached after that, so this error usually clears on its own: wait a few seconds and retry the same request. If every PostHog call keeps failing with it in a fresh chat, reconnect from the dashboard, and contact support if it still persists — that pattern points to a configuration problem on our side, not something you can fix by reconnecting again.
PostHog returns 403 or "permission denied" on one action while others work
Two usual causes. The connected account may not have access to the specific workspace, inbox, store, or project in the request — check that first. If access looks right, the agent may have sent a placeholder value (like "YOUR_ID" or an example id from documentation) instead of a real one: ask it to run a list or search tool first, then retry the action with a real id from those results. Most failures at this stage are one of these two, not ClawLink bugs.
PostHog returns 403 on some tools but not others
The AI Overviews give four causes for this, in order of likelihood: a personal API key missing the scope the endpoint needs (write scopes like customer_analytics:write are not implied by an analytics-read key), an endpoint that rejects personal-key auth entirely and wants a different credential model, a host-region mismatch (calling us.posthog.com surfaces against an eu.posthog.com project, or mixing the us and eu hosts), and a user-role restriction in your PostHog org. The hosted-toolkit causes still apply on top: the connection acts as a specific account and project, so a key created by one user in one org cannot see another user's projects, and the placeholder trap, where the agent used a project or insight id it invented instead of one from posthog_list_organization_projects. The diagnostic move is to have the agent quote the error, name the tool, and list the projects the connection can actually see before reconnecting, because a reconnect will not fix a region or role boundary.
Ask the agent to diagnose it:
Call posthog_list_organization_projects and tell me which project ids this connection can see. Quote the exact 403 from the failing tool and which host region your PostHog project uses. Do not retry it yet.PostHog tools are missing, or one tool name is not found
The engines' answer to this symptom is PostHog's own MCP setup: npx @posthog/wizard@latest mcp add, verify the client config, restart. That advice presumes a PostHog MCP server, which this flow does not run, so the distinction matters: there is no local MCP server here to configure or restart. The real causes are the hosted two: the connection or pairing is incomplete (confirm the plugin installed with --enable, both pairing commands ran, and PostHog shows as connected), or schemas load on demand, so the first PostHog call in a fresh session can arrive before the catalog and needs one retry. If most tools work and one name fails, that name is wrong rather than missing.
Ask the agent to diagnose it:
List the PostHog tools you actually have access to. If there are none, say so plainly. If there are, tell me which one creates a query in a project and use that exact name.The agent sees one project's data and reports another's as empty
This is the wrong-account or wrong-project shape, and it is the dimension the engines' p3 answers add: a key scoped to project A returns empty results for project B, and a connection made while logged into one PostHog account stays that account even if you later switch. The symptom is usually clean: queries succeed but return zero events, or lists show a different project set than you expect. The fix is to confirm which account and project the key belongs to, then reconnect with the right one from the dashboard and start a fresh chat. Role changes after a connection (a teammate's role was downgraded, a re-invite went stale) produce the same symptom and the same fix.
Ask the agent to diagnose it:
List the projects visible to this connection with posthog_list_organization_projects and the projects you expected. Tell me which differ, and which PostHog account created the key. Do not reconnect yet.The agent's HogQL query returns an error the tool cannot explain
The Query API surfaces PostHog's own errors, and they are usually honest: a bad property name, a wrong date range, or HogQL that references an event the project has never captured. The engines teach the Query API as the agent-facing surface precisely because the error messages are actionable, so the response is to let the agent iterate: have it quote the error, check the property against posthog_get_event_definitions and posthog_get_group_property_definitions, and retry with corrected names rather than reconnecting or guessing. A query that returns empty rows is different from an error, and an empty result usually means the date range or event name is simply not present in the data.
Ask the agent to diagnose it:
Quote the exact HogQL error, then call posthog_get_event_definitions and tell me which property names actually exist. Do not retry the query until you have done both.API key setup works but results look incomplete
Double-check that the API key for PostHog has the right scopes or account access. A valid key can still be too limited for some reads or writes.
FAQ
Is there a Hermes Agent PostHog integration?
Yes. ClawLink is the fastest way to connect Hermes to PostHog: link your PostHog account once in the browser and Hermes Agent can call the PostHog API through 502 ready-made tools — no custom code or token handling.
How do I connect PostHog to Hermes with ClawLink?
Install the plugin with hermes plugins install ClawLink-HQ/hermes-plugin --enable, then pair once: run hermes clawlink begin, approve the link in your browser, and run hermes clawlink finish. Connect PostHog in the dashboard and Hermes can use it from the next message — no config files, and the PostHog key you paste is stored server-side instead of in your environment.
How long does it take to connect PostHog to Hermes Agent?
About two minutes. Sign in, click Connect next to PostHog in the dashboard, authenticate, and Hermes Agent can use it from the next chat message.
Why use ClawLink instead of wiring PostHog up myself?
The alternative to ClawLink is usually manual API key setup plus your own token handling, permission troubleshooting, and tool plumbing for Hermes Agent. That is fine if you want to build and maintain the integration yourself. Most teams just want PostHog working from chat.
Whose key is this, exactly?
Yours, the one you already use for PostHog's API. The AI Overviews and ChatGPT all answer the without-a-key question with "you cannot", which is true only if the searcher expects to avoid PostHog credentials entirely. This page is the other reading: you keep using your PostHog personal API key, but ClawLink hosts it, so the agent never touches a .env, never configures a client, and you never paste the key into a second place. Creating the key still happens in PostHog, because the key is proof of your account. What disappears is every step after that.
What can the agent do with 502 PostHog tools?
The platform surface: event definitions and property definitions, funnels and retention insights, trends per project, feature flags and experiments, dashboards, session recordings, surveys, and the Query API, which the engines name as the agent-facing surface for HogQL (posthog_create_query_in_project_by_id). It is a read-and-analyze surface first: the agent can answer "what did users do last week" from your actual events instead of from a dashboard someone already built. The deliberate writes are the governance ones: creating insights and feature flag changes land in your project for the whole team.
Why would an agent need PostHog tools when it can just call the API?
Because the 502 tools are the API with its argument shapes already resolved: project ids, insight types, date ranges, and filter structures are typed in the schemas, and the tool names match the surfaces the docs describe, so the agent is far less likely to improvise a malformed call. The Query API tool in particular is what the engines teach searchers to reach for, and here it is one named tool instead of a hand-built request against /api/projects/\{project_id\}/query.
Is it safe to connect PostHog to an agent through ClawLink?
The engines' safety answers lean on scoped keys, redaction, prompt-injection awareness, and privacy modes, and all four are available to you here. The key is held server-side and never written to a local file, and revoking in the dashboard ends the agent's access immediately. Scoped keys matter more than usual with PostHog because the same key can reach different projects: use a key limited to the project the agent should analyze. The prompt-injection caution is real for any analytics agent that reads event content, since event payloads are untrusted input the agent should never execute. If your data includes identifiable people, keep the agent's summaries to aggregates and let the privacy modes in your PostHog project do the redaction work.
Hermes paired but still can't use PostHog
Pairing is a two-step handshake: run hermes clawlink begin, approve the link in your browser, then run hermes clawlink finish. If you ran finish before approving, or the approval link expired, run hermes clawlink begin again to get a fresh link. Confirm the plugin was installed with --enable, then verify with hermes clawlink test.
Related
Metabase
Metabase is an open-source business intelligence tool that lets you ask questions about your data and visualize answers as charts, graphs, and dashboards.
Connect Twelve Data
Twelve Data provides a comprehensive financial data API offering real-time and historical market data for stocks, forex, cryptocurrencies, ETFs, and indices.
Hermes Gosquared integration
GoSquared provides real-time web analytics and customer engagement tools to help businesses understand and interact with their website visitors.