Skip to main content
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

Pass mcp 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.

Endpoint reference

Full example

Last modified on April 29, 2026