File tree Expand file tree Collapse file tree 2 files changed +19
-22
lines changed
src/ModelContextProtocol.AspNetCore Expand file tree Collapse file tree 2 files changed +19
-22
lines changed Original file line number Diff line number Diff line change 1- using Microsoft . AspNetCore . Http ;
2- using ModelContextProtocol . AspNetCore . Auth ;
1+ using Microsoft . AspNetCore . Http ;
32
4- namespace Microsoft . AspNetCore . Builder ;
3+ namespace ModelContextProtocol . AspNetCore . Auth ;
54
6- public static partial class McpEndpointRouteBuilderExtensions
5+ /// <summary>
6+ /// Handles the resource metadata endpoint requests in an AOT-compatible way.
7+ /// </summary>
8+ internal sealed class ResourceMetadataEndpointHandler
79{
8- // This class handles the resource metadata endpoint in an AOT-compatible way
9- private sealed class ResourceMetadataEndpointHandler
10+ private readonly ResourceMetadataService _resourceMetadataService ;
11+
12+ public ResourceMetadataEndpointHandler ( ResourceMetadataService resourceMetadataService )
1013 {
11- private readonly ResourceMetadataService _resourceMetadataService ;
12-
13- public ResourceMetadataEndpointHandler ( ResourceMetadataService resourceMetadataService )
14- {
15- _resourceMetadataService = resourceMetadataService ;
16- }
17-
18- public Task HandleRequest ( HttpContext httpContext )
19- {
20- var result = _resourceMetadataService . HandleResourceMetadataRequest ( httpContext ) ;
21- return result . ExecuteAsync ( httpContext ) ;
22- }
14+ _resourceMetadataService = resourceMetadataService ;
2315 }
24- }
16+
17+ public Task HandleRequest ( HttpContext httpContext )
18+ {
19+ var result = _resourceMetadataService . HandleResourceMetadataRequest ( httpContext ) ;
20+ return result . ExecuteAsync ( httpContext ) ;
21+ }
22+ }
Original file line number Diff line number Diff line change 1- using Microsoft . AspNetCore . Builder ;
2- using Microsoft . AspNetCore . Http ;
1+ using Microsoft . AspNetCore . Http ;
32using Microsoft . AspNetCore . Http . Metadata ;
43using Microsoft . AspNetCore . Routing ;
54using Microsoft . Extensions . DependencyInjection ;
@@ -13,7 +12,7 @@ namespace Microsoft.AspNetCore.Builder;
1312/// <summary>
1413/// Provides extension methods for <see cref="IEndpointRouteBuilder"/> to add MCP endpoints.
1514/// </summary>
16- public static partial class McpEndpointRouteBuilderExtensions
15+ public static class McpEndpointRouteBuilderExtensions
1716{
1817 /// <summary>
1918 /// Sets up endpoints for handling MCP Streamable HTTP transport.
You can’t perform that action at this time.
0 commit comments