Table of Contents

Class Root

Namespace
ModelContextProtocol.Protocol
Assembly
ModelContextProtocol.Core.dll

Represents a root URI and its metadata in the Model Context Protocol.

[Obsolete("The Roots feature is deprecated as of specification version 2026-07-28 and may be removed in a future version. See SEP-2577 for more information.", DiagnosticId = "MCP9005", UrlFormat = "https://github.com/modelcontextprotocol/csharp-sdk/blob/main/docs/list-of-diagnostics.md#obsolete-apis")]
public sealed class Root
Inheritance
Root
Inherited Members

Remarks

Root URIs serve as entry points for resource navigation, typically representing top-level directories or container resources that are relevant to the current session. Roots inform servers which locations the client considers important, providing informational guidance rather than an access-control mechanism. Each root has a URI that uniquely identifies it and optional metadata like a human-readable name.

Properties

Meta

Gets or sets additional metadata for the root.

[JsonPropertyName("_meta")]
public JsonObject? Meta { get; set; }

Property Value

JsonObject

Remarks

This is reserved by the protocol for future use.

Name

Gets or sets a human-readable name for the root.

[JsonPropertyName("name")]
public string? Name { get; set; }

Property Value

string

Uri

Gets or sets the URI of the root.

[JsonPropertyName("uri")]
[StringSyntax("Uri")]
public required string Uri { get; set; }

Property Value

string