#pragma once #include #include #include "mcp_plugin_api.h" class mcp_Tools { private: std::unordered_map> m_tools; public: // 注册工具 void Register(std::shared_ptr pTool); // 组装所有工具的描述,返回 JSON 数组 (用于 tools/list) nlohmann::json ToLLM() const; // 路由分发执行指令 (用于 tools/call) nlohmann::json Call(const std::string &name, const nlohmann::json &args); void print(); void clear(); }; class mcp_ConfigParser { public: static bool LoadAndRegister(const std::wstring &jsonFilePath, mcp_Tools ®istry); private: static void LoadDllTool(const nlohmann::json &toolConfig, const std::wstring &pluginDir, mcp_Tools ®istry); };