@@ -17,21 +17,21 @@ import (
17
17
)
18
18
19
19
type ServerSessionCache struct {
20
- Roots []* mcp.Root
20
+ Roots []* mcp.Root
21
21
}
22
22
23
- type SubsAction int
23
+ // type SubsAction int
24
24
25
- const (
26
- subscribe SubsAction = 0
27
- unsubscribe SubsAction = 1
28
- )
25
+ // const (
26
+ // subscribe SubsAction = 0
27
+ // unsubscribe SubsAction = 1
28
+ // )
29
29
30
- type SubsMessage struct {
31
- uri string
32
- action SubsAction
33
- ss * mcp.ServerSession
34
- }
30
+ // type SubsMessage struct {
31
+ // uri string
32
+ // action SubsAction
33
+ // ss *mcp.ServerSession
34
+ // }
35
35
36
36
type Gateway struct {
37
37
Options
@@ -40,7 +40,7 @@ type Gateway struct {
40
40
clientPool * clientPool
41
41
mcpServer * mcp.Server
42
42
health health.State
43
- subsChannel chan SubsMessage
43
+ // subsChannel chan SubsMessage
44
44
45
45
sessionCacheMu sync.RWMutex
46
46
sessionCache map [* mcp.ServerSession ]* ServerSessionCache
@@ -63,7 +63,6 @@ func NewGateway(config Config, docker docker.Client) *Gateway {
63
63
},
64
64
clientPool : newClientPool (config .Options , docker ),
65
65
sessionCache : make (map [* mcp.ServerSession ]* ServerSessionCache ),
66
- subsChannel : make (chan SubsMessage , 10 ),
67
66
}
68
67
}
69
68
@@ -113,26 +112,26 @@ func (g *Gateway) Run(ctx context.Context) error {
113
112
Name : "Docker AI MCP Gateway" ,
114
113
Version : "2.0.1" ,
115
114
}, & mcp.ServerOptions {
116
- SubscribeHandler : func (ctx context.Context , ss * mcp.ServerSession , params * mcp.SubscribeParams ) error {
115
+ SubscribeHandler : func (_ context.Context , _ * mcp.ServerSession , params * mcp.SubscribeParams ) error {
117
116
log ("- Client subscribed to URI:" , params .URI )
118
117
// The MCP SDK doesn't provide ServerSession in SubscribeHandler because it already
119
118
// keeps track of the mapping between ServerSession and subscribed resources in the Server
120
119
// g.subsChannel <- SubsMessage{uri: params.URI, action: subscribe , ss: ss}
121
120
return nil
122
121
},
123
- UnsubscribeHandler : func (ctx context.Context , ss * mcp.ServerSession , params * mcp.UnsubscribeParams ) error {
122
+ UnsubscribeHandler : func (_ context.Context , _ * mcp.ServerSession , params * mcp.UnsubscribeParams ) error {
124
123
log ("- Client unsubscribed from URI:" , params .URI )
125
124
// The MCP SDK doesn't provide ServerSession in UnsubscribeHandler because it already
126
125
// keeps track of the mapping ServerSession and subscribed resources in the Server
127
126
// g.subsChannel <- SubsMessage{uri: params.URI, action: unsubscribe , ss: ss}
128
127
return nil
129
128
},
130
- RootsListChangedHandler : func (ctx context.Context , ss * mcp.ServerSession , params * mcp.RootsListChangedParams ) {
129
+ RootsListChangedHandler : func (ctx context.Context , ss * mcp.ServerSession , _ * mcp.RootsListChangedParams ) {
131
130
log ("- Client roots list changed: " , ss .ID ())
132
131
g .ListRoots (ctx , ss )
133
132
},
134
133
CompletionHandler : nil ,
135
- InitializedHandler : func (ctx context.Context , ss * mcp.ServerSession , params * mcp.InitializedParams ) {
134
+ InitializedHandler : func (ctx context.Context , ss * mcp.ServerSession , _ * mcp.InitializedParams ) {
136
135
log ("- Client initialized: " , ss .ID ())
137
136
g .ListRoots (ctx , ss )
138
137
},
0 commit comments