Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion internal/libs/cfg/cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ type Cfg struct {
OpenAIAPIKey string
JwtSigningKey string

MongoURI string
MongoURI string
XtraMCPURI string
}

var cfg *Cfg
Expand All @@ -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 != "" {
Expand Down
2 changes: 1 addition & 1 deletion internal/services/toolkit/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading