5 instantiations of McpServerEndpointAnnotation
Aspire.Hosting (2)
ApplicationModel\McpServerEndpointAnnotation.cs (1)
40
return new
McpServerEndpointAnnotation
(async (resource, cancellationToken) =>
McpServerResourceBuilderExtensions.cs (1)
49
return builder.WithAnnotation(new
McpServerEndpointAnnotation
(async (resource, cancellationToken) =>
Aspire.Hosting.Tests (3)
ApplicationModel\McpServerEndpointAnnotationTests.cs (3)
13
Assert.Throws<ArgumentNullException>(() => new
McpServerEndpointAnnotation
(null!));
20
var annotation = new
McpServerEndpointAnnotation
((resource, ct) => Task.FromResult<Uri?>(expectedUri));
31
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)
20
var
annotation = new McpServerEndpointAnnotation((resource, ct) => Task.FromResult<Uri?>(expectedUri));
31
var
annotation = new McpServerEndpointAnnotation((resource, ct) => Task.FromResult<Uri?>(null));
42
Assert.Throws<ArgumentNullException>(() =>
McpServerEndpointAnnotation
.FromEndpoint(null!));
48
Assert.Throws<ArgumentException>(() =>
McpServerEndpointAnnotation
.FromEndpoint(""));
54
Assert.Throws<ArgumentException>(() =>
McpServerEndpointAnnotation
.FromEndpoint(" "));
60
var
annotation =
McpServerEndpointAnnotation
.FromEndpoint("nonexistent");
76
var
annotation =
McpServerEndpointAnnotation
.FromEndpoint("http");
91
var
annotation =
McpServerEndpointAnnotation
.FromEndpoint("http", "/sse");
106
var
annotation =
McpServerEndpointAnnotation
.FromEndpoint("http", null);
122
var
annotation =
McpServerEndpointAnnotation
.FromEndpoint("http", "");
138
var
annotation =
McpServerEndpointAnnotation
.FromEndpoint("http", "custom/path");
153
var
annotation =
McpServerEndpointAnnotation
.FromEndpoint("http", "/mcp");
168
var
annotation =
McpServerEndpointAnnotation
.FromEndpoint("http");
185
var
annotation =
McpServerEndpointAnnotation
.FromEndpoint("https", "/mcp");
WithMcpServerTests.cs (12)
34
var
mcpAnnotation = Assert.Single(resource.Annotations.OfType<
McpServerEndpointAnnotation
>());
56
var
mcpAnnotation = Assert.Single(resource.Annotations.OfType<
McpServerEndpointAnnotation
>());
81
var
mcpAnnotation = Assert.Single(resource.Annotations.OfType<
McpServerEndpointAnnotation
>());
106
var
mcpAnnotation = Assert.Single(resource.Annotations.OfType<
McpServerEndpointAnnotation
>());
131
var
mcpAnnotation = Assert.Single(resource.Annotations.OfType<
McpServerEndpointAnnotation
>());
156
var
mcpAnnotation = Assert.Single(resource.Annotations.OfType<
McpServerEndpointAnnotation
>());