00/Use case · MCP servers
The MCP specification asks authorization servers to implement OAuth 2.1 with PKCE S256, protected resource metadata, dynamic client registration, and server metadata. KavachOS ships all of it, RFC-compliant, edge-ready. Point your resource server at it and get back to building tools.
01/TL;DR
RFC 9728 protected resource metadata, RFC 8414 server metadata, RFC 7591 dynamic client registration, PKCE S256 everywhere.
Deploy on Cloudflare Workers, Vercel Edge, Deno, or Node. No JVM, no extra infrastructure, no secondary database.
Describe your resources, scopes, and issuer in a single config. KavachOS handles discovery, token exchange, and revocation.
02/The problem
The MCP spec is generous about what clients expect: an authorization server that advertises itself with RFC 8414, issues tokens with PKCE S256, accepts dynamic client registration per RFC 7591, and serves protected resource metadata per RFC 9728. Most teams underestimate this and lose weeks.
PKCE S256 done wrong
Plain PKCE is trivially replayable. Clients expect S256 specifically. Getting the code challenge encoding right is a common stumble.
Metadata endpoints missing or wrong
MCP clients look for /.well-known/oauth-authorization-server and /.well-known/oauth-protected-resource. If either is missing or returns the wrong shape, connection fails silently.
Dynamic client registration not implemented
RFC 7591 is optional in OAuth 2.1 but required in practice for MCP. Skipping it means every new client needs a manual onboarding.
Tokens not bound to an audience
Without an aud claim, a token issued for one MCP server can be replayed against another. Clients expect tight audience binding.
03/How kavachOS fits
KavachOS ships the full authorization server surface that MCP clients expect. You point your resource server at it, declare your scopes, and go. No custom endpoint code.
Metadata
PKCE
DCR
Audience
Revocation
04/In code
Full examples with framework adapters live in the docs. This is the shape of what you wire into your app.
mcp-server.ts
Wire a KavachOS authorization server into a Hono-based MCP server. The middleware verifies the token, the audience, and the scope on every tool call.
import { Hono } from "hono";
import { kavachosMCP } from "kavachos/mcp";
const app = new Hono();
app.use("/tools/*", kavachosMCP({
issuer: "https://auth.example.com",
audience: "https://mcp.example.com",
requiredScope: "tools:call"
}));
app.post("/tools/:name", async (c) => {
const { subject, scopes } = c.get("kavachos");
// subject is the MCP client, scopes enforced above.
return c.json(await runTool(c.req.param("name"), c.req.json()));
});
export default app;RFC 9728
Protected resource metadata
RFC 8414
Auth server metadata
RFC 7591
Dynamic client registration
PKCE S256
Enforced at authorize
05/Before / after
Without scoped identity
With kavachOS
We estimated three weeks to build OAuth 2.1 for our MCP server. We pointed it at KavachOS in under an hour and spent the saved time on the tools themselves. That was the whole point.
06/FAQ
Short answers. Link out to the docs if you want the long version.
07/Related reading
On kavachos.com
What KavachOS implements, the RFCs covered, and the spec versions supported.
On kavachos.com
Walk through the spec with concrete request and response shapes.
On kavachos.com
Why edge-native TypeScript beats a JVM for modern MCP deployments.
Managed cloud or self-hosted, both options run the same RFC-compliant authorization server. Free to start, no credit card.