4 instantiations of McpServerEndpointAnnotation
Aspire.Hosting (1)
ApplicationModel\McpServerEndpointAnnotation.cs (1)
40
return 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));
39 references to McpServerEndpointAnnotation
Aspire.Hosting (9)
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)
159
resourceWithEndpoints.TryGetLastAnnotation<
McpServerEndpointAnnotation
>(out
var
mcpAnnotation))
186
/// Invokes a tool on the MCP server exposed by a resource annotated with <see cref="
McpServerEndpointAnnotation
"/>.
217
if (!resource.TryGetLastAnnotation<
McpServerEndpointAnnotation
>(out
var
annotation))
Aspire.Hosting.Azure.Tests (2)
AzurePostgresExtensionsTests.cs (2)
386
var
mcpAnnotation = Assert.Single(mcpContainer.Annotations.OfType<
McpServerEndpointAnnotation
>());
Aspire.Hosting.PostgreSQL (1)
PostgresBuilderExtensions.cs (1)
386
.WithAnnotation(
McpServerEndpointAnnotation
.FromEndpoint(PostgresMcpContainerResource.PrimaryEndpointName, "/sse"))
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 (23)
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");