> ## Documentation Index
> Fetch the complete documentation index at: https://docs.waniwani.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Funnels overview

> Build sales funnels, lead generation, booking, and quote apps as MCP funnels on top of your MCP server.

An **MCP funnel** is a multi-step conversation, hosted on your MCP server, that drives a user from intent to outcome (a qualified lead, a booking, a quote, a purchase). ChatGPT, Claude, and any other MCP-capable client become the front-end. Your funnel runs as a single MCP tool.

`@waniwani/sdk` is the SDK for building MCP funnels. The engine is open source. The [Waniwani Platform](/sdk/platform/overview) adds funnel analytics, hosted state, knowledge base, and a chat widget on top.

## What you can build

<CardGroup cols={2}>
  <Card title="Sales funnel MCP" icon="filter" href="/sdk/guides/sales-funnel">
    Qualify intent, capture lead data, route to the right next step.
  </Card>

  <Card title="Lead generation MCP" icon="user-plus" href="/sdk/guides/lead-generation">
    Collect email, role, and use case. Push to your CRM.
  </Card>

  <Card title="Booking MCP" icon="calendar" href="/sdk/guides/booking">
    Pick a service, pick a slot, confirm. Branch on availability.
  </Card>

  <Card title="Insurance quote MCP" icon="shield" href="/sdk/guides/insurance-quote">
    Collect details, validate, return a quote with widget cards.
  </Card>
</CardGroup>

## Funnel vocabulary ↔ flow vocabulary

If you're new to the SDK, the funnel terms map cleanly to the flow engine:

| Funnel term              | Flow term                                        |
| ------------------------ | ------------------------------------------------ |
| Funnel step / page       | Node (`addNode({ id, label, run })`)             |
| Step name (in dashboard) | `label`                                          |
| Drop-off / conversion    | Edge taken vs. abandoned                         |
| Form field               | Interrupt                                        |
| Branching question       | Conditional edge                                 |
| Funnel state (lead data) | Flow state (typed)                               |
| Funnel analytics         | Platform: node visits, completion rate, drop-off |

Everything you'd describe in funnel-speak compiles into a flow. Read [Flows / Overview](/sdk/flows/overview) for the engine.

## Anatomy of an MCP funnel

```ts theme={null}
import { createFlow, START, END } from "@waniwani/sdk/mcp";
import { z } from "zod";

export const funnel = createFlow({
  id: "sales_funnel",
  title: "Sales Funnel",
  description: "Use when a visitor wants to learn more, book a demo, or buy.",
  state: {
    intent: z.enum(["learn", "demo", "buy"]).describe("What the user wants"),
    email: z.string().describe("Work email"),
    company: z.string().describe("Company name"),
  },
})
  .addNode({
    id: "qualify",
    label: "Qualify intent",
    run: ({ interrupt }) =>
      interrupt({
        intent: {
          question: "What brings you here today?",
          suggestions: ["Learn more", "Book a demo", "Buy now"],
        },
      }),
  })
  .addNode({
    id: "capture",
    label: "Capture lead",
    run: ({ interrupt }) =>
      interrupt({
        email: { question: "What's your work email?" },
        company: { question: "Which company?" },
      }),
  })
  .addEdge(START, "qualify")
  .addEdge("qualify", "capture")
  .addEdge("capture", END)
  .compile();
```

Register it on your MCP server and the funnel is live in ChatGPT, Claude, or any MCP client.

## Why MCP for funnels

* **No website, no form, no chatbot widget.** The funnel runs inside the AI client the user already uses.
* **One tool call, many turns.** The engine handles state, validation, branching, and resumption.
* **Funnel analytics out of the box.** Connect the [Waniwani Platform](/sdk/platform/overview) and every node visit becomes a funnel step in the dashboard.

## Next

<CardGroup cols={2}>
  <Card title="Build a sales funnel MCP" icon="filter" href="/sdk/guides/sales-funnel" />

  <Card title="Build a lead generation MCP" icon="user-plus" href="/sdk/guides/lead-generation" />

  <Card title="Build a booking MCP app" icon="calendar" href="/sdk/guides/booking" />

  <Card title="Build an insurance quote MCP" icon="shield" href="/sdk/guides/insurance-quote" />
</CardGroup>
