5 instantiations of McpServerEndpointAnnotation
Aspire.Hosting (2)
ApplicationModel\McpServerEndpointAnnotation.cs (1)
40
return new
McpServerEndpointAnnotation
(async (resource, cancellationToken) =>
McpServerResourceBuilderExtensions.cs (1)
50
return builder.WithAnnotation(new
McpServerEndpointAnnotation
(async (resource, cancellationToken) =>
Aspire.Hosting.Tests (3)
ApplicationModel\McpServerEndpointAnnotationTests.cs (3)
14
Assert.Throws<ArgumentNullException>(() => new
McpServerEndpointAnnotation
(null!));
21
var annotation = new
McpServerEndpointAnnotation
((resource, ct) => Task.FromResult<Uri?>(expectedUri));
32
var annotation = new
McpServerEndpointAnnotation
((resource, ct) => Task.FromResult<Uri?>(null));
51 references to McpServerEndpointAnnotation
Aspire.Hosting (10)
ApplicationModel\McpServerEndpointAnnotation.cs (4)
16
/// Initializes a new instance of the <see cref="
McpServerEndpointAnnotation
"/> class.
31
/// Creates an <see cref="
McpServerEndpointAnnotation
"/> that resolves the MCP server URL from a named endpoint.
35
/// <returns>A new <see cref="
McpServerEndpointAnnotation
"/> instance.</returns>
36
public static
McpServerEndpointAnnotation
FromEndpoint(string endpointName, string? path = "/mcp")
Backchannel\AuxiliaryBackchannelRpcTarget.cs (5)
512
resourceWithEndpoints.TryGetLastAnnotation<
McpServerEndpointAnnotation
>(out
var
mcpAnnotation))
745
/// Invokes a tool on the MCP server exposed by a resource annotated with <see cref="
McpServerEndpointAnnotation
"/>.
776
if (!resource.TryGetLastAnnotation<
McpServerEndpointAnnotation
>(out
var
annotation))
McpServerResourceBuilderExtensions.cs (1)
25
/// This method adds an <see cref="
McpServerEndpointAnnotation
"/> to the resource, enabling the Aspire tooling
Aspire.Hosting.Azure.Tests (2)
AzurePostgresExtensionsTests.cs (2)
390
var
mcpAnnotation = Assert.Single(mcpContainer.Annotations.OfType<
McpServerEndpointAnnotation
>());
Aspire.Hosting.PostgreSQL.Tests (4)
PostgresMcpBuilderTests.cs (4)
38
var
mcpAnnotation = Assert.Single(mcpContainer.Annotations.OfType<
McpServerEndpointAnnotation
>());
62
var
mcpAnnotation = Assert.Single(mcpContainer.Annotations.OfType<
McpServerEndpointAnnotation
>());
Aspire.Hosting.Tests (35)
ApplicationModel\McpServerEndpointAnnotationTests.cs (23)
21
var
annotation = new McpServerEndpointAnnotation((resource, ct) => Task.FromResult<Uri?>(expectedUri));
32
var
annotation = new McpServerEndpointAnnotation((resource, ct) => Task.FromResult<Uri?>(null));
43
Assert.Throws<ArgumentNullException>(() =>
McpServerEndpointAnnotation
.FromEndpoint(null!));
49
Assert.Throws<ArgumentException>(() =>
McpServerEndpointAnnotation
.FromEndpoint(""));
55
Assert.Throws<ArgumentException>(() =>
McpServerEndpointAnnotation
.FromEndpoint(" "));
61
var
annotation =
McpServerEndpointAnnotation
.FromEndpoint("nonexistent");
77
var
annotation =
McpServerEndpointAnnotation
.FromEndpoint("http");
92
var
annotation =
McpServerEndpointAnnotation
.FromEndpoint("http", "/sse");
107
var
annotation =
McpServerEndpointAnnotation
.FromEndpoint("http", null);
123
var
annotation =
McpServerEndpointAnnotation
.FromEndpoint("http", "");
139
var
annotation =
McpServerEndpointAnnotation
.FromEndpoint("http", "custom/path");
154
var
annotation =
McpServerEndpointAnnotation
.FromEndpoint("http", "/mcp");
169
var
annotation =
McpServerEndpointAnnotation
.FromEndpoint("http");
186
var
annotation =
McpServerEndpointAnnotation
.FromEndpoint("https", "/mcp");
WithMcpServerTests.cs (12)
35
var
mcpAnnotation = Assert.Single(resource.Annotations.OfType<
McpServerEndpointAnnotation
>());
57
var
mcpAnnotation = Assert.Single(resource.Annotations.OfType<
McpServerEndpointAnnotation
>());
82
var
mcpAnnotation = Assert.Single(resource.Annotations.OfType<
McpServerEndpointAnnotation
>());
107
var
mcpAnnotation = Assert.Single(resource.Annotations.OfType<
McpServerEndpointAnnotation
>());
132
var
mcpAnnotation = Assert.Single(resource.Annotations.OfType<
McpServerEndpointAnnotation
>());
157
var
mcpAnnotation = Assert.Single(resource.Annotations.OfType<
McpServerEndpointAnnotation
>());