Files
LazyBearWorks/LazyBear.MCP/Program.cs

31 lines
890 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using ModelContextProtocol.Server;
using System.ComponentModel;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddMcpServer()
.WithHttpTransport()
.WithToolsFromAssembly();
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";
}
}