Files

20 lines
467 B
C#
Raw Permalink Normal View History

2025-11-13 16:07:34 +08:00
using AspNetCoreMcpServer.Resources;
using AspNetCoreMcpServer.Tools;
var builder = WebApplication.CreateBuilder(args);
// 添加 HttpClientFactory 支持
builder.Services.AddHttpClient();
builder.Services.AddMcpServer()
.WithHttpTransport()
.WithTools<EchoTool>()
.WithTools<SampleLlmTool>()
.WithTools<WeatherTools>()
.WithTools<IotDeviceTools>()
.WithResources<SimpleResourceType>();
var app = builder.Build();
app.MapMcp();
app.Run();