-
Notifications
You must be signed in to change notification settings - Fork 730
Expand file tree
/
Copy pathMcpUiResourceMeta.cs
More file actions
50 lines (45 loc) · 1.85 KB
/
Copy pathMcpUiResourceMeta.cs
File metadata and controls
50 lines (45 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System.Diagnostics.CodeAnalysis;
using System.Text.Json.Serialization;
namespace ModelContextProtocol.Server;
/// <summary>
/// Represents the UI metadata associated with an MCP resource in the MCP Apps extension.
/// </summary>
/// <remarks>
/// This metadata is placed under the <c>ui</c> key in the resource's <c>_meta</c> 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.
/// </remarks>
[Experimental(Experimentals.Apps_DiagnosticId, UrlFormat = Experimentals.Apps_Url)]
public sealed class McpUiResourceMeta
{
/// <summary>
/// Gets or sets the Content Security Policy configuration for this resource.
/// </summary>
/// <remarks>
/// Specifies the allowed origins for network requests, resource loads, and nested frames.
/// </remarks>
[JsonPropertyName("csp")]
public McpUiResourceCsp? Csp { get; set; }
/// <summary>
/// Gets or sets the sandbox permissions for this resource.
/// </summary>
/// <remarks>
/// Controls which browser sandbox features the UI resource is allowed to use.
/// </remarks>
[JsonPropertyName("permissions")]
public McpUiResourcePermissions? Permissions { get; set; }
/// <summary>
/// Gets or sets the dedicated origin domain for this resource.
/// </summary>
/// <remarks>
/// When set, the host will serve the resource from this dedicated origin,
/// enabling OAuth flows and CORS without wildcard exceptions.
/// </remarks>
[JsonPropertyName("domain")]
public string? Domain { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the host should render a visual border around the UI.
/// </summary>
[JsonPropertyName("prefersBorder")]
public bool? PrefersBorder { get; set; }
}