alepha@docs:~/docs/packages/alepha/api$
cat oauth.md | pretty
1 min read
Last commit:

#Alepha - Api Oauth

#Installation

Part of the alepha package. Import from alepha/api/oauth.

npm install alepha

#Overview

OAuth 2.1 authorization server module for MCP.

Features:

  • OAuth 2.1 authorization code flow with PKCE (RFC 7636)
  • Dynamic Client Registration (RFC 7591)
  • Authorization server metadata discovery (RFC 8414)
  • Stateless authorization codes (short-lived signed JWTs)
  • Single-use code enforcement

Integration: Register the module and configure the realm + protected resource path:

ts
1const app = Alepha.create()2  .with(AlephaOAuth)3  .set(oauthOptions, { realm: "users", resource: "/mcp" });