Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com>
28 lines
691 B
C#
28 lines
691 B
C#
using Elicitation.Tools;
|
|
using ModelContextProtocol.AspNetCore;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
// Add services to the container.
|
|
|
|
builder.Services.AddMcpServer()
|
|
.WithHttpTransport(options =>
|
|
{
|
|
// Elicitation requires stateful mode because it sends server-to-client requests.
|
|
// Set SessionMode = HttpServerSessionMode.Stateful since it's required.
|
|
options.SessionMode = HttpServerSessionMode.Stateful;
|
|
})
|
|
.WithTools<InteractiveTools>();
|
|
|
|
builder.Logging.AddConsole(options =>
|
|
{
|
|
options.LogToStandardErrorThreshold = LogLevel.Information;
|
|
});
|
|
|
|
var app = builder.Build();
|
|
|
|
app.UseHttpsRedirection();
|
|
|
|
app.MapMcp();
|
|
|
|
app.Run();
|