22 lines
556 B
C#
22 lines
556 B
C#
using BotSharp.Abstraction.MCP.Models;
|
|
using BotSharp.Abstraction.MCP.Services;
|
|
|
|
namespace BotSharp.OpenAPI.Controllers;
|
|
|
|
public class McpController : ControllerBase
|
|
{
|
|
private readonly IServiceProvider _services;
|
|
|
|
public McpController(IServiceProvider services)
|
|
{
|
|
_services = services;
|
|
}
|
|
|
|
[HttpGet("/mcp/server-configs")]
|
|
public async Task<IEnumerable<McpServerOptionModel>> GetMcpServerConfigs()
|
|
{
|
|
var mcp = _services.GetRequiredService<IMcpService>();
|
|
return await mcp.GetServerConfigsAsync();
|
|
}
|
|
}
|