Добавлен модуль Kubernetes MCP с DI и диагностикой ошибок

This commit is contained in:
2026-04-12 23:12:24 +03:00
parent cdbb2110c9
commit ca20a4e7d4
9 changed files with 818 additions and 17 deletions

View File

@@ -1,8 +1,10 @@
using LazyBear.MCP.Services.Kubernetes;
using ModelContextProtocol.Server;
using System.ComponentModel;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSingleton<K8sClientProvider>();
builder.Services.AddMcpServer()
.WithHttpTransport()
.WithToolsFromAssembly();
@@ -12,19 +14,3 @@ var app = builder.Build();
app.MapMcp();
app.Run("http://localhost:5000");
[McpServerToolType]
public static class TradingTools
{
[McpServerTool, Description("Получить текущую цену актива")]
public static string GetCurrentPrice([Description("Тикер актива")] string ticker)
{
return $"Цена {ticker}: 50000 USD (фейковые данные)";
}
[McpServerTool, Description("Получить информацию о позиции")]
public static string GetPositionInfo([Description("ID позиции")] string positionId)
{
return $"Позиция {positionId}: Long BTC, PnL: +500 USD";
}
}