kavachTanStack(kavach, options?) returns named route handlers { GET, POST, PATCH, DELETE, OPTIONS }. Mount them in a splat API route file so all KavachOS paths are handled.
Install
Setup
1
Create the kavach instance
2
Create the catch-all route
Create
app/routes/api/kavach.$.ts. The $ splat segment catches every sub-path under /api/kavach/.TanStack Start API routes receive a standard Web API
Request, so the adapter delegates directly to the KavachOS dispatcher without any conversion.Options
MCP endpoints
Whenmcp is passed, the MCP OAuth 2.1 endpoints are available at: