From 129331d4885e2234dd8c05844ffb53a25fff7bc5 Mon Sep 17 00:00:00 2001 From: geffzhang Date: Sat, 22 Mar 2025 09:59:42 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=20remove=20ModelContextProtocol?= =?UTF-8?q?=20source=20ref?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use ModelContextProtocol nuget package replace source ref --- BotSharp.sln | 11 ---------- Directory.Packages.props | 2 +- .../BotSharp.MCP/BotSharp.MCP.csproj | 2 +- .../Models/AgentMCPToolMongoElement.cs | 22 ------------------- .../Repository/MongoRepository.Agent.cs | 4 ++-- .../BotSharp.PizzaBot.MCPServer.csproj | 5 +---- 6 files changed, 5 insertions(+), 41 deletions(-) diff --git a/BotSharp.sln b/BotSharp.sln index 919e630d..53eb3da9 100644 --- a/BotSharp.sln +++ b/BotSharp.sln @@ -133,8 +133,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BotSharp.Core.Realtime", "s EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BotSharp.PizzaBot.MCPServer", "tests\BotSharp.PizzaBot.MCPServer\BotSharp.PizzaBot.MCPServer.csproj", "{8D2AD45F-836A-516F-DE6A-71443CEBB18A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModelContextProtocol", "..\Ai4c\mcpcsharp-sdk\src\ModelContextProtocol\ModelContextProtocol.csproj", "{13E4F06A-D4F2-49FA-E979-DE3937137579}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -551,14 +549,6 @@ Global {8D2AD45F-836A-516F-DE6A-71443CEBB18A}.Release|Any CPU.Build.0 = Release|Any CPU {8D2AD45F-836A-516F-DE6A-71443CEBB18A}.Release|x64.ActiveCfg = Release|Any CPU {8D2AD45F-836A-516F-DE6A-71443CEBB18A}.Release|x64.Build.0 = Release|Any CPU - {13E4F06A-D4F2-49FA-E979-DE3937137579}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {13E4F06A-D4F2-49FA-E979-DE3937137579}.Debug|Any CPU.Build.0 = Debug|Any CPU - {13E4F06A-D4F2-49FA-E979-DE3937137579}.Debug|x64.ActiveCfg = Debug|Any CPU - {13E4F06A-D4F2-49FA-E979-DE3937137579}.Debug|x64.Build.0 = Debug|Any CPU - {13E4F06A-D4F2-49FA-E979-DE3937137579}.Release|Any CPU.ActiveCfg = Release|Any CPU - {13E4F06A-D4F2-49FA-E979-DE3937137579}.Release|Any CPU.Build.0 = Release|Any CPU - {13E4F06A-D4F2-49FA-E979-DE3937137579}.Release|x64.ActiveCfg = Release|Any CPU - {13E4F06A-D4F2-49FA-E979-DE3937137579}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -623,7 +613,6 @@ Global {684781D5-3DD4-6A0B-B53F-0A362CD6BB0C} = {E29DC6C4-5E57-48C5-BCB0-6B8F84782749} {781F1465-365C-0F22-1775-25025DAFA4C7} = {E29DC6C4-5E57-48C5-BCB0-6B8F84782749} {8D2AD45F-836A-516F-DE6A-71443CEBB18A} = {32FAFFFE-A4CB-4FEE-BF7C-84518BBC6DCC} - {13E4F06A-D4F2-49FA-E979-DE3937137579} = {E29DC6C4-5E57-48C5-BCB0-6B8F84782749} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {A9969D89-C98B-40A5-A12B-FC87E55B3A19} diff --git a/Directory.Packages.props b/Directory.Packages.props index d5b26f7e..b8dcde9c 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -111,7 +111,7 @@ - + diff --git a/src/Infrastructure/BotSharp.MCP/BotSharp.MCP.csproj b/src/Infrastructure/BotSharp.MCP/BotSharp.MCP.csproj index dff1c73b..94aba37c 100644 --- a/src/Infrastructure/BotSharp.MCP/BotSharp.MCP.csproj +++ b/src/Infrastructure/BotSharp.MCP/BotSharp.MCP.csproj @@ -9,11 +9,11 @@ + - diff --git a/src/Plugins/BotSharp.Plugin.MongoStorage/Models/AgentMCPToolMongoElement.cs b/src/Plugins/BotSharp.Plugin.MongoStorage/Models/AgentMCPToolMongoElement.cs index ecad71f3..614683c3 100644 --- a/src/Plugins/BotSharp.Plugin.MongoStorage/Models/AgentMCPToolMongoElement.cs +++ b/src/Plugins/BotSharp.Plugin.MongoStorage/Models/AgentMCPToolMongoElement.cs @@ -1,9 +1,4 @@ using BotSharp.Abstraction.Agents.Models; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BotSharp.Plugin.MongoStorage.Models; @@ -16,7 +11,6 @@ public class AgentMCPToolMongoElement public bool Disabled { get; set; } public List Functions { get; set; } = []; - public List Templates { get; set; } = []; public static AgentMCPToolMongoElement ToMongoElement(MCPTool utility) { @@ -51,19 +45,3 @@ public class McpFunctionMongoElement Name = name; } } - -public class McpTemplateMongoElement -{ - public string Name { get; set; } - - public McpTemplateMongoElement() - { - - } - - public McpTemplateMongoElement(string name) - { - Name = name; - } -} - diff --git a/src/Plugins/BotSharp.Plugin.MongoStorage/Repository/MongoRepository.Agent.cs b/src/Plugins/BotSharp.Plugin.MongoStorage/Repository/MongoRepository.Agent.cs index de13a2d3..2f31257f 100644 --- a/src/Plugins/BotSharp.Plugin.MongoStorage/Repository/MongoRepository.Agent.cs +++ b/src/Plugins/BotSharp.Plugin.MongoStorage/Repository/MongoRepository.Agent.cs @@ -62,7 +62,7 @@ public partial class MongoRepository UpdateAgentUtilities(agent.Id, agent.MergeUtility, agent.Utilities); break; case AgentField.McpTool: - UpdateAgentMcps(agent.Id, agent.McpTools); + UpdateAgentMcpTools(agent.Id, agent.McpTools); break; case AgentField.KnowledgeBase: UpdateAgentKnowledgeBases(agent.Id, agent.KnowledgeBases); @@ -264,7 +264,7 @@ public partial class MongoRepository _dc.Agents.UpdateOne(filter, update); } - private void UpdateAgentMcps(string agentId, List mcps) + private void UpdateAgentMcpTools(string agentId, List mcps) { if (mcps == null) return; diff --git a/tests/BotSharp.PizzaBot.MCPServer/BotSharp.PizzaBot.MCPServer.csproj b/tests/BotSharp.PizzaBot.MCPServer/BotSharp.PizzaBot.MCPServer.csproj index 41800784..319f10a1 100644 --- a/tests/BotSharp.PizzaBot.MCPServer/BotSharp.PizzaBot.MCPServer.csproj +++ b/tests/BotSharp.PizzaBot.MCPServer/BotSharp.PizzaBot.MCPServer.csproj @@ -9,11 +9,8 @@ + - - - -