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
10 changes: 10 additions & 0 deletions pkg/environment/incontainer.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package environment

import "os"

func IsInContainer() bool {
if _, err := os.Stat("/.dockerenv"); err == nil {
return true
}
return false
}
2 changes: 1 addition & 1 deletion pkg/teamloader/teamloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func checkRequiredEnvVars(ctx context.Context, cfg *latest.Config, env environme
}

// Tools
if runtimeConfig.ToolsGateway == "" {
if runtimeConfig.ToolsGateway == "" && !environment.IsInContainer() {
for _, agent := range cfg.Agents {
for i := range agent.Toolsets {
toolSet := agent.Toolsets[i]
Expand Down
11 changes: 11 additions & 0 deletions pkg/tools/mcp/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ func (t *GatewayToolset) Instructions() string {
}

func (t *GatewayToolset) configureOnce(ctx context.Context) error {
if environment.IsInContainer() {
var err error
// TODO(dga): This is very temporary. Make the URL configurable.
t.cmdToolset, err = NewToolsetRemote("http://gateway:8811", "streaming", nil, t.toolFilter)
if err != nil {
return fmt.Errorf("creating remote MCP toolset: %w", err)
}

return nil
}

mcpServerName := gateway.ParseServerRef(t.ref)

// Check which secrets (env vars) are required by the MCP server.
Expand Down