Skip to content

Commit 06f8231

Browse files
committed
Simpler code to replace prompts
Signed-off-by: David Gageot <[email protected]>
1 parent ede5de3 commit 06f8231

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ func (g *Gateway) Run(ctx context.Context) error {
121121
)
122122

123123
current := capabilities
124-
mcpServer.AddTools(current.Tools...)
125-
mcpServer.AddPrompts(current.Prompts...)
124+
mcpServer.SetTools(current.Tools...)
125+
mcpServer.SetPrompts(current.Prompts...)
126126
mcpServer.AddResources(current.Resources...)
127127
for _, v := range current.ResourceTemplates {
128128
mcpServer.AddResourceTemplate(v.ResourceTemplate, v.Handler)
@@ -131,8 +131,7 @@ func (g *Gateway) Run(ctx context.Context) error {
131131
lock.Lock()
132132
changeListeners = append(changeListeners, func(newConfig *Capabilities) {
133133
mcpServer.SetTools(newConfig.Tools...)
134-
mcpServer.DeletePrompts(current.PromptNames()...)
135-
mcpServer.AddPrompts(newConfig.Prompts...)
134+
mcpServer.SetPrompts(newConfig.Prompts...)
136135

137136
// TODO: sync other things than tools
138137

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module github.com/docker/mcp-gateway
22

33
go 1.24.4
44

5-
replace github.com/mark3labs/mcp-go => github.com/dgageot/mcp-go v0.0.0-20250722130225-9209f9178429
5+
replace github.com/mark3labs/mcp-go => github.com/dgageot/mcp-go v0.0.0-20250722181725-fc67445a7583
66

77
require (
88
github.com/Microsoft/go-winio v0.6.2

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
207207
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
208208
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
209209
github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
210-
github.com/dgageot/mcp-go v0.0.0-20250722130225-9209f9178429 h1:OClgozYooiB9f2ROkva7dmeIeCtMVq6QFnNBcQ/vUt8=
211-
github.com/dgageot/mcp-go v0.0.0-20250722130225-9209f9178429/go.mod h1:rXqOudj/djTORU/ThxYx8fqEVj/5pvTuuebQ2RC7uk4=
210+
github.com/dgageot/mcp-go v0.0.0-20250722181725-fc67445a7583 h1:+EwIeDJNjdY0mSkhv5Yv6jjWARo+treRDOCQhVyTEes=
211+
github.com/dgageot/mcp-go v0.0.0-20250722181725-fc67445a7583/go.mod h1:rXqOudj/djTORU/ThxYx8fqEVj/5pvTuuebQ2RC7uk4=
212212
github.com/digitorus/pkcs7 v0.0.0-20230713084857-e76b763bdc49/go.mod h1:SKVExuS+vpu2l9IoOc0RwqE7NYnb0JlcFHFnEJkVDzc=
213213
github.com/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352 h1:ge14PCmCvPjpMQMIAH7uKg0lrtNSOdpYsRXlwk3QbaE=
214214
github.com/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352/go.mod h1:SKVExuS+vpu2l9IoOc0RwqE7NYnb0JlcFHFnEJkVDzc=

vendor/github.com/mark3labs/mcp-go/server/server.go

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ github.com/magiconair/properties
362362
github.com/mailru/easyjson/buffer
363363
github.com/mailru/easyjson/jlexer
364364
github.com/mailru/easyjson/jwriter
365-
# github.com/mark3labs/mcp-go v0.34.0 => github.com/dgageot/mcp-go v0.0.0-20250722130225-9209f9178429
365+
# github.com/mark3labs/mcp-go v0.34.0 => github.com/dgageot/mcp-go v0.0.0-20250722181725-fc67445a7583
366366
## explicit; go 1.23
367367
github.com/mark3labs/mcp-go/client
368368
github.com/mark3labs/mcp-go/client/transport
@@ -947,4 +947,4 @@ gopkg.in/yaml.v3
947947
## explicit; go 1.17
948948
# k8s.io/client-go v0.33.1
949949
## explicit; go 1.24.0
950-
# github.com/mark3labs/mcp-go => github.com/dgageot/mcp-go v0.0.0-20250722130225-9209f9178429
950+
# github.com/mark3labs/mcp-go => github.com/dgageot/mcp-go v0.0.0-20250722181725-fc67445a7583

0 commit comments

Comments
 (0)