@kavachos/hono
v2.0.0
Published
Hono adapter for KavachOS - exposes agent auth as HTTP REST endpoints
Downloads
713
Readme
@kavachos/hono
Hono adapter for KavachOS.
Install
pnpm add kavachos @kavachos/honoUsage
import { serve } from '@hono/node-server';
import { Hono } from 'hono';
import { createKavach } from 'kavachos';
import { kavachHono } from '@kavachos/hono';
const kavach = createKavach({
database: { provider: 'sqlite', url: 'kavach.db' },
});
const app = new Hono();
// Mount all KavachOS routes at /api/kavach
app.route('/api/kavach', kavachHono(kavach));
serve({ fetch: app.fetch, port: 3000 });This mounts the full KavachOS REST API: agent CRUD, authorization, delegations, audit logs, and dashboard stats.
With MCP OAuth 2.1
import { createMcpModule } from 'kavachos/mcp';
import { kavachHono } from '@kavachos/hono';
const mcp = createMcpModule({
issuer: 'https://your-app.com',
// ...
});
app.route('/api/kavach', kavachHono(kavach, { mcp }));When mcp is provided, the OAuth 2.1 endpoints are enabled:
GET /.well-known/oauth-authorization-serverGET /.well-known/oauth-protected-resourcePOST /mcp/registerGET /mcp/authorizePOST /mcp/token
API surface
kavachHono(kavach, options?) returns a Hono instance with all routes registered. Pass it to app.route() with your chosen prefix.
| Option | Type | Description |
|--------|------|-------------|
| mcp | McpAuthModule | Enables MCP OAuth 2.1 endpoints |
For full docs on agent identity, permissions, delegation, and audit, see the main kavachos package.
Links
License
MIT
