Skip to main content
This page shows you how to build a lead generation MCP funnel with @waniwani/sdk. Lead gen is the simplest MCP funnel: a few questions, validation, and a handoff. Runs as a single MCP tool inside any MCP client.

What you’ll build

A lead capture flow that:
  1. Asks for work email, with format validation
  2. Asks for role and use case
  3. Looks up the company by email domain (action node, no user prompt)
  4. Pushes to your CRM or webhook

Flow graph

Code

Register

Why this works as an MCP funnel

  • No form, no friction. The user is already in ChatGPT or Claude. They never leave.
  • The AI asks the questions in plain language. Better completion rate than a form.
  • Validation runs server-side. If the email is malformed, the engine re-asks automatically.
  • Enrichment happens silently. lookup_company is an action node, no user interaction.

Add funnel analytics

Set WANIWANI_API_KEY and every step is tracked. The funnel view shows three steps: Ask for email → Ask role + use case → Push to CRM (the labels are taken from each node’s label field). lookup_company uses hideFromFunnel: true because enrichment is plumbing, not a step the user can drop off at. See Tracking / Overview. The push_lead node is also where the qualified-lead event fires: the person answered every qualifying question and now exists in your CRM, so track.leadQualified() carries the CRM record id as externalId (the dedup key) alongside the email. The identify() call right before it attaches the email to the session, so a converted event sent later from your backend with the same externalUserId joins back to this lead. Placement rules for every funnel event are in Instrumentation.

Next

Build a sales funnel MCP

Build a booking MCP app

Validation in interrupts

Push events to your stack