theauth
Auth for AI agents and humans. First-class agent identity, MCP OAuth 2.1, delegation, audit. TypeScript, edge-native, MIT.
Install / Use
claude mcp add glincker -- npx -y github:glincker/theauthIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
SecuritySupported Platforms
Our assessment of theauth
theauth scores 84/100 on our quality scale, 724th of 1,000 Security skills we index.
Its MCP Server is 18 KB long, well organised into 34 sections with 13 code examples: a thorough specification that gives an agent plenty to work with.
It has 10 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated today, so theauth is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 97/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands.
Automated pattern scan on 2026-10-01. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
theauth compared with similar skills
All 4 of these similar skills score higher than theauth; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| theauth (this skill)by glincker | 84 | 10 | today | MCP Server |
| Agent-Reachby Panniantong | 100 | 87.2k | 16d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 74.2k | today | CLAUDE.md |
| rufloby ruvnet | 100 | 73.6k | today | CLAUDE.md |
| CowAgentby zhayujie | 100 | 47.2k | today | CLAUDE.md |
Frequently asked questions
- How do I install theauth?
- Run
claude mcp add glincker -- npx -y github:glincker/theauth. The install tabs above show the steps for each supported agent. - Which AI agents does theauth work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is theauth safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. It is MIT-licensed and scores 97/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is theauth still maintained?
- The repository was last updated today, so theauth is actively maintained.
Skill content
View source on GitHubWhy TheAuth
Most auth libraries stop at human sign-in. That leaves you stitching together separate systems when your AI agents need identity, scoped permissions, delegation, and audit trails. TheAuth handles both in one place.
How it differs
Ask yourself about the auth library you're using or evaluating:
- Does it model AI agents as first-class identities, with their own scoped permissions and an audit trail you can export, not just human users with API keys?
- Does it ship an MCP OAuth 2.1 authorization server that complies with the published RFC stack (9728, 8707, 8414, 7591), so your agents can talk to MCP servers without you writing the spec?
- Does it run on Cloudflare Workers, Bun, and Deno without Node-only APIs in the core?
- Does it give you delegation chains with depth limits, budget policies per agent, and CIBA-style approval flows for sensitive tool calls?
If any of those is a no, that gap is why theauth exists.
Agent identity
Cryptographic bearer tokens (kv_...), wildcard permission matching, delegation chains with depth limits, budget policies, anomaly detection, and CIBA approval flows.
Human auth
14 methods: email/password, magic link, email OTP, phone SMS, passkey/WebAuthn, TOTP 2FA, anonymous, Google One-tap, Sign In With Ethereum, device authorization, username/password, captcha, password reset, session freshness.
OAuth
17 first-class providers: Apple, Atlassian, Discord, Dropbox, Figma, GitHub, GitLab, Google, LinkedIn, Microsoft, Notion, Reddit, Slack, Spotify, Twitch, Twitter/X, Zoom. Plus a generic OIDC factory for anything else.
MCP OAuth 2.1
Authorization server for the Model Context Protocol. PKCE S256, RFC 9728 / 8707 / 8414 / 7591.
Enterprise
Organizations with RBAC, SAML 2.0 and OIDC SSO, admin controls (ban/impersonate), API key management, SCIM directory sync, multi-tenant isolation, GDPR export/delete/anonymize, compliance reports for EU AI Act, NIST, SOC 2, ISO 42001.
Runs on the edge
Works on Cloudflare Workers, Deno, and Bun without code changes. Three runtime dependencies: drizzle-orm, jose, zod.
Security
Rate limiting per agent and per IP, HIBP password breach checking, CSRF protection, httpOnly secure cookies, email enumeration prevention, trusted device windows, signed expiring reset tokens, session freshness enforcement.
Performance
The policy engine hits 2.6M warm-cache evals/sec with a p99 of 500ns. Cold paths stay under 0.3ms p99 on direct permissions, RBAC role expansion, and ReBAC graph lookups. Numbers from pnpm bench on the policy-engine suite in packages/core/bench/, reproducible locally.
Install
npm install @glinr/theauth
# or
pnpm add @glinr/theauth
# or
yarn add @glinr/theauth
import { createTheAuth } from "@glinr/theauth";
import { emailPassword, passkey } from "@glinr/theauth/auth";
import { createHonoAdapter } from "@glinr/theauth-hono";
const auth = await createTheAuth({
database: { provider: "postgres", url: process.env.DATABASE_URL },
plugins: [emailPassword(), passkey()],
});
const app = new Hono();
app.route("/api/auth", createHonoAdapter(auth));
// Create an AI agent with scoped MCP permissions
const agent = await auth.agent.create({
ownerId: "user-123",
name: "github-reader",
type: "autonomous",
permissions: [{ resource: "mcp:github:*", actions: ["read"] }],
});
const result = await auth.authorize(agent.id, {
action: "read",
resource: "mcp:github:repos",
});
// { allowed: true, auditId: "aud_..." }
How TheAuth compares
| Capability | Auth0 | Clerk | Better-Auth | NextAuth | Lucia | TheAuth | |---|---|---|---|---|---|---| | License | Proprietary | Proprietary | MIT | ISC | MIT | MIT | | Self-hosted | Partial | No | Yes | Yes | Yes | Yes | | OAuth 2.1 server | Yes | Yes | Partial | No | No | Yes | | MCP OAuth 2.1 | No | No | No | No | No | Yes | | Passkeys / WebAuthn | Yes | Yes | Plugin | Plugin | No | Yes | | Multi-tenant / orgs | Yes | Yes | Plugin | No | No | Yes | | Audit log | Yes (paid) | Yes (paid) | No | No | No | Yes | | AI agent identity | No | No | No | No | No | Yes | | Edge runtimes | Partial | No | Yes | Partial | Yes | Yes |
Features
<details> <summary><strong>Full feature checklist (click to expand)</strong></summary>Authentication
- Email and password with HIBP breach checking
- Magic link
- Email OTP
- Phone SMS OTP
- Passkeys / WebAuthn
- TOTP 2FA (authenticator apps)
- SAML 2.0 and OIDC SSO
- Anonymous sessions
- Google One Tap
- Sign In With Ethereum
- Device Authorization (TV / CLI flows)
- Username and password
- Captcha integration
- Session freshness enforcement
OAuth 2.1
- Authorization Code + PKCE
- Client Credentials
- Device Authorization Grant
- Refresh Token rotation
- Token introspection
- Dynamic Client Registration (RFC 7591)
- Server metadata (RFC 8414)
- Resource indicators (RFC 8707)
- Authorization Server Issuer Identification (RFC 9728)
MCP Support
- Full OAuth 2.1 authorization server for the Model Context Protocol
- PKCE S256 mandatory
- RFC 9728 / 8707 / 8414 / 7591 compliant
- Agent token issuance and validation
AI Agent Identity
- Cryptographic bearer tokens (
kv_...) - Wildcard permission matching
- Delegation chains with configurable depth limits
- Budget policies per agent
- Anomaly detection
- CIBA-style approval flows for sensitive tool calls
- Full audit trail per agent action
Framework Adapters
- Next.js 15 (App Router, Route Handlers, Middleware)
- SvelteKit
- Nuxt / Vue
- Hono (Cloudflare Workers, Bun, Deno)
- Express
- Fastify
- Astro
- NestJS
- SolidStart
- TanStack Start
- React Native / Expo
- Electron
Database Adapters
Built-in: SQLite, PostgreSQL, MySQL, Cloudflare D1
Plugin: Prisma (share an existing PrismaClient)
Enterprise
- Organizations with RBAC
- SCIM directory sync
- Admin controls (ban, impersonate)
- API key management
- Multi-tenant isolation
- GDPR: export, delete, anonymize
- Compliance reports: EU AI Act, NIST, SOC 2, ISO 42001
Edge Runtimes
- Cloudflare Workers (D1, KV)
- Vercel Edge Functions
- Deno Deploy
- Bun
- Three runtime dependencies:
drizzle-orm,jose,zod
Quick start by framework
<details> <summary><strong>Next.js (App Router)</strong></summary>npm install @glinr/theauth @glinr/theauth-nextjs
// app/api/auth/[...theauth]/route.ts
import { createTheAuth } from "@glinr/theauth";
import { emailPassword } from "@glinr/theauth/auth";
import { createNextAuthHandler } from "@glinr/theauth-nextjs";
const auth = await createTheAuth({
database: { provider: "postgres", url: process.env.DATABASE_URL },
plugins: [emailPassword()],
});
const handler = createNextAuthHandler(auth);
export { handler as GET, handler as POST };
// app/dashboard/page.tsx (Server Component)
import { getServerSession } from "@glinr/theauth-nextjs";
export default async function Dashboard() {
const session = await getServerSession();
if (!session) redirect("/sign-in");
return <h1>Hello, {session.user.email}</h1>;
}
See examples/nextjs-app for a full working example.
npm install @glinr/theauth @glinr/theauth-sveltekit
// src/hooks.server.ts
import { createTheAuth } from "@glinr/theauth";
import { emailPassword } from "@glinr/theauth/auth";
import { createSvelteKitHandler } from "@glinr/theauth-sveltekit";
const auth = await createTheAuth({
database: { provider: "sqlite", url: "theauth.db" },
plugins: [emailPassword()],
});
export const handle = createSvelteKitHandler(auth);
// src/routes/+layout.server.ts
import { getSession } from "@glinr/theauth-sveltekit";
export async function load(event) {
const session = await getSession(event);
return { session };
}
</details>
<details>
<summary><strong>Vue / Nuxt</strong></summary>
npm install @glinr/theauth @glinr/theauth-nuxt
// server/plugins/theauth.ts
import { createTheAuth } from "@glinr/theauth";
import { emailPassword } from "@glinr/theauth/auth";
export const auth = await createTheAuth({
database: { provider: "postgres", url: process.env.DATABASE_URL },
plugins: [emailPassword()],
});
// nuxt.config.ts
export default defineNuxtConfig({
modules: ["@glinr/theauth-nuxt"],
});
</details>
<details>
<summary><strong>Hono (Cloudflare Workers / Express / Bun)</strong></summary>
npm install @glinr/theauth @glinr/theauth-hono
import { Hono } from "hono";
import { createTheAuth } from "@glinr/theauth";
import { emailPassword } from "@glinr/theauth/auth";
import { createHonoAdapter } from "@glinr/theauth-hono";
type Env = { DATABASE_URL: string };
const app = new Hono<{ Bindings: Env }>();
app.use("/api/auth/*", async (c, next) => {
const auth = await createTheAuth({
database: { provider: "postgres", url: c.env.DATABASE_URL },
plugins: [emailPassword()],
});
return createHonoAdapter(auth)(c, next);
});
export default app;
``
Truncated for display — read the full file on GitHub.
Related Skills
Agent-Reach
87.2kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
74.2kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
ruflo
73.6k🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
CowAgent
47.2kOpen-source personal AI assistant & Agent Harness. Plans tasks, runs tools and skills, self-evolves with memory and knowledge. Multi-agent, multi-model, multi-channel. Lightweight, extensible, one-line install.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
