From 47cc44f717b7325d51cfadf6f1a607e47e4dbe1f Mon Sep 17 00:00:00 2001 From: hkr04 Date: Mon, 24 Mar 2025 04:25:22 +0800 Subject: [PATCH] fix bugs in passing env variables --- mcp | 2 +- tool/base.h | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/mcp b/mcp index 5e9ff48..3fe1e04 160000 --- a/mcp +++ b/mcp @@ -1 +1 @@ -Subproject commit 5e9ff48b070a11ba20529feb22c68d0e9ef46f3d +Subproject commit 3fe1e049fb877399380df00bbd8db9f42f687ff1 diff --git a/tool/base.h b/tool/base.h index 47b62e6..054c49d 100644 --- a/tool/base.h +++ b/tool/base.h @@ -65,9 +65,8 @@ struct MCPToolConfig { } // Read environment variables - std::string env_section = tool_name + ".env"; - if (data.contains(env_section) && data[env_section].is_table()) { - const auto& env_table = *data[env_section].as_table(); + if (tool_table.contains("env") && tool_table["env"].is_table()) { + const auto& env_table = *tool_table["env"].as_table(); for (const auto& [key, value] : env_table) { if (value.is_string()) { config.env_vars[key] = value.as_string()->get();