Skip to main content

What the Flywheel MCP is

Flywheel runs a remote Model Context Protocol server at https://api.flywheel.cx/mcp. An AI agent connected to it works inside one Flywheel workspace with the same building blocks the dashboard uses: people and their properties, segments, workflows, webinars, broadcasts and Signals. The MCP tools are thin wrappers over the same code as the /v1 REST API and the dashboard, so a workflow an agent builds is the same workflow you see in the builder, and a broadcast it plans is checked exactly as one planned in the dashboard. The server is stateless Streamable HTTP: every request is one JSON-RPC message sent with POST, answered with JSON. It offers tools only (no MCP resources or prompts). The documentation itself is reachable through tools: search_docs, get_doc and list_docs.

Connecting an MCP client

Clients that support OAuth need only the URL. Flywheel publishes OAuth discovery and open client registration, so the client registers itself, opens a browser, you sign in to Flywheel, pick the workspace and approve once. The client then holds its own token. The dashboard’s Settings → MCP page shows the same instructions with copy buttons, and lists the apps connected to your workspace so you can revoke them.

Connecting with an API key instead of OAuth

For a client or script that cannot do OAuth, use an organization API key from Settings → API. It needs both headers; without Auth-Type: api the key is read as a dashboard session and refused.
Check a key works from a terminal:
Keys created before MCP access existed are refused with “This API key was created before MCP access existed”. Create a new key, or connect with OAuth.

Permissions and which tools an agent sees

Every tool requires one permission, such as people.read, workflows.publish or broadcasts.send. A connection only sees (in tools/list) and can only call the tools its permissions cover, so an agent plans with the tools it can actually use. A tool called without the permission returns a result saying which permission is missing rather than failing silently. The documentation tools (search_docs, get_doc, list_docs) read no workspace data and are available to every connection.

What reaches real people

Most tools only read or edit drafts. These are the ones whose effect leaves Flywheel, and an agent should show the person it works for what will happen and get a clear yes before calling them: MCP clients see these as non-read-only tools, and the irreversible ones carry the destructive hint, so a client that asks before running tools will ask here.

How an agent should work with Flywheel

  • Read before you write. List or get the thing first (list_workflows, get_webinar, get_segment). Most changes are patches that keep what you leave out.
  • Never invent ids. Every id is a UUID read from a list or get tool. The only ids an agent makes up are fresh v4 UUIDs for new workflow nodes.
  • Resolve a person before acting on one with search_people, or identify_person when they may not exist yet.
  • Use the vocabulary. Workflow params may only reference event names, properties, senders and other ids from get_vocabulary; anything else fails validation.
  • Let validation and plans do the checking. create_workflow and update_workflow return validation findings for what they saved; plan_broadcast shows exactly who gets a broadcast and what it says. Fix what they report rather than working around it.
  • Confirm before anything in “What reaches real people”.
  • Look it up. When unsure how something works, call search_docs before guessing.

Searching the documentation from an agent

Three tools serve this documentation site to a connected agent:
  • search_docs takes a plain-language query and returns the best-matching doc sections (page path, section heading, url, a snippet) and matching tools (with the permission each needs). Filter with kind: "doc" or kind: "tool".
  • get_doc returns a page as markdown, or just one section of it. Pass the path from a search result, for example { "path": "mcp/workflow-definitions", "section": "Validation finding codes" }. A pasted docs URL works too.
  • list_docs returns the table of contents: every page’s path, title, description and headings. Narrow it with area, for example { "area": "mcp" }.

Map of the MCP guides

Errors and what they mean

MCP or the REST API

Use the MCP when an AI agent is doing the work: tools are discoverable, described and permission-filtered, and the docs are searchable from inside the session. Use the REST API (/v1, see the API tab) from your own code, for example to send events or register webinar attendees from your signup form. Both act on the same data through the same implementation.