22 lines
704 B
C#
22 lines
704 B
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Hosting;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
var builder = Host.CreateApplicationBuilder(args);
|
|
|
|
// MCP stdio requires stdout to contain JSON-RPC messages only. Route every
|
|
// Microsoft logger event to stderr so it cannot corrupt the protocol stream.
|
|
builder.Logging.ClearProviders();
|
|
builder.Logging.AddConsole(options => options.LogToStandardErrorThreshold = LogLevel.Trace);
|
|
|
|
builder.Services
|
|
.AddMcpServer()
|
|
.WithStdioServerTransport()
|
|
.WithTools<PepTools>();
|
|
|
|
var app = builder.Build();
|
|
|
|
PepTools.LaserQuoteBaseUrl = builder.Configuration["LaserQuoteBaseUrl"] ?? "http://localhost:5260";
|
|
|
|
await app.RunAsync();
|