4 instantiations of McpServerEndpointAnnotation
Aspire.Hosting (1)
ApplicationModel\McpServerEndpointAnnotation.cs (1)
40return new McpServerEndpointAnnotation(async (resource, cancellationToken) =>
Aspire.Hosting.Tests (3)
ApplicationModel\McpServerEndpointAnnotationTests.cs (3)
13Assert.Throws<ArgumentNullException>(() => new McpServerEndpointAnnotation(null!)); 20var annotation = new McpServerEndpointAnnotation((resource, ct) => Task.FromResult<Uri?>(expectedUri)); 31var 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> 36public static McpServerEndpointAnnotation FromEndpoint(string endpointName, string? path = "/mcp")
Backchannel\AuxiliaryBackchannelRpcTarget.cs (5)
159resourceWithEndpoints.TryGetLastAnnotation<McpServerEndpointAnnotation>(out var mcpAnnotation)) 186/// Invokes a tool on the MCP server exposed by a resource annotated with <see cref="McpServerEndpointAnnotation"/>. 217if (!resource.TryGetLastAnnotation<McpServerEndpointAnnotation>(out var annotation))
Aspire.Hosting.Azure.Tests (2)
AzurePostgresExtensionsTests.cs (2)
386var 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)
38var mcpAnnotation = Assert.Single(mcpContainer.Annotations.OfType<McpServerEndpointAnnotation>()); 62var mcpAnnotation = Assert.Single(mcpContainer.Annotations.OfType<McpServerEndpointAnnotation>());
Aspire.Hosting.Tests (23)
ApplicationModel\McpServerEndpointAnnotationTests.cs (23)
20var annotation = new McpServerEndpointAnnotation((resource, ct) => Task.FromResult<Uri?>(expectedUri)); 31var annotation = new McpServerEndpointAnnotation((resource, ct) => Task.FromResult<Uri?>(null)); 42Assert.Throws<ArgumentNullException>(() => McpServerEndpointAnnotation.FromEndpoint(null!)); 48Assert.Throws<ArgumentException>(() => McpServerEndpointAnnotation.FromEndpoint("")); 54Assert.Throws<ArgumentException>(() => McpServerEndpointAnnotation.FromEndpoint(" ")); 60var annotation = McpServerEndpointAnnotation.FromEndpoint("nonexistent"); 76var annotation = McpServerEndpointAnnotation.FromEndpoint("http"); 91var annotation = McpServerEndpointAnnotation.FromEndpoint("http", "/sse"); 106var annotation = McpServerEndpointAnnotation.FromEndpoint("http", null); 122var annotation = McpServerEndpointAnnotation.FromEndpoint("http", ""); 138var annotation = McpServerEndpointAnnotation.FromEndpoint("http", "custom/path"); 153var annotation = McpServerEndpointAnnotation.FromEndpoint("http", "/mcp"); 168var annotation = McpServerEndpointAnnotation.FromEndpoint("http"); 185var annotation = McpServerEndpointAnnotation.FromEndpoint("https", "/mcp");