Download Source/McpServer.h from RAM2118/pluginbridge: direct link, hf CLI and curl.
- Browser
- Download file 1.24 kB
-
https://huggingface.co/RAM2118/pluginbridge/resolve/2a2323c4e0bcc2fddce057b14befade0a0eccc39/Source/McpServer.h
- Command line
-
hf download hf://RAM2118/pluginbridge@2a2323c4e0bcc2fddce057b14befade0a0eccc39/Source/McpServer.h
-
curl -L -o McpServer.h https://huggingface.co/RAM2118/pluginbridge/resolve/2a2323c4e0bcc2fddce057b14befade0a0eccc39/Source/McpServer.h
1.24 kB
| // Forward declarations | |
| namespace httplib { class Server; } | |
| class HostedPluginManager; | |
| class McpServer | |
| { | |
| public: | |
| McpServer(int port, HostedPluginManager& pluginManager); | |
| ~McpServer(); | |
| void start(); | |
| void stop(); | |
| bool isRunning() const; | |
| int getPort() const { return port; } | |
| private: | |
| void setupRoutes(); | |
| // MCP protocol handlers | |
| std::string handleInitialize(const std::string& requestBody); | |
| std::string handleToolsList(const std::string& requestBody); | |
| std::string handleToolsCall(const std::string& requestBody); | |
| // Tool implementations | |
| std::string toolListPlugins(); | |
| std::string toolSearchParam(const std::string& plugin, const std::string& keyword); | |
| std::string toolGetParams(const std::string& plugin, const std::string& idsJson); | |
| std::string toolSetParams(const std::string& plugin, const std::string& valuesJson); | |
| std::string toolGetAnalysis(); | |
| std::unique_ptr<httplib::Server> server; | |
| std::thread serverThread; | |
| std::atomic<bool> running{false}; | |
| int port; | |
| std::string sessionId; | |
| bool initialized = false; | |
| HostedPluginManager& pluginManager; | |
| }; | |