Skip to content

Commit 67bdb82

Browse files
committed
Add log on initialization
Signed-off-by: David Gageot <[email protected]>
1 parent c6f02e9 commit 67bdb82

File tree

1 file changed

+8
-0
lines changed
  • cmd/docker-mcp/internal/gateway

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"strings"
99
"time"
1010

11+
"github.com/mark3labs/mcp-go/mcp"
1112
"github.com/mark3labs/mcp-go/server"
1213

1314
"github.com/docker/mcp-gateway/cmd/docker-mcp/internal/docker"
@@ -93,6 +94,13 @@ func (g *Gateway) Run(ctx context.Context) error {
9394
"Docker AI MCP Gateway",
9495
"2.0.1",
9596
server.WithToolHandlerMiddleware(toolCallbacks),
97+
server.WithHooks(&server.Hooks{
98+
OnBeforeInitialize: []server.OnBeforeInitializeFunc{
99+
func(ctx context.Context, id any, message *mcp.InitializeRequest) {
100+
log("> Initializing MCP server with ID:", id)
101+
},
102+
},
103+
}),
96104
)
97105

98106
if err := g.reloadConfiguration(ctx, mcpServer, configuration); err != nil {

0 commit comments

Comments
 (0)