Skip to content

Adding custom mcp server is too manual #14606

@davidfowl

Description

@davidfowl

Explicit adding McpServerEndpointAnnotation feels a little raw. Let's add an extension method for this.

Current pattern

var api = builder.AddCSharpApp("api", "./api")
    .WithAnnotation(McpServerEndpointAnnotation.FromEndpoint("https"));

This is only discoverable if you know about McpServerEndpointAnnotation. It should be something like:

var api = builder.AddCSharpApp("api", "./api")
    .WithMcpServer("/mcp");  // or .WithMcpServerEndpoint("https")

The extension method could handle the annotation creation and optionally take the MCP endpoint path for validation/documentation purposes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions