McpOAuthOptions constructor
McpOAuthOptions({})
Implementation
McpOAuthOptions({
required this.redirectUri,
this.clientName = 'MCP client',
this.clientIdMetadataUrl,
this.preRegistered = const {},
OAuthStore? store,
this.authorize,
this.applicationType,
this.maxStepUps = 2,
}) : store = store ?? MemoryOAuthStore() {
final redirect = Uri.parse(redirectUri);
if (!(redirect.scheme == 'https' || (redirect.scheme == 'http' && _isLoopback(redirect)))) {
throw ArgumentError.value(redirectUri, 'redirectUri', 'must be https or a localhost URL');
}
final cimd = clientIdMetadataUrl;
if (cimd != null) {
final u = Uri.parse(cimd);
if (u.scheme != 'https' || u.path.isEmpty || u.path == '/') {
throw ArgumentError.value(cimd, 'clientIdMetadataUrl', 'must be an https URL with a path');
}
}
}