Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

ResourceWithEndpoints.WithMcpServer

Method
📦 Aspire.Hosting v17.0.0
func (ResourceWithEndpoints) WithMcpServer(options ...*WithMcpServerOptions) ResourceWithEndpoints

Signature

methodWithMcpServerbuilder
Marks the resource as hosting a Model Context Protocol (MCP) server on the specified endpoint.
WithMcpServer(options ...*WithMcpServerOptions) ResourceWithEndpoints
options...*WithMcpServerOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithMcpServerOptions argument.

Path*stringAn optional path to append to the endpoint URL when forming the MCP server address. Defaults to "/mcp".
EndpointName*stringAn optional name of the endpoint that hosts the MCP server. If not specified, defaults to the first HTTPS or HTTP endpoint.
ResourceWithEndpoints

The resource builder.

Returns a handle; failures surface later via Err().

Defined on

A marker interface declares no methods of its own in Go. Its functions are declared on the concrete types they apply to.

Applies to

This function applies to the following types: