Skip to content

Commit 46f2599

Browse files
committed
wip
1 parent 7f5fd83 commit 46f2599

File tree

4 files changed

+28
-14
lines changed

4 files changed

+28
-14
lines changed

cmd/docker-mcp/commands/gateway.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ func gatewayCommand(docker docker.Client, dockerCli command.Cli) *cobra.Command
138138
}
139139

140140
// Set server names from the working-set
141+
// These are treated as server references (can be OCI image refs or catalog names)
142+
// and will go through the self-contained catalog resolution
141143
options.ServerNames = ws.Servers
142144
}
143145

cmd/docker-mcp/commands/working-set.go

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,29 @@ func createWorkingSetCommand() *cobra.Command {
2828
Servers []string
2929
}
3030
cmd := &cobra.Command{
31-
Use: "create --name <name> [--description <description>] --server <server1> --server <server2> ...",
31+
Use: "create --name <name> [--description <description>] --server <ref1> --server <ref2> ...",
3232
Short: "Create a new working-set of MCP servers",
3333
Long: `Create a new working-set that groups multiple MCP servers together.
34-
A working-set allows you to organize and manage related servers as a single unit.`,
35-
Example: ` # Create a working-set with multiple servers
36-
docker mcp working-set create --name dev-tools --description "Development tools" --server github --server slack
34+
A working-set allows you to organize and manage related servers as a single unit.
35+
Working-sets are decoupled from catalogs. Servers can be:
36+
- Catalog server names (e.g., "github", "docker")
37+
- OCI image references with docker:// prefix (e.g., "docker://mcp/github:latest")`,
38+
Example: ` # Create a working-set with multiple servers (OCI references)
39+
docker mcp working-set create --name dev-tools --description "Development tools" --server docker://mcp/github:latest --server docker://mcp/slack:latest
3740
38-
# Create a working-set with a single server
39-
docker mcp working-set create --name docker-only --server docker`,
41+
# Create a working-set with catalog server names
42+
docker mcp working-set create --name catalog-servers --server github --server docker
43+
44+
# Mix catalog names and OCI references
45+
docker mcp working-set create --name mixed --server github --server docker://custom/server:v1`,
4046
RunE: func(cmd *cobra.Command, args []string) error {
4147
return workingset.Create(opts.Name, opts.Description, opts.Servers)
4248
},
4349
}
4450
flags := cmd.Flags()
4551
flags.StringVar(&opts.Name, "name", "", "Name of the working-set (required)")
4652
flags.StringVar(&opts.Description, "description", "", "Description of the working-set")
47-
flags.StringArrayVar(&opts.Servers, "server", []string{}, "Server to include in the working-set (can be specified multiple times)")
53+
flags.StringArrayVar(&opts.Servers, "server", []string{}, "Server to include: catalog name or OCI reference with docker:// prefix (can be specified multiple times)")
4854

4955
_ = cmd.MarkFlagRequired("name")
5056
_ = cmd.MarkFlagRequired("server")

cmd/docker-mcp/working-set/list.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ func SupportedFormats() string {
4848

4949
// WorkingSetListMetadata contains summary info about a working-set (excluding full server list)
5050
type WorkingSetListMetadata struct {
51-
Description string `json:"description,omitempty" yaml:"description,omitempty"`
52-
ServerCount int `json:"serverCount" yaml:"serverCount"`
51+
Description string `json:"description,omitempty" yaml:"description,omitempty"`
52+
ServerCount int `json:"serverCount" yaml:"serverCount"`
5353
}
5454

5555
type ListOutput struct {

pkg/oci/self_contained.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,19 @@ func SelfContainedCatalog(ctx context.Context, dockerClient docker.Client, serve
3030
}
3131

3232
metadataLabel, exists := inspect.Config.Labels["io.docker.server.metadata"]
33-
if !exists {
34-
return catalog.Catalog{}, nil, fmt.Errorf("server name %s looks like an OCI ref but is missing the io.docker.server.metadata label", serverName)
35-
}
3633

3734
var server catalog.Server
38-
if err := yaml.Unmarshal([]byte(metadataLabel), &server); err != nil {
39-
return catalog.Catalog{}, nil, fmt.Errorf("failed to parse metadata label for %s: %w", serverName, err)
35+
if exists {
36+
// If metadata label exists, parse it for full server configuration
37+
if err := yaml.Unmarshal([]byte(metadataLabel), &server); err != nil {
38+
return catalog.Catalog{}, nil, fmt.Errorf("failed to parse metadata label for %s: %w", serverName, err)
39+
}
40+
} else {
41+
// If no metadata label, create a minimal server entry with just the image
42+
// This allows plain MCP server images to work without requiring the label
43+
server = catalog.Server{
44+
Type: "server",
45+
}
4046
}
4147

4248
server.Image = ociRef

0 commit comments

Comments
 (0)