What it does
The SDK compiles a typed state graph into a single MCP tool that implements multi-step conversational flows for sales, lead generation, booking, and quote generation. Unlike raw MCP where state serializes through the model on each turn, this SDK persists state server-side under a session ID, letting the model render only the next question. The flow engine is MIT-licensed and runs without external dependencies against any key-value store—Redis, Upstash, Cloudflare KV, DynamoDB, Postgres, or in-memory. State is typed via Zod; flows are defined declaratively as nodes, edges, and interrupts. An optional WaniWani Platform (activated by setting an env var) adds hosted encrypted state, event tracking, funnel analytics, and semantic search over a knowledge base.
Who it's for
Backend engineers building AI-native applications in ChatGPT, Claude, or Cursor who need deterministic multi-step flows instead of unreliable paraphrasing or lost state. Teams shipping sales funnels, lead capture, booking systems, or dynamic quote generation as MCP tools and wanting server-side persistence without managing Redis orchestration separately.
Common use cases
- Qualify and capture sales leads inside Claude with branching logic and CRM integration.
- Build booking flows that check availability, present time slots, and confirm reservations as a single MCP tool.
- Generate insurance or pricing quotes by collecting structured details, validating input, calling a pricing API, and returning widget cards.
- Create lead-gen flows that request email, role, and use case, then webhook results to a CRM.
- Embed a chat widget backed by a knowledge base in Claude or ChatGPT clients.
Setup pitfalls
- Dependency chain: requires
@modelcontextprotocol/sdkandzodalongside the SDK itself; missing either blocks funnel registration. - Optional
WANIWANI_API_KEYenv var gates Platform features (hosted state, analytics, knowledge base); without it, flows use only the open-source engine against a local store. - Reads and writes filesystem; makes network calls for state and analytics. Run in a sandboxed environment or firewall if untrusted flows are involved.
- No CI pipeline configured; stable but verify compatibility with your MCP client version and Node runtime before production use.