Skip to content

Commit 7145062

Browse files
authored
Working sets: resolve server schemas/snapshots and cache them (#213)
* Resolve and cache mcp image schema. * Vendor modules. * Lint fixes. * Export ResolveSnapshot.
1 parent e007143 commit 7145062

File tree

163 files changed

+8529
-1480
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+8529
-1480
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
!/server.go
1212
!/test/servers
1313
!/test/testdata
14+
!/test/mocks

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#syntax=docker/dockerfile:1
22

3-
ARG GO_VERSION=1.24.5
3+
ARG GO_VERSION=1.24.6
44
ARG DOCS_FORMATS="md,yaml"
55

66
FROM --platform=${BUILDPLATFORM} golangci/golangci-lint:v2.1.6-alpine AS lint-base

cmd/docker-mcp/commands/workingset.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import (
88
"github.com/spf13/cobra"
99

1010
"github.com/docker/mcp-gateway/pkg/db"
11+
"github.com/docker/mcp-gateway/pkg/oci"
12+
"github.com/docker/mcp-gateway/pkg/registryapi"
1113
"github.com/docker/mcp-gateway/pkg/workingset"
1214
)
1315

@@ -58,7 +60,9 @@ Working sets are decoupled from catalogs. Servers can be:
5860
if err != nil {
5961
return err
6062
}
61-
return workingset.Create(cmd.Context(), dao, opts.ID, opts.Name, opts.Servers)
63+
registryClient := registryapi.NewClient()
64+
ociService := oci.NewService()
65+
return workingset.Create(cmd.Context(), dao, registryClient, ociService, opts.ID, opts.Name, opts.Servers)
6266
},
6367
}
6468

@@ -135,7 +139,8 @@ func pullWorkingSetCommand() *cobra.Command {
135139
if err != nil {
136140
return err
137141
}
138-
return workingset.Pull(cmd.Context(), dao, args[0])
142+
ociService := oci.NewService()
143+
return workingset.Pull(cmd.Context(), dao, ociService, args[0])
139144
},
140145
}
141146
}
@@ -180,7 +185,8 @@ func importWorkingSetCommand() *cobra.Command {
180185
if err != nil {
181186
return err
182187
}
183-
return workingset.Import(cmd.Context(), dao, args[0])
188+
ociService := oci.NewService()
189+
return workingset.Import(cmd.Context(), dao, ociService, args[0])
184190
},
185191
}
186192
}

go.mod

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module github.com/docker/mcp-gateway
22

3-
go 1.24.4
3+
go 1.24.6
4+
5+
toolchain go1.24.9
46

57
require (
68
github.com/Microsoft/go-winio v0.6.2
@@ -21,19 +23,20 @@ require (
2123
github.com/jmoiron/sqlx v1.4.0
2224
github.com/mikefarah/yq/v4 v4.45.4
2325
github.com/modelcontextprotocol/go-sdk v1.0.0
26+
github.com/modelcontextprotocol/registry v0.0.0-00010101000000-000000000000
2427
github.com/opencontainers/go-digest v1.0.0
2528
github.com/opencontainers/image-spec v1.1.1
2629
github.com/pkg/errors v0.9.1
2730
github.com/sigstore/cosign/v2 v2.5.0
2831
github.com/sigstore/sigstore v1.9.5
2932
github.com/spf13/cobra v1.9.1
3033
github.com/spf13/pflag v1.0.6
31-
github.com/stretchr/testify v1.10.0
32-
go.opentelemetry.io/otel v1.37.0
33-
go.opentelemetry.io/otel/metric v1.37.0
34-
go.opentelemetry.io/otel/sdk v1.36.0
35-
go.opentelemetry.io/otel/sdk/metric v1.36.0
36-
go.opentelemetry.io/otel/trace v1.37.0
34+
github.com/stretchr/testify v1.11.1
35+
go.opentelemetry.io/otel v1.38.0
36+
go.opentelemetry.io/otel/metric v1.38.0
37+
go.opentelemetry.io/otel/sdk v1.38.0
38+
go.opentelemetry.io/otel/sdk/metric v1.38.0
39+
go.opentelemetry.io/otel/trace v1.38.0
3740
golang.org/x/sync v0.17.0
3841
gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473
3942
gopkg.in/yaml.v3 v3.0.1
@@ -90,11 +93,11 @@ require (
9093
github.com/dustin/go-humanize v1.0.1 // indirect
9194
github.com/elliotchance/orderedmap v1.8.0 // indirect
9295
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
93-
github.com/fatih/color v1.18.0 // indirect
96+
github.com/fatih/color v1.18.0
9497
github.com/felixge/httpsnoop v1.0.4 // indirect
9598
github.com/fvbommel/sortorder v1.1.0 // indirect
9699
github.com/go-chi/chi v4.1.2+incompatible // indirect
97-
github.com/go-jose/go-jose/v4 v4.1.0 // indirect
100+
github.com/go-jose/go-jose/v4 v4.1.3 // indirect
98101
github.com/go-logr/logr v1.4.3 // indirect
99102
github.com/go-logr/stdr v1.2.2 // indirect
100103
github.com/go-openapi/analysis v0.23.0 // indirect
@@ -143,7 +146,6 @@ require (
143146
github.com/opentracing/opentracing-go v1.2.0 // indirect
144147
github.com/pelletier/go-toml/v2 v2.2.4
145148
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
146-
github.com/prometheus/client_model v0.6.2 // indirect
147149
github.com/rivo/uniseg v0.4.7 // indirect
148150
github.com/russross/blackfriday/v2 v2.1.0 // indirect
149151
github.com/sagikazarmark/locafero v0.9.0 // indirect
@@ -184,15 +186,17 @@ require (
184186
go.uber.org/zap v1.27.0 // indirect
185187
golang.org/x/crypto v0.42.0 // indirect
186188
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect
187-
golang.org/x/mod v0.27.0 // indirect
189+
golang.org/x/mod v0.29.0 // indirect
188190
golang.org/x/net v0.43.0 // indirect
189191
golang.org/x/sys v0.36.0 // indirect
190192
golang.org/x/term v0.35.0 // indirect
191193
golang.org/x/text v0.29.0 // indirect
192194
google.golang.org/genproto/googleapis/api v0.0.0-20250603155806-513f23925822 // indirect
193195
google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 // indirect
194196
google.golang.org/grpc v1.73.0 // indirect
195-
google.golang.org/protobuf v1.36.6 // indirect
197+
google.golang.org/protobuf v1.36.8 // indirect
196198
gotest.tools/v3 v3.5.2 // indirect
197199
k8s.io/client-go v0.33.1 // indirect
198200
)
201+
202+
replace github.com/modelcontextprotocol/registry => github.com/docker/mcp-community-registry v0.0.0-20251024214917-21000e320421

0 commit comments

Comments
 (0)