Class McpServerResourceAttribute
Attribute to mark a method as an MCP server resource and provide metadata for discovery and documentation.
[AttributeUsage(AttributeTargets.Method)]
public class McpServerResourceAttribute : Attribute
- Inheritance
-
McpServerResourceAttribute
- Inherited Members
- Extension Methods
Constructors
McpServerResourceAttribute(string, string, string, string)
Initializes a new instance of the McpServerResourceAttribute class with the specified URI, name, description, and MIME type.
public McpServerResourceAttribute(string uri, string name, string description = "", string mimeType = "text/plain")
Parameters
uristringThe unique relative URI of the resource.
namestringThe name of the resource.
descriptionstringThe description of the resource.
mimeTypestringThe MIME type of the resource.
Properties
Description
Gets the description of the resource.
public string Description { get; }
Property Value
MimeType
Gets the MIME type of the resource.
public string MimeType { get; }
Property Value
Name
Gets the name of the resource.
public string Name { get; }
Property Value
Uri
Gets the unique relative URI of the resource.
public Uri Uri { get; }