Skip to content

Commit fffea27

Browse files
make linter happy
1 parent da02a28 commit fffea27

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func getClientConfig(readOnlyHint *bool, ss *mcp.ServerSession) *clientConfig {
1313
}
1414

1515
func (g *Gateway) mcpToolHandler(tool catalog.Tool) mcp.ToolHandler {
16-
return func(ctx context.Context, ss *mcp.ServerSession, params *mcp.CallToolParamsFor[map[string]any]) (*mcp.CallToolResultFor[any], error) {
16+
return func(ctx context.Context, _ *mcp.ServerSession, params *mcp.CallToolParamsFor[map[string]any]) (*mcp.CallToolResultFor[any], error) {
1717
// Convert to the generic version for our internal methods
1818
genericParams := &mcp.CallToolParams{
1919
Meta: params.Meta,

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ import (
88
"strings"
99
"sync"
1010

11-
"github.com/docker/mcp-gateway/cmd/docker-mcp/internal/health"
1211
"github.com/modelcontextprotocol/go-sdk/mcp"
12+
13+
"github.com/docker/mcp-gateway/cmd/docker-mcp/internal/health"
1314
)
1415

15-
func (g *Gateway) startStdioServer(ctx context.Context, stdin io.Reader, stdout io.Writer) error {
16+
func (g *Gateway) startStdioServer(ctx context.Context, _ io.Reader, _ io.Writer) error {
1617
transport := mcp.NewStdioTransport()
1718
_, err := g.mcpServer.Connect(ctx, transport)
1819
if err != nil {
@@ -25,7 +26,7 @@ func (g *Gateway) startSseServer(ctx context.Context, ln net.Listener) error {
2526
mux := http.NewServeMux()
2627
mux.Handle("/health", healthHandler(&g.health))
2728
mux.Handle("/", redirectHandler("/sse"))
28-
sseHandler := mcp.NewSSEHandler(func(request *http.Request) *mcp.Server {
29+
sseHandler := mcp.NewSSEHandler(func(_ *http.Request) *mcp.Server {
2930
return g.mcpServer
3031
})
3132
mux.Handle("/sse", sseHandler)
@@ -43,7 +44,7 @@ func (g *Gateway) startStreamingServer(ctx context.Context, ln net.Listener) err
4344
mux := http.NewServeMux()
4445
mux.Handle("/health", healthHandler(&g.health))
4546
mux.Handle("/", redirectHandler("/mcp"))
46-
streamHandler := mcp.NewStreamableHTTPHandler(func(request *http.Request) *mcp.Server {
47+
streamHandler := mcp.NewStreamableHTTPHandler(func(_ *http.Request) *mcp.Server {
4748
return g.mcpServer
4849
}, nil)
4950
mux.Handle("/mcp", streamHandler)
@@ -83,7 +84,7 @@ func (g *Gateway) startCentralStreamingServer(ctx context.Context, ln net.Listen
8384
_, _ = io.WriteString(w, "Failed to reload configuration")
8485
return
8586
}
86-
handler = mcp.NewStreamableHTTPHandler(func(request *http.Request) *mcp.Server {
87+
handler = mcp.NewStreamableHTTPHandler(func(_ *http.Request) *mcp.Server {
8788
return g.mcpServer
8889
}, nil)
8990
handlersPerSelectionOfServers[serverNames] = handler

cmd/docker-mcp/internal/interceptors/block_secrets.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ func BlockSecretsMiddleware() mcp.Middleware[*mcp.ServerSession] {
5757
var callResult mcp.CallToolResult
5858
if err := json.Unmarshal(jsonData, &callResult); err == nil {
5959
for _, content := range callResult.Content {
60-
switch c := content.(type) {
61-
case *mcp.TextContent:
60+
if c, ok := content.(*mcp.TextContent); ok {
6261
contents += c.Text
6362
}
6463
}

cmd/docker-mcp/internal/mcp/mcp_client.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,33 +22,33 @@ type Client interface {
2222

2323
func stdioNotifications(serverSession *mcp.ServerSession) *mcp.ClientOptions {
2424
return &mcp.ClientOptions{
25-
CreateMessageHandler: func(ctx context.Context, session *mcp.ClientSession, params *mcp.CreateMessageParams) (*mcp.CreateMessageResult, error) {
25+
CreateMessageHandler: func(_ context.Context, _ *mcp.ClientSession, _ *mcp.CreateMessageParams) (*mcp.CreateMessageResult, error) {
2626
// Handle create messages if needed
2727
return nil, fmt.Errorf("create messages not supported")
2828
},
29-
ToolListChangedHandler: func(ctx context.Context, session *mcp.ClientSession, params *mcp.ToolListChangedParams) {
29+
ToolListChangedHandler: func(ctx context.Context, _ *mcp.ClientSession, params *mcp.ToolListChangedParams) {
3030
if serverSession != nil {
31-
mcp.HandleNotify(ctx, serverSession, "notifications/tools/list_changed", params)
31+
_ = mcp.HandleNotify(ctx, serverSession, "notifications/tools/list_changed", params)
3232
}
3333
},
34-
ResourceListChangedHandler: func(ctx context.Context, session *mcp.ClientSession, params *mcp.ResourceListChangedParams) {
34+
ResourceListChangedHandler: func(ctx context.Context, _ *mcp.ClientSession, params *mcp.ResourceListChangedParams) {
3535
if serverSession != nil {
36-
mcp.HandleNotify(ctx, serverSession, "notifications/resources/list_changed", params)
36+
_ = mcp.HandleNotify(ctx, serverSession, "notifications/resources/list_changed", params)
3737
}
3838
},
39-
PromptListChangedHandler: func(ctx context.Context, session *mcp.ClientSession, params *mcp.PromptListChangedParams) {
39+
PromptListChangedHandler: func(ctx context.Context, _ *mcp.ClientSession, params *mcp.PromptListChangedParams) {
4040
if serverSession != nil {
41-
mcp.HandleNotify(ctx, serverSession, "notifications/prompts/list_changed", params)
41+
_ = mcp.HandleNotify(ctx, serverSession, "notifications/prompts/list_changed", params)
4242
}
4343
},
44-
ProgressNotificationHandler: func(ctx context.Context, session *mcp.ClientSession, params *mcp.ProgressNotificationParams) {
44+
ProgressNotificationHandler: func(ctx context.Context, _ *mcp.ClientSession, params *mcp.ProgressNotificationParams) {
4545
if serverSession != nil {
46-
serverSession.NotifyProgress(ctx, params)
46+
_ = serverSession.NotifyProgress(ctx, params)
4747
}
4848
},
49-
LoggingMessageHandler: func(ctx context.Context, session *mcp.ClientSession, params *mcp.LoggingMessageParams) {
49+
LoggingMessageHandler: func(ctx context.Context, _ *mcp.ClientSession, params *mcp.LoggingMessageParams) {
5050
if serverSession != nil {
51-
serverSession.Log(ctx, params)
51+
_ = serverSession.Log(ctx, params)
5252
}
5353
},
5454
}

cmd/docker-mcp/internal/mcp/remote.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func NewRemoteMCPClient(config catalog.ServerConfig) Client {
2525
}
2626
}
2727

28-
func (c *remoteMCPClient) Initialize(ctx context.Context, params *mcp.InitializeParams, _ bool, _ *mcp.ServerSession) (*mcp.InitializeResult, error) {
28+
func (c *remoteMCPClient) Initialize(ctx context.Context, _ *mcp.InitializeParams, _ bool, _ *mcp.ServerSession) (*mcp.InitializeResult, error) {
2929
if c.initialized.Load() {
3030
return nil, fmt.Errorf("client already initialized")
3131
}

cmd/docker-mcp/internal/mcp/stdio.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func NewStdioCmdClient(name string, command string, env []string, args ...string
3131
}
3232
}
3333

34-
func (c *stdioMCPClient) Initialize(ctx context.Context, params *mcp.InitializeParams, debug bool, s *mcp.ServerSession) (*mcp.InitializeResult, error) {
34+
func (c *stdioMCPClient) Initialize(ctx context.Context, _ *mcp.InitializeParams, debug bool, s *mcp.ServerSession) (*mcp.InitializeResult, error) {
3535
if c.initialized.Load() {
3636
return nil, fmt.Errorf("client already initialized")
3737
}

0 commit comments

Comments
 (0)