# Use Workflows over PostHog MCP - Docs

The PostHog [MCP server](/docs/model-context-protocol.md) brings Workflows into Claude Code, Cursor, and other AI tools. It covers the full lifecycle – create a draft, edit its graph, test it, publish it, and read its stats and logs – so you can build and ship a workflow without leaving your editor.

## What you can do here

Through MCP tools, your agent can:

-   **Create and edit workflows.** `workflows-create` makes a draft, `workflows-patch-graph` and `workflows-update` change it, and `workflows-discard-draft` throws the draft away.
-   **Test and publish.** `workflows-test-run` runs a workflow without sending to real recipients, and `workflows-publish` makes the draft live.
-   **Read and list.** `workflows-list` and `workflows-get` pull workflows into your session, and `workflows-update-schedule` changes when a scheduled workflow runs.
-   **Debug a run.** `workflows-list-invocations`, `workflows-get-invocation`, `workflows-logs`, and `workflows-list-batch-jobs` show what actually happened on a given run.
-   **Check performance.** `workflows-stats` reports on one workflow and `workflows-global-stats` across all of them.
-   **Move between revisions.** `workflows-list-revisions`, `workflows-get-revision`, and `workflows-restore-revision` let you inspect history and roll back.

For the full list of tools and how to scope a session to a subset, see the [MCP tools reference](/docs/model-context-protocol/tools.md).

## Drafts are the safety net

A workflow created over MCP is a draft. It does not run and nobody receives a message until it's published, so an agent can build the whole thing and hand it to you for review. Test it with `workflows-test-run` first, then publish – from MCP or from the [web app](/docs/workflows/surfaces/web-app.md).

## Set up

Connect the PostHog MCP server to your AI tool of choice, then grant it access to your project. The [MCP overview](/docs/model-context-protocol.md) covers install and authentication for each client.

## Related

-   [MCP overview](/docs/model-context-protocol.md) – install and authentication
-   [Workflows in the web app](/docs/workflows/surfaces/web-app.md) – the visual builder
-   [Content library and message templates](/docs/workflows/library.md#create-templates-with-mcp) – creating templates over MCP

### Community questions

Ask a question

### Was this page useful?

HelpfulCould be better