Skip to main content

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.

A complete, runnable MCP server with one flow, in under 30 lines. No HTTP, no API key, no infrastructure. Runs over stdio so any MCP client can connect.

1. Install

bun add @waniwani/sdk @modelcontextprotocol/sdk zod

2. Write the server

hello.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { createFlow, END, MemoryKvStore, START } from "@waniwani/sdk/mcp";
import { z } from "zod";

const flow = createFlow({
  id: "hello",
  title: "Hello World",
  description: "Say hello and ask a question.",
  state: { name: z.string().describe("Your name") },
})
  .addNode({
    id: "ask",
    run: ({ interrupt }) =>
      interrupt({ name: { question: "What's your name?" } }),
  })
  .addNode({
    id: "greet",
    run: ({ state }) => ({ greeted: true }),
  })
  .addEdge(START, "ask")
  .addEdge("ask", "greet")
  .addEdge("greet", END)
  .compile({ store: new MemoryKvStore() });

const server = new McpServer({ name: "hello-mcp", version: "1.0.0" });
await flow.register(server);
await server.connect(new StdioServerTransport());

3. Run it

bun run hello.ts
That’s a complete MCP server with one flow-driven tool. Connect it to ChatGPT, Claude, or any MCP client over stdio. State lives in memory and resets on restart. Good for development. For production, swap MemoryKvStore for a real backend (see KV store adapters) or set WANIWANI_API_KEY to use the WaniWani Platform for hosted state.

Next

Build a funnel

Sales funnels, lead gen, booking, quote flows.

Flow engine

Nodes, edges, interrupts, conditional branching.

WaniWani Platform

What the SDK does without a key, and what unlocks when you connect the Platform.

Self-hosting

Deploy the OSS path end-to-end.

Starter template

For a more complete project with chat widget, dev tunnel, and a sample funnel pre-wired:
git clone https://github.com/WaniWani-AI/mcp-distribution-template.git my-mcp-server
cd my-mcp-server
bun install
bun dev