A WaniWani deployment has two pieces you can self-host independently: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.
- The MCP app — the server that hosts your
createFlowtools and serves MCP clients. - The KV store — where flow state lives between tool calls.
app.waniwani.ai.
KV on WaniwaniKvStore | KV self-hosted | |
|---|---|---|
| MCP app self-hosted | Hybrid: your infra for the server, hosted state. Recommended starting point. | Fully open source. No outbound calls. |
| MCP app on Managed Hosting | Fully managed. | Not supported. |
1. Self-host the MCP app
Deploy the server you wrote on infrastructure you control. By itself this gets you self-hosted MCP + hosted state (the Hybrid row above).Scaffold
Start from the MCP Distribution Template or any MCP server of your own:Wire up the server
server.ts
.compile() is called with no store and WANIWANI_API_KEY is set, the SDK uses WaniwaniKvStore automatically. That’s the Hybrid setup.
Deploy
Any platform that can run Node 18.17+ works: Vercel, Render, Railway, Fly.io, Cloudflare Workers, AWS Lambda, Google Cloud Run. See Deployment overview for the choice between this and Managed Hosting.Register with WaniWani
In the WaniWani dashboard, create a self-hosted project and paste your deployed MCP URL. WaniWani routes chat requests, widget rendering, and analytics ingestion through that URL.2. Self-host the KV store
Pass your ownKvStore to .compile() and the engine never touches app.waniwani.ai for state. Useful when you have data-residency constraints, run in fully open-source mode, or want all state inside your existing infrastructure.
Pick a backend
See KV store adapters for recipes. Quick decision tree:- Vercel / Netlify / Cloudflare Workers → Upstash Redis or Cloudflare KV
- AWS Lambda → DynamoDB
- Long-running Node → ioredis against a managed Redis (Render, Railway, Fly)
- Local box → SQLite via
better-sqlite3
Implement the interface
kv-store.ts
Pass it to .compile()
flow.ts
Fully open-source mode
Combine the two: self-host the MCP app, pass a customKvStore, omit WANIWANI_API_KEY. Result: no outbound calls to app.waniwani.ai, no telemetry, no hosted dashboards. The engine is fully usable in this mode.
Verifying it’s truly offline
waniwani() client is instantiated with an API key, or when WaniwaniKvStore is used. Neither happens in fully open-source mode.
Switching modes later
The same code moves between modes by editing one or two lines:- OSS → Hybrid: drop the
storeargument from.compile(), setWANIWANI_API_KEY. - Hybrid → OSS: pass a custom
storeto.compile(). - Self-hosted → Managed Hosting: see Deployment overview.