kavachSvelteKit(kavach, options?) returns named route handlers { GET, POST, PATCH, DELETE, OPTIONS }. Mount them in a catch-all server route file so all KavachOS paths are handled.
Install
Setup
1
Create the kavach instance
2
Create the catch-all route
Create
src/routes/api/kavach/[...path]/+server.ts. The [...path] segment catches every sub-path under /api/kavach/.SvelteKit passes a standard Web API
Request to route handlers, 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: