kavachHono(kavach, options?) returns a Hono app instance with all KavachOS routes pre-mounted. Use app.route to attach it to your main app.
Install
Setup
1
Create the kavach instance
Create this once and reuse it across your app (e.g.
lib/kavach.ts):2
Mount the adapter
MCP endpoints
Passmcp to enable the full MCP OAuth 2.1 authorization server. All MCP endpoints are mounted under the same /api/kavach prefix alongside the REST API:
MCP routes include CORS headers (
Access-Control-Allow-Origin: *) and respond to OPTIONS preflight requests automatically.