Table of Contents

Class McpServerSkillFile

Namespace
ModelContextProtocol.Extensions.Skills
Assembly
ModelContextProtocol.Extensions.Skills.dll

Represents one file of a skill authored through McpServerSkillPackage.

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

Properties

Content

Gets the file's raw content. Its digest and size in the skill's manifest are computed from exactly these bytes.

public required ReadOnlyMemory<byte> Content { get; init; }

Property Value

ReadOnlyMemory<byte>

MimeType

Gets the MIME type to advertise for the file's resource, or null to infer one from the file's extension.

public string? MimeType { get; init; }

Property Value

string

Path

Gets the file's path relative to the skill's root directory, using / as the separator (for example, SKILL.md or references/GUIDE.md).

public required string Path { get; init; }

Property Value

string

Methods

FromText(string, string, string?)

Creates a file from UTF-8 encoded text.

public static McpServerSkillFile FromText(string path, string text, string? mimeType = null)

Parameters

path string

The file's path relative to the skill's root directory.

text string

The file's content.

mimeType string

The MIME type to advertise, or null to infer one from path.

Returns

McpServerSkillFile

The file.

Exceptions

ArgumentNullException

path or text is null.