Добавлен модуль Kubernetes MCP с DI и диагностикой ошибок
This commit is contained in:
@@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user