From 4441df585b29d5214e107ecb5c92024d6f69033f Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Tue, 11 Mar 2025 18:18:29 +0800 Subject: [PATCH] feat: add MCP server base URL configuration utility Added a new configuration utility function GetMcpServerBaseUrl() to: - Define a default MCP server base URL - Allow custom configuration via Viper - Provide a consistent way to retrieve the MCP server base URL --- core/utils/config.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/utils/config.go b/core/utils/config.go index e5c92eb8..e27b91d3 100644 --- a/core/utils/config.go +++ b/core/utils/config.go @@ -35,6 +35,7 @@ const ( DefaultPyenvPath = "/root/.pyenv" DefaultNodeModulesPath = "/usr/lib/node_modules" DefaultGoPath = "/root/go" + DefaultMcpServerBaseUrl = "http://localhost:9000/sse" ) func IsDev() bool { @@ -285,3 +286,10 @@ func GetGoPath() string { } return DefaultGoPath } + +func GetMcpServerBaseUrl() string { + if res := viper.GetString("mcp.server.base_url"); res != "" { + return res + } + return DefaultMcpServerBaseUrl +}