oauth conformance command runs, but programmatically — for custom reporters, test frameworks, recording/replay via custom fetchFn, or Playwright-driven consent via openUrl.
For CLI usage (one-liners, CI recipes, troubleshooting), see CLI: OAuth Conformance.
This page covers the TypeScript SDK only.
Import
Single flow
OAuthConformanceConfig
OAuthConformanceAuthConfig
interactive.openUrl— override how the consent URL is opened. Default launches the system browser. Use for Playwright, custom launchers, or logging the URL.
OAuthConformanceClientConfig
OAuthVerificationConfig
SDK-only features
These are available in the SDK but not exposed as CLI flags.Custom fetch (fetchFn)
Swap in a recording, mocking, or proxying fetch implementation:
DCR metadata overrides (dynamicRegistration)
Customize the client metadata sent during Dynamic Client Registration:
Negative conformance checks (oauthConformanceChecks)
When enabled, six extra checks run after a successful flow:
- DCR redirect URI policy — attempts dynamic client registration with a non-loopback
http://redirect URI; expects rejection under the MCP authorization profile. - Invalid client — sends a token request with an unknown
client_id; expects rejection. - Invalid redirect at the authorization endpoint — sends an authorization request with a mismatched
redirect_uriand looks for rejection before the server redirects back to it. This step may beskippedif the server defers validation behind user interaction. - Invalid token — sends an authenticated MCP initialize request with an obviously invalid bearer token; expects HTTP 401 from the MCP server.
- Invalid redirect at the token endpoint — sends a token request with a mismatched
redirect_urito look for redirect exact-match enforcement. This step may beskippedif the request is rejected for another reason before redirect validation is demonstrated. - Token format — validates the token response includes
access_token,token_type, and expiration metadata.
oauthConformanceChecks is also available via the CLI’s --conformance-checks flag.Suite
Result types
ConformanceResult
StepResult
VerificationResult
OAuthConformanceSuiteResult
Related
- CLI: OAuth Conformance — recipes, troubleshooting, CI integration
- CLI: OAuth Login — interactive authentication and debugging
- MCPClientManager — connecting to MCP servers programmatically

