> ## Documentation Index
> Fetch the complete documentation index at: https://ai.easyaf.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# IApplicationBuilder

> Extension methods for IApplicationBuilder from Microsoft.AspNetCore.Http.Abstractions

## Definition

**Assembly:** Microsoft.AspNetCore.Http.Abstractions.dll

**Namespace:** Microsoft.AspNetCore.Builder

## Syntax

```csharp theme={null}
Microsoft.AspNetCore.Builder.IApplicationBuilder
```

## Summary

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

## Remarks

See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.builder.iapplicationbuilder) for more information about the rest of the API.

## Methods

### &#x20;UseODataMcp Extension

> [!NOTE]
>
> 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

```csharp theme={null}
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseODataMcp(Microsoft.AspNetCore.Builder.IApplicationBuilder app)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `app` | `Microsoft.AspNetCore.Builder.IApplicationBuilder` | The application builder. |

#### Returns

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

#### Examples

```csharp theme={null}
builder.Services.AddControllers()
    .AddOData(options =&gt; options.AddRouteComponents("odata", GetEdmModel()));
builder.Services.AddODataMcp();

var app = builder.Build();
app.UseRouting();
app.MapControllers();
app.UseODataMcp();
```

#### 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.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.