@kavachos/nuxt
v2.0.0
Published
Nuxt adapter for KavachOS - exposes agent auth as HTTP REST endpoints via H3
Downloads
645
Readme
@kavachos/nuxt
Nuxt adapter for KavachOS.
Install
pnpm add kavachos @kavachos/nuxtUsage
Create server/api/kavach/[...].ts:
import { createKavach } from 'kavachos';
import { kavachNuxt } from '@kavachos/nuxt';
const kavach = createKavach({
database: { provider: 'sqlite', url: 'kavach.db' },
});
export default kavachNuxt(kavach);This handles the full KavachOS REST API under /api/kavach: agent CRUD, authorization, delegations, audit logs, and dashboard stats.
With MCP OAuth 2.1
import { createMcpModule } from 'kavachos/mcp';
import { kavachNuxt } from '@kavachos/nuxt';
const mcp = createMcpModule({
issuer: 'https://your-app.com',
// ...
});
export default kavachNuxt(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
kavachNuxt(kavach, options?) returns an H3 EventHandler for use as a Nuxt server route.
| Option | Type | Description |
|--------|------|-------------|
| mcp | McpAuthModule | Enables MCP OAuth 2.1 endpoints |
| basePath | string | URL prefix before the catch-all segment. Defaults to /api/kavach |
For full docs on agent identity, permissions, delegation, and audit, see the main kavachos package.
Links
License
MIT
