Table of Contents

Class McpServerResourceAttribute

Namespace
nanoFramework.WebServer.Mcp
Assembly
nanoFramework.WebServer.Mcp.dll

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

uri string

The unique relative URI of the resource.

name string

The name of the resource.

description string

The description of the resource.

mimeType string

The MIME type of the resource.

Properties

Description

Gets the description of the resource.

public string Description { get; }

Property Value

string

MimeType

Gets the MIME type of the resource.

public string MimeType { get; }

Property Value

string

Name

Gets the name of the resource.

public string Name { get; }

Property Value

string

Uri

Gets the unique relative URI of the resource.

public Uri Uri { get; }

Property Value

Uri