Re-implementation of C# interceptors SDK with clearer focus on server-side / gateway interceptors. Fixes a lot of issues with the existing implementation. Still more boilerplate than I'm happy with, but this is better than what was there. Will refine further in later PRs.
13 lines
385 B
C#
13 lines
385 B
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Hosting;
|
|
using ModelContextProtocol.Interceptors;
|
|
using ModelContextProtocol.Interceptors.Server;
|
|
|
|
var builder = Host.CreateApplicationBuilder(args);
|
|
|
|
builder.Services.AddMcpServer()
|
|
.WithStdioServerTransport()
|
|
.WithInterceptors<SampleInterceptors>();
|
|
|
|
var app = builder.Build();
|
|
await app.RunAsync();
|