Replace direct EF Core/DbContext usage in MCP tools with HTTP calls to the CutList.Web REST API via new ApiClient. Removes CutList.Web project reference from MCP, adds Microsoft.Extensions.Http instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
21 lines
534 B
C#
21 lines
534 B
C#
using CutList.Mcp;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Hosting;
|
|
using ModelContextProtocol.Server;
|
|
|
|
var builder = Host.CreateApplicationBuilder(args);
|
|
|
|
// Register HttpClient for API calls to CutList.Web
|
|
builder.Services.AddHttpClient<ApiClient>(client =>
|
|
{
|
|
client.BaseAddress = new Uri("http://localhost:5009");
|
|
});
|
|
|
|
builder.Services
|
|
.AddMcpServer()
|
|
.WithStdioServerTransport()
|
|
.WithToolsFromAssembly(typeof(Program).Assembly);
|
|
|
|
var app = builder.Build();
|
|
await app.RunAsync();
|