Download Source/McpServer.h from RAM2118/pluginbridge: direct link, hf CLI and curl.
- Browser
- Download file 839 Bytes
-
https://huggingface.co/RAM2118/pluginbridge/resolve/e99e9f97e97304dfd53cbc1ec4634ede3563ffb9/Source/McpServer.h
- Command line
-
hf download hf://RAM2118/pluginbridge@e99e9f97e97304dfd53cbc1ec4634ede3563ffb9/Source/McpServer.h
-
curl -L -o McpServer.h https://huggingface.co/RAM2118/pluginbridge/resolve/e99e9f97e97304dfd53cbc1ec4634ede3563ffb9/Source/McpServer.h
839 Bytes
| // Forward declare to avoid httplib.h in header (speeds up compilation) | |
| namespace httplib { class Server; } | |
| class McpServer | |
| { | |
| public: | |
| explicit McpServer(int port = 16620); | |
| ~McpServer(); | |
| void start(); | |
| void stop(); | |
| bool isRunning() const; | |
| int getPort() const { return port; } | |
| private: | |
| void setupRoutes(); | |
| void serverThreadFunc(); | |
| // Tool handlers (return JSON string responses) | |
| std::string handleInitialize(const std::string& requestBody); | |
| std::string handleToolsList(); | |
| std::string handleToolsCall(const std::string& requestBody); | |
| std::unique_ptr<httplib::Server> server; | |
| std::thread serverThread; | |
| std::atomic<bool> running{false}; | |
| int port; | |
| std::string sessionId; | |
| bool initialized = false; | |
| }; | |