RAM2118 commited on
Commit
db82307
·
verified ·
1 Parent(s): b520f82

Sprint 2: Update McpServer.h \u2014 add HostedPluginManager reference

Browse files
Files changed (1) hide show
  1. Source/McpServer.h +15 -5
Source/McpServer.h CHANGED
@@ -3,14 +3,16 @@
3
  #include <thread>
4
  #include <atomic>
5
  #include <string>
 
6
 
7
- // Forward declare to avoid httplib.h in header (speeds up compilation)
8
  namespace httplib { class Server; }
 
9
 
10
  class McpServer
11
  {
12
  public:
13
- explicit McpServer(int port = 16620);
14
  ~McpServer();
15
 
16
  void start();
@@ -20,17 +22,25 @@ public:
20
 
21
  private:
22
  void setupRoutes();
23
- void serverThreadFunc();
24
 
25
- // Tool handlers (return JSON string responses)
26
  std::string handleInitialize(const std::string& requestBody);
27
- std::string handleToolsList();
28
  std::string handleToolsCall(const std::string& requestBody);
29
 
 
 
 
 
 
 
 
30
  std::unique_ptr<httplib::Server> server;
31
  std::thread serverThread;
32
  std::atomic<bool> running{false};
33
  int port;
34
  std::string sessionId;
35
  bool initialized = false;
 
 
36
  };
 
3
  #include <thread>
4
  #include <atomic>
5
  #include <string>
6
+ #include <memory>
7
 
8
+ // Forward declarations
9
  namespace httplib { class Server; }
10
+ class HostedPluginManager;
11
 
12
  class McpServer
13
  {
14
  public:
15
+ McpServer(int port, HostedPluginManager& pluginManager);
16
  ~McpServer();
17
 
18
  void start();
 
22
 
23
  private:
24
  void setupRoutes();
 
25
 
26
+ // MCP protocol handlers
27
  std::string handleInitialize(const std::string& requestBody);
28
+ std::string handleToolsList(const std::string& requestBody);
29
  std::string handleToolsCall(const std::string& requestBody);
30
 
31
+ // Tool implementations
32
+ std::string toolListPlugins();
33
+ std::string toolSearchParam(const std::string& plugin, const std::string& keyword);
34
+ std::string toolGetParams(const std::string& plugin, const std::string& idsJson);
35
+ std::string toolSetParams(const std::string& plugin, const std::string& valuesJson);
36
+ std::string toolGetAnalysis();
37
+
38
  std::unique_ptr<httplib::Server> server;
39
  std::thread serverThread;
40
  std::atomic<bool> running{false};
41
  int port;
42
  std::string sessionId;
43
  bool initialized = false;
44
+
45
+ HostedPluginManager& pluginManager;
46
  };