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
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
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
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
pathstringThe file's path relative to the skill's root directory.
textstringThe file's content.
mimeTypestringThe MIME type to advertise, or null to infer one from
path.
Returns
- McpServerSkillFile
The file.
Exceptions
- ArgumentNullException
pathortextis null.