Skip to content
Docs Try Aspire

McpServerEndpointAnnotation Constructors

Class Constructors 1 member
Represents an annotation that identifies an endpoint on a resource that hosts a Model Context Protocol (MCP) server.
Constructor(Func<IResourceWithEndpoints, CancellationToken, Task<Uri?>>) Section titled Constructor(Func<IResourceWithEndpoints, CancellationToken, Task<Uri?>>)
Initializes a new instance of the McpServerEndpointAnnotation class.
public sealed class McpServerEndpointAnnotation
{
public McpServerEndpointAnnotation(
Func<IResourceWithEndpoints, CancellationToken, Task<Uri?>> endpointUrlResolver)
{
// ...
}
}
endpointUrlResolver Func<IResourceWithEndpoints, CancellationToken, Task<Uri?>> A callback that resolves the MCP server endpoint URL from the resource.