Table of Contents

Class McpAuthenticationOptions

Namespace
ModelContextProtocol.AspNetCore.Authentication
Assembly
ModelContextProtocol.AspNetCore.dll

Represents options for the MCP authentication handler.

public class McpAuthenticationOptions : AuthenticationSchemeOptions
Inheritance
McpAuthenticationOptions
Inherited Members

Constructors

McpAuthenticationOptions()

Initializes a new instance of the McpAuthenticationOptions class.

public McpAuthenticationOptions()

Properties

Events

Gets or sets the events used to handle authentication events.

public McpAuthenticationEvents Events { get; set; }

Property Value

McpAuthenticationEvents

ResourceMetadata

Gets or sets the protected resource metadata.

public ProtectedResourceMetadata? ResourceMetadata { get; set; }

Property Value

ProtectedResourceMetadata

Remarks

This contains the OAuth metadata for the protected resource, including authorization servers, supported scopes, and other information needed for clients to authenticate.

ResourceMetadataUri

Gets or sets the URI to the resource metadata document.

public Uri? ResourceMetadataUri { get; set; }

Property Value

Uri

Remarks

This URI is included in the WWW-Authenticate header when a 401 response is returned. When null, the handler automatically uses the default /.well-known/oauth-protected-resource/<resource-path> endpoint that mirrors the requested resource path.