* Simplify ModelContextProtocol.AspNetCore README * Add StreamableHttpHandler * Use "docker info" in CheckIsDockerAvailable * Call WithHttpTransport in samples, tests and README * Cleanup test namespaces * Add CanConnect_WithMcpClient_AfterCustomizingRoute test * Simplify relative URI handling * Handle request made directly to the MapMcp route pattern * Add Messages_FromNewUser_AreRejected test * Fix README * Shorten UserIdClaim ValueTuple names * Remove MaxReconnectAttempts and ReconnectDelay from SseClientTransportOptions - Add proper AdditionalHeaders support
26 lines
654 B
C#
26 lines
654 B
C#
using TestServerWithHosting.Tools;
|
|
using OpenTelemetry.Metrics;
|
|
using OpenTelemetry.Trace;
|
|
using OpenTelemetry;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
builder.Services.AddMcpServer()
|
|
.WithHttpTransport()
|
|
.WithTools<EchoTool>()
|
|
.WithTools<SampleLlmTool>();
|
|
|
|
builder.Services.AddOpenTelemetry()
|
|
.WithTracing(b => b.AddSource("*")
|
|
.AddAspNetCoreInstrumentation()
|
|
.AddHttpClientInstrumentation())
|
|
.WithMetrics(b => b.AddMeter("*")
|
|
.AddAspNetCoreInstrumentation()
|
|
.AddHttpClientInstrumentation())
|
|
.WithLogging()
|
|
.UseOtlpExporter();
|
|
|
|
var app = builder.Build();
|
|
|
|
app.MapMcp();
|
|
|
|
app.Run();
|