MCP TypeScript SDK (V2)
    Preparing search index...
    • Builds a small Express router that serves the given OAuth metadata document at / as JSON, with permissive CORS and a GET/OPTIONS method allow-list.

      Used by mcpAuthMetadataRouter for both the Authorization Server and Protected Resource metadata endpoints.

      Parameters

      • metadata:
            | {
                authorization_endpoint: string;
                client_id_metadata_document_supported?: boolean;
                code_challenge_methods_supported?: string[];
                grant_types_supported?: string[];
                introspection_endpoint?: string;
                introspection_endpoint_auth_methods_supported?: string[];
                introspection_endpoint_auth_signing_alg_values_supported?: string[];
                issuer: string;
                registration_endpoint?: string;
                response_modes_supported?: string[];
                response_types_supported: string[];
                revocation_endpoint?: string;
                revocation_endpoint_auth_methods_supported?: string[];
                revocation_endpoint_auth_signing_alg_values_supported?: string[];
                scopes_supported?: string[];
                service_documentation?: string;
                token_endpoint: string;
                token_endpoint_auth_methods_supported?: string[];
                token_endpoint_auth_signing_alg_values_supported?: string[];
                [key: string]: unknown;
            }
            | {
                authorization_details_types_supported?: string[];
                authorization_servers?: string[];
                bearer_methods_supported?: string[];
                dpop_bound_access_tokens_required?: boolean;
                dpop_signing_alg_values_supported?: string[];
                jwks_uri?: string;
                resource: string;
                resource_documentation?: string;
                resource_name?: string;
                resource_policy_uri?: string;
                resource_signing_alg_values_supported?: string[];
                resource_tos_uri?: string;
                scopes_supported?: string[];
                tls_client_certificate_bound_access_tokens?: boolean;
                [key: string]: unknown;
            }

      Returns RequestHandler