PostHog is a product-analytics platform for events, users, feature flags, and session data. Its hosted MCP server supports OAuth and a personal API key created with the MCP Server preset.
This guide prepares PostHog for an MCP client. The PostHog agent template is a separate Dome deployment.
Choose a connection method
Choose OAuth for an interactive connection; it is PostHog's recommended path. Choose a personal API key with the MCP Server preset for a shared, non-interactive connection. Both can be pinned to a project and restricted to read-only MCP tools. See the PostHog MCP FAQ.
Recommended: OAuth
OAuth avoids copying a long-lived key and follows the authorizing member's PostHog access.
- Add
https://mcp.posthog.com/mcp?readonly=trueto an OAuth-capable MCP client. - Complete browser sign-in as a dedicated test member and select the intended organization and project.
- When the connection will always serve one project, pin it with
project_idorx-posthog-project-id. - Query a known test event or insight and verify that another project is unavailable.
Alternative: Personal API key
Use this path for a shared, non-interactive connection.
- Create a personal API key using PostHog's MCP Server preset; do not use an ingestion key.
- Send it as
Authorization: Bearer <personal API key>. - Add
readonly=trueand pin a project for the same upstream protections used by OAuth.
Verify PostHog MCP
Use this checklist to confirm the MCP server is connected with the intended access.
- Connect the MCP client using the newly created authorization.
- Confirm that PostHog MCP tools are discovered.
- Read one known test resource that the authorized identity is allowed to access.
- Attempt to read a resource outside the approved PostHog boundary; it should be unavailable or denied.
- Confirm that no write capability beyond the reviewed setup is available.
Troubleshooting
Do not use a project API key for server-to-server query access; it is intended for event ingestion. If analytics are missing, verify the project ID and regional host before broadening membership.
Next steps
Deploy the PostHog agent template to create a governed agent in Dome that can work with the approved analytics project, with the template's included model, tools, and rules.