Definition
Assembly: Microsoft.OData.Mcp.AspNetCore.dll Namespace: Microsoft.OData.Mcp.AspNetCore.Hosting Inheritance: System.ObjectSyntax
Summary
Host options forAddODataMcp.
Constructors
.ctor
Syntax
.ctor Inherited
Inherited from
objectSyntax
Properties
Catalog
Gets the catalog options applied to every enabled OData route.Syntax
Property Value
Type:Microsoft.OData.Mcp.Core.Catalog.ODataMcpCatalogOptions
ExcludeRoutes
Gets prefixes that must not be exposed over MCP, matched without regard to case or leading slashes. Applied after ODataMcpHostOptions.IncludePrefixes.Syntax
Property Value
Type:System.Collections.Generic.List<string>
ExplicitRoutes
Gets routes registered explicitly when endpoint discovery cannot see an IEdmModel. Discovered routes with the same prefix replace these entries.Syntax
Property Value
Type:System.Collections.Generic.List<Microsoft.OData.Mcp.AspNetCore.Hosting.ODataMcpRouteBinding>
IncludePrefixes
Gets prefixes that should be exposed over MCP. When empty, every discovered (and explicit) prefix is enabled. When non-empty, only matching prefixes are enabled. Prefer this over an OData-version-specific helper.Syntax
Property Value
Type:System.Collections.Generic.List<string>
Examples
RateLimitingPolicyName
Gets or sets the ASP.NET Core rate-limiting policy name attached to each MCP endpoint. When null, the endpoint still participates in a global limiter configured withUseRateLimiter.
Syntax
Property Value
Type:string?
Examples
RequireAuthorization
Gets or sets a value indicating whether MCP endpoints require an authenticated user. Whentrue, the mapped MCP endpoints call RequireAuthorization and participate
in the host’s authentication and authorization pipeline.
Syntax
Property Value
Type:bool
Methods
AddRoute
Registers an explicit prefix and model when the routing table does not carry an IEdmModel (for example a custom host that never wrote OData metadata).Syntax
Parameters
Returns
Type:Microsoft.OData.Mcp.AspNetCore.Hosting.ODataMcpHostOptions
The same options instance.
Examples
Remarks
Discovery fromEndpointDataSource still runs and wins when it finds the same prefix.
Equals Inherited Virtual
Inherited from
objectSyntax
Parameters
Returns
Type:bool
Equals Inherited
Inherited from
objectSyntax
Parameters
Returns
Type:bool
GetHashCode Inherited Virtual
Inherited from
objectSyntax
Returns
Type:int
GetType Inherited
Inherited from
objectSyntax
Returns
Type:System.Type
MemberwiseClone Inherited
Inherited from
objectSyntax
Returns
Type:object
ReferenceEquals Inherited
Inherited from
objectSyntax
Parameters
Returns
Type:bool
ToString Inherited Virtual
Inherited from
objectSyntax
Returns
Type:string?