Skip to main content

Definition

Assembly: Microsoft.AspNetCore.Http.Abstractions.dll Namespace: Microsoft.AspNetCore.Builder

Syntax

Summary

This type is defined in Microsoft.AspNetCore.Http.Abstractions.

Remarks

See Microsoft documentation for more information about the rest of the API.

Methods

UseODataMcp Extension

Extension method from Microsoft.AspNetCore.Builder.ODataMcp_AspNetCore_ApplicationBuilderExtensions
Maps official MCP HTTP endpoints at {prefix}/mcp for each OData prefix enabled by AddODataMcp. Call this after OData routes are mapped (MapControllers, MapODataRoute, or Restier MapApiRoute).

Syntax

Parameters

Returns

Type: Microsoft.AspNetCore.Builder.IApplicationBuilder The application builder.

Examples

Remarks

AddODataMcp registers services only. This method turns MCP on. Do not call the MCP SDK MapMcp yourself; this method invokes it per enabled prefix. Discovery reads the WebApplication data sources, then DI, each source once. An empty UseEndpoints flush runs only when those collections are empty.