IResourceWithEndpoints.withMcpServer

Method
📦 Aspire.Hosting v17.0.0
interface IResourceWithEndpoints {
// ... omitted for brevity
withMcpServer(
path?: string,
endpointName?: string): IResourceWithEndpoints;
}

Signature

methodwithMcpServerbuilder
Marks the resource as hosting a Model Context Protocol (MCP) server on the specified endpoint.
withMcpServer(
path?: string,
endpointName?: string): IResourceWithEndpoints
pathstringoptional= /mcpAn optional path to append to the endpoint URL when forming the MCP server address. Defaults to `"/mcp"`. A leading slash is added if missing. A null or empty value uses the endpoint URL without an additional path.
endpointNamestringoptionalAn optional name of the endpoint that hosts the MCP server. If not specified, selects the endpoint named `https`, falling back to the endpoint named `http`. Names are matched case-insensitively; endpoints with other names must be selected explicitly, regardless of their URI scheme.
IResourceWithEndpoints

Defined on

This method is defined on the following type: