diff --git a/internal/libs/cfg/cfg.go b/internal/libs/cfg/cfg.go index bdfea995..161c7331 100644 --- a/internal/libs/cfg/cfg.go +++ b/internal/libs/cfg/cfg.go @@ -10,7 +10,8 @@ type Cfg struct { OpenAIAPIKey string JwtSigningKey string - MongoURI string + MongoURI string + XtraMCPURI string } var cfg *Cfg @@ -21,11 +22,20 @@ func GetCfg() *Cfg { OpenAIAPIKey: os.Getenv("OPENAI_API_KEY"), JwtSigningKey: os.Getenv("JWT_SIGNING_KEY"), MongoURI: mongoURI(), + XtraMCPURI: xtraMCPURI(), } return cfg } +func xtraMCPURI() string { + val := os.Getenv("XTRAMCP_URI") + if val != "" { + return val + } + return "http://paperdebugger-xtra-mcp-server.com/mcp" +} + func mongoURI() string { val := os.Getenv("PD_MONGO_URI") if val != "" { diff --git a/internal/services/toolkit/client/client.go b/internal/services/toolkit/client/client.go index 34ca1975..23e253fd 100644 --- a/internal/services/toolkit/client/client.go +++ b/internal/services/toolkit/client/client.go @@ -51,7 +51,7 @@ func NewAIClient( // toolRegistry.Register("greeting", tools.GreetingToolDescription, tools.GreetingTool) // Load tools dynamically from backend - xtraMCPLoader := xtramcp.NewXtraMCPLoader(db, projectService, "http://paperdebugger-xtra-mcp-server.com/mcp") + xtraMCPLoader := xtramcp.NewXtraMCPLoader(db, projectService, cfg.XtraMCPURI) // initialize MCP session first and log session ID sessionID, err := xtraMCPLoader.InitializeMCP()