Table of Contents

Class McpAppsBuilderExtensions

Namespace
ModelContextProtocol.Extensions.Apps
Assembly
ModelContextProtocol.Extensions.Apps.dll

Extension methods for IMcpServerBuilder to enable MCP Apps support.

[Experimental("MCPEXP003", UrlFormat = "https://github.com/modelcontextprotocol/csharp-sdk/blob/main/docs/list-of-diagnostics.md#mcpexp003")]
public static class McpAppsBuilderExtensions
Inheritance
McpAppsBuilderExtensions
Inherited Members

Methods

WithMcpApps(IMcpServerBuilder)

Enables MCP Apps support by automatically processing McpAppUiAttribute on registered tools.

public static IMcpServerBuilder WithMcpApps(this IMcpServerBuilder builder)

Parameters

builder IMcpServerBuilder

The server builder.

Returns

IMcpServerBuilder

The builder provided in builder.

Examples

builder.Services
    .AddMcpServer()
    .WithTools<MyToolType>()
    .WithMcpApps();

Remarks

Call this method after registering tools (e.g., after WithTools<T>()) to automatically apply McpAppUiAttribute metadata to the tool's _meta.ui field.

Tools that already have a ui key in their Meta (e.g., set explicitly via Meta) are not modified.