@redopjs/redop today. Each one returns a Redop instance, so you attach it with .use(...).
logger(opts?)
- logs tool start, end, and error events
- options:
level?: "debug" | "info" | "warn" | "error"write?: (entry) => void
- default level:
info
apiKey(opts?)
- validates an HTTP header on HTTP requests
- options:
key?: stringkeys?: string[]headerName?: stringcontextKey?: stringrequired?: booleanvalidateKey?: (apiKey, event) => boolean | Promise<boolean>- legacy aliases still supported:
secret,ctxKey,validate
- default header:
x-api-key - default context key:
apiKey
jwt(opts)
- validates bearer JWTs on HTTP requests
- supports shared-secret verification or JWKS
- options:
secret?: stringjwksUri?: stringissuer?: stringaudience?: string | string[]requiredScopes?: string[]optional?: boolean
oauth(opts)
- validates OAuth bearer tokens using issuer discovery (OAuth AS or OpenID) + JWKS
- when
resourceis set, serves RFC 9728 Protected Resource Metadata and returns HTTP 401/403WWW-Authenticatechallenges for MCP clients (Claude, etc.) - options:
issuer: stringresource?: string(absolute MCP URL — required for Claude-style OAuth)audience?: string | string[](defaults toresource)authorizationServers?: string[](defaults to[issuer])requiredScopes?: string[]scopesSupported?: string[]optional?: boolean