Table of Contents

Class McpUiToolMeta

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

Represents the UI metadata associated with an MCP tool in the MCP Apps extension.

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

Remarks

This metadata is placed under the ui key in the tool's _meta object. It associates the tool with a UI resource (identified by a ui:// URI) and optionally controls which principals (model, app) can call the tool.

Properties

ResourceUri

Gets or sets the URI of the UI resource associated with this tool.

[JsonPropertyName("resourceUri")]
public string? ResourceUri { get; set; }

Property Value

string

Remarks

This should be a ui:// URI pointing to the HTML resource registered with the server (e.g., "ui://weather/view.html").

Visibility

Gets or sets the visibility of the tool, controlling which principals can invoke it.

[JsonPropertyName("visibility")]
public IList<string>? Visibility { get; set; }

Property Value

IList<string>

Remarks

Allowed values are Model ("model") and App ("app"). When null or empty, the tool is visible to both the model and the app (the default).