Kinde Is Missing from Mastra's Auth Lineup, So I Built the Provider A developer built `mastra-auth-kinde`, an open-source auth provider that integrates Kinde with the Mastra AI agent framework. The provider enables multi-tenant authentication, machine-to-machine communication, and access control for Mastra's API routes and Studio UI. It addresses a gap in Mastra's official auth lineup, which previously lacked Kinde support. If you're building a SaaS AI agent product and you're already on Kinde, you already know the problem. Mastra is the TypeScript-first AI agent framework. It ships with official auth providers for Clerk, Auth0, Supabase, Firebase, WorkOS, and Better Auth. Kinde is not on that list. The obvious question is why not reach for one of those providers, since Auth0 is already there. Most developers who choose Kinde rely on far more than its login. Kinde ships with the organizational structures, permission systems, and monetization tools that products actually need, bringing auth, billing, feature flags, and multi-tenancy together in one platform. If you're building a B2B SaaS product on Kinde, you're using Kinde orgs to segment your customers, Kinde billing to manage subscriptions, and Kinde feature flags to gate features by plan. Switching to Auth0 or Clerk to support a Mastra agent would mean rebuilding all of that elsewhere, which is not a real option. That gap is the problem. You need Kinde to work with Mastra, and until now there was no clean way to connect them. That's why I built mastra-auth-kinde . When you add an auth provider to Mastra, it protects two things at once: all your API routes /api/agents/ , /api/workflows/ , and so on and your Mastra Studio UI. Every request to a protected route goes through your provider before it reaches anything else. You extend Mastra's MastraAuthProvider base class and implement two methods: authenticateToken token, request verifies the JWT and returns the decoded user, or null if it fails authorizeUser user, request returns true to let the request through, or false for a 403Mastra handles everything else: extracting the Bearer token from the Authorization header, calling your methods in order, and storing the verified user in the request context so your agents and tools can access it. Beyond the billing and org story above, a few things make Kinde the right fit for agent developers in particular. First, Kinde's org model maps directly to multi-tenancy, so each customer gets isolated data and configuration without you building it. Each Kinde organization is a tenant, and the org code claim on every token tells you exactly which org the user belongs to. For a multi-tenant agent, one that serves different customers on the same infrastructure, this is exactly what you need. Second, machine-to-machine authentication comes standard rather than as an expensive add-on. AI agents frequently need to run background jobs, scheduled workflows, and nightly pipelines with no human user in the loop. Kinde handles this natively with client credentials tokens, and this provider handles those too, which I cover below. Third, the free tier is usable for real products, including 10,500 monthly active users, unlimited organizations, and all authentication methods including SSO. You can build a real multi-tenant agent product without paying anything until you're at scale. npm install github:sholajegede/mastra-auth-kinde You also need @mastra/core if you don't already have it: npm install @mastra/core Wire the provider into your Mastra instance: js import { Mastra } from '@mastra/core' import { MastraAuthKinde } from 'mastra-auth-kinde' export const mastra = new Mastra { server: { auth: new MastraAuthKinde { domain: 'https://yourapp.kinde.com', } , }, } Or use environment variables: KINDE DOMAIN=https://yourapp.kinde.com KINDE AUDIENCE=https://api.yourapp.com optional — see the audience section below js export const mastra = new Mastra { server: { auth: new MastraAuthKinde , }, } Once this is in place, every request to /api/ needs a valid Kinde access token in the Authorization: Bearer