Skip to content

Commit 39a7421

Browse files
committed
Add IconUrl and Description to McpServerOptionModel
1 parent 2826932 commit 39a7421

File tree

5 files changed

+20
-3
lines changed

5 files changed

+20
-3
lines changed

src/BotSharp.AppHost/Program.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
var apiService = builder.AddProject<Projects.WebStarter>("apiservice")
44
.WithExternalHttpEndpoints();
5-
var mcpService = builder.AddProject<Projects.BotSharp_PizzaBot_MCPServer>("mcpservice")
6-
.WithExternalHttpEndpoints();
75

86
builder.AddNpmApp("BotSharpUI", "../../../BotSharp-UI")
97
.WithReference(apiService)

src/Infrastructure/BotSharp.Abstraction/MCP/Models/McpServerConfigModel.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,21 @@ public class McpServerConfigModel
1212
/// </summary>
1313
public string Name { get; set; } = null!;
1414

15+
/// <summary>
16+
/// Indicates whether this server is enabled.
17+
/// </summary>
18+
public bool Enabled { get; set; } = true;
19+
20+
/// <summary>
21+
/// URL of the icon to display for this server.
22+
/// </summary>
23+
public string? IconUrl { get; set; }
24+
25+
/// <summary>
26+
/// Short description of this server.
27+
/// </summary>
28+
public string? Description { get; set; }
29+
1530
public McpSseServerConfig? SseConfig { get; set; }
1631
public McpStdioServerConfig? StdioConfig { get; set; }
1732
}

src/Infrastructure/BotSharp.Abstraction/MCP/Models/McpServerOptionModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ namespace BotSharp.Abstraction.MCP.Models;
22

33
public class McpServerOptionModel : IdName
44
{
5+
public string? IconUrl { get; set; }
6+
public string? Description { get; set; }
57
public IEnumerable<string> Tools { get; set; } = [];
68

79
public McpServerOptionModel() : base()

src/Infrastructure/BotSharp.Core/MCP/Managers/McpClientManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public McpClientManager(
2222
{
2323
var settings = _services.GetRequiredService<McpSettings>();
2424
var config = settings.McpServerConfigs.Where(x => x.Id == serverId).FirstOrDefault();
25-
if (config == null)
25+
if (config == null || !config.Enabled)
2626
{
2727
return null;
2828
}

src/Infrastructure/BotSharp.Core/MCP/Services/McpService.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ public async Task<IEnumerable<McpServerOptionModel>> GetServerConfigsAsync()
3636
{
3737
Id = config.Id,
3838
Name = config.Name,
39+
IconUrl = config.IconUrl,
40+
Description = config.Description,
3941
Tools = tools.Select(x => x.Name)
4042
});
4143
}

0 commit comments

Comments
 (0)