using System.Diagnostics.CodeAnalysis; using System.Text.Json.Serialization; namespace ModelContextProtocol.Extensions.Apps; /// /// Represents the UI metadata associated with an MCP resource in the MCP Apps extension. /// /// /// This metadata is placed under the ui key in the resource's _meta object. /// It provides Content Security Policy (CSP) configuration, sandbox permissions, CORS origin, and /// visual boundary preferences for the UI resource served by this MCP server. /// [Experimental(Experimentals.Apps_DiagnosticId, UrlFormat = Experimentals.Apps_Url)] public sealed class McpUiResourceMeta { /// /// Gets or sets the Content Security Policy configuration for this resource. /// /// /// Specifies the allowed origins for network requests, resource loads, and nested frames. /// [JsonPropertyName("csp")] public McpUiResourceCsp? Csp { get; set; } /// /// Gets or sets the sandbox permissions for this resource. /// /// /// Controls which browser sandbox features the UI resource is allowed to use. /// [JsonPropertyName("permissions")] public McpUiResourcePermissions? Permissions { get; set; } /// /// Gets or sets the dedicated origin domain for this resource. /// /// /// When set, the host will serve the resource from this dedicated origin, /// enabling OAuth flows and CORS without wildcard exceptions. /// [JsonPropertyName("domain")] public string? Domain { get; set; } /// /// Gets or sets a value indicating whether the host should render a visual border around the UI. /// [JsonPropertyName("prefersBorder")] public bool? PrefersBorder { get; set; } }