5 instantiations of McpServerEndpointAnnotation
Aspire.Hosting (2)
ApplicationModel\McpServerEndpointAnnotation.cs (1)
40return new McpServerEndpointAnnotation(async (resource, cancellationToken) =>
McpServerResourceBuilderExtensions.cs (1)
50return builder.WithAnnotation(new McpServerEndpointAnnotation(async (resource, cancellationToken) =>
Aspire.Hosting.Tests (3)
ApplicationModel\McpServerEndpointAnnotationTests.cs (3)
14Assert.Throws<ArgumentNullException>(() => new McpServerEndpointAnnotation(null!)); 21var annotation = new McpServerEndpointAnnotation((resource, ct) => Task.FromResult<Uri?>(expectedUri)); 32var 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> 36public static McpServerEndpointAnnotation FromEndpoint(string endpointName, string? path = "/mcp")
Backchannel\AuxiliaryBackchannelRpcTarget.cs (5)
512resourceWithEndpoints.TryGetLastAnnotation<McpServerEndpointAnnotation>(out var mcpAnnotation)) 745/// Invokes a tool on the MCP server exposed by a resource annotated with <see cref="McpServerEndpointAnnotation"/>. 776if (!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)
390var mcpAnnotation = Assert.Single(mcpContainer.Annotations.OfType<McpServerEndpointAnnotation>());
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 (35)
ApplicationModel\McpServerEndpointAnnotationTests.cs (23)
21var annotation = new McpServerEndpointAnnotation((resource, ct) => Task.FromResult<Uri?>(expectedUri)); 32var annotation = new McpServerEndpointAnnotation((resource, ct) => Task.FromResult<Uri?>(null)); 43Assert.Throws<ArgumentNullException>(() => McpServerEndpointAnnotation.FromEndpoint(null!)); 49Assert.Throws<ArgumentException>(() => McpServerEndpointAnnotation.FromEndpoint("")); 55Assert.Throws<ArgumentException>(() => McpServerEndpointAnnotation.FromEndpoint(" ")); 61var annotation = McpServerEndpointAnnotation.FromEndpoint("nonexistent"); 77var annotation = McpServerEndpointAnnotation.FromEndpoint("http"); 92var annotation = McpServerEndpointAnnotation.FromEndpoint("http", "/sse"); 107var annotation = McpServerEndpointAnnotation.FromEndpoint("http", null); 123var annotation = McpServerEndpointAnnotation.FromEndpoint("http", ""); 139var annotation = McpServerEndpointAnnotation.FromEndpoint("http", "custom/path"); 154var annotation = McpServerEndpointAnnotation.FromEndpoint("http", "/mcp"); 169var annotation = McpServerEndpointAnnotation.FromEndpoint("http"); 186var annotation = McpServerEndpointAnnotation.FromEndpoint("https", "/mcp");
WithMcpServerTests.cs (12)
35var mcpAnnotation = Assert.Single(resource.Annotations.OfType<McpServerEndpointAnnotation>()); 57var mcpAnnotation = Assert.Single(resource.Annotations.OfType<McpServerEndpointAnnotation>()); 82var mcpAnnotation = Assert.Single(resource.Annotations.OfType<McpServerEndpointAnnotation>()); 107var mcpAnnotation = Assert.Single(resource.Annotations.OfType<McpServerEndpointAnnotation>()); 132var mcpAnnotation = Assert.Single(resource.Annotations.OfType<McpServerEndpointAnnotation>()); 157var mcpAnnotation = Assert.Single(resource.Annotations.OfType<McpServerEndpointAnnotation>());