> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # Manage data pipelines over PostHog MCP Canonical URL: https://posthog.com/docs/data-pipelines/surfaces/mcp ## On this page - [Before you start](#before-you-start) - [What you can do here](#what-you-can-do-here) - [Example prompts](#example-prompts) - [Install the MCP server](#install-the-mcp-server) - [Related](#related) The [PostHog MCP server](https://posthog.com/docs/model-context-protocol.md) gives AI agents and MCP clients direct access to your pipelines. Because pipeline functions are just code plus configuration, this is one of the places MCP pays off most – an agent can write a transformation, test it against a real event, read the failure, and fix it, all without you opening the web app. ## Before you start 1. **Set up a pipeline** – [create a source, destination, or transformation](https://posthog.com/docs/data-pipelines/start-here.md) so there's something to manage. 2. **Connect the MCP server** – [install it in your AI tool](#install-the-mcp-server) and give it access to your project. ## What you can do here **Build and edit functions.** Create a destination, transformation, source webhook, or web script from scratch or from a template, then update it in place. Agents can generate the Hog code, the input schema, and the event filters together. **Browse templates.** List the available function templates and retrieve one to see its inputs before building on top of it. **Test before shipping.** Test-invoke a function against a real recent event and read back the request it would have sent. Nothing is delivered, so it's safe to iterate. **Debug what's already running.** Pull a function's logs and metrics to see successes, failures, and filtered events, then patch the function based on what you find. **Control ordering and state.** Reorder transformation execution, and enable or disable a function without deleting it. **Manage batch exports.** List, create, update, and delete batch exports. **Export data as files.** Start a [file download export](https://posthog.com/docs/data-pipelines/file-download-exports.md), check whether it has finished, and cancel one that is still running. Downloading the finished files happens over the API. ## Example prompts - `List my active destinations and tell me which ones are failing.` - `Create a transformation that drops events where test_mode is true.` - `Test-invoke my Slack destination against a recent event and show me the payload.` - `Show me the logs for my HubSpot destination from the last hour.` - `Move my PII redaction transformation to run before everything else.` - `Disable the destination that's erroring the most.` - `Export last week's pageview events as Parquet and tell me when the files are ready.` ## Install the MCP server The recommended way is the [AI wizard](https://posthog.com/docs/ai-engineering/ai-wizard.md), which supports Claude, Cursor, Windsurf, VS Code, and more: ```bash npx @posthog/wizard mcp add ``` You can also [configure it manually](https://posthog.com/docs/model-context-protocol.md#get-started-in-30-seconds). See the [MCP server documentation](https://posthog.com/docs/model-context-protocol.md) for the full tool list and scopes. ## Related - Build and monitor the same pipelines in the [web app](https://posthog.com/docs/data-pipelines/surfaces/web-app.md). - Manage them from your own systems with the [API](https://posthog.com/docs/data-pipelines/surfaces/api.md). - Learn the language behind pipeline functions in the [Hog reference](https://posthog.com/docs/hog.md).