server: add initial tool isolation support (via docker)

This commit is contained in:
Xuan Son Nguyen
2026-08-03 11:48:06 +02:00
parent f2b52a87e8
commit 2cc28a7179
10 changed files with 490 additions and 73 deletions
+10 -1
View File
@@ -30,6 +30,8 @@ struct server_tool {
json to_json() const;
};
struct server_tools_docker_runtime; // impl detail, defined in server-tools.cpp
struct server_tools {
std::vector<std::unique_ptr<server_tool>> tools;
@@ -37,9 +39,16 @@ struct server_tools {
server_response queue_res;
std::atomic<int> res_id{0};
// set when --tools-runtime is configured; owns the docker container used to run tools, if any
std::unique_ptr<server_tools_docker_runtime> docker_runtime;
void setup(const std::vector<std::string> & enabled_tools,
server_mcp & mcp_mgr);
server_mcp & mcp_mgr,
const std::string & tools_runtime);
server_http_context::handler_t handle_get;
server_http_context::handler_t handle_post;
server_tools();
~server_tools();
};