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
This commit is contained in:
Marvin Zhang
2025-03-11 18:18:29 +08:00
parent a95ef95ade
commit 4441df585b

View File

@@ -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
}