Skip to content
DocsTry Aspire
DocsTry

McpServerEndpointAnnotation Methods

ClassMethods1 member
Represents an annotation that identifies an endpoint on a resource that hosts a Model Context Protocol (MCP) server.
Creates an McpServerEndpointAnnotation that resolves the MCP server URL from a named endpoint.
public sealed class McpServerEndpointAnnotation
{
public static McpServerEndpointAnnotation FromEndpoint(
string endpointName,
string? path = "/mcp")
{
// ...
}
}
endpointNamestringThe name of the endpoint on the resource that hosts the MCP server.
pathstring?optionalAn optional path to append to the endpoint URL. Defaults to "/mcp".