Skip to content

Commit 578dc3d

Browse files
committed
Handle additional tool yaml config files and fix panic
1 parent 0144622 commit 578dc3d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

cmd/docker-mcp/commands/gateway.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ func gatewayCommand(docker docker.Client) *cobra.Command {
2222
var additionalCatalogs []string
2323
var additionalRegistries []string
2424
var additionalConfigs []string
25+
var additionalToolsConfig []string
2526
if os.Getenv("DOCKER_MCP_IN_CONTAINER") == "1" {
2627
// In-container.
2728
options = gateway.Config{
@@ -82,6 +83,7 @@ func gatewayCommand(docker docker.Client) *cobra.Command {
8283
options.CatalogPath = append(options.CatalogPath, additionalCatalogs...)
8384
options.RegistryPath = append(options.RegistryPath, additionalRegistries...)
8485
options.ConfigPath = append(options.ConfigPath, additionalConfigs...)
86+
options.ToolsPath = append(options.ToolsPath, additionalToolsConfig...)
8587

8688
return gateway.NewGateway(options, docker).Run(cmd.Context())
8789
},

cmd/docker-mcp/internal/gateway/configuration.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,9 @@ func (c *FileBasedConfiguration) readToolsConfig(ctx context.Context) (config.To
359359
return config.ToolsConfig{}, nil
360360
}
361361

362-
mergedToolsConfig := config.ToolsConfig{}
362+
mergedToolsConfig := config.ToolsConfig{
363+
ServerTools: make(map[string][]string),
364+
}
363365

364366
for _, toolsPath := range c.ToolsPath {
365367
if toolsPath == "" {

0 commit comments

Comments
 (0)