diff --git a/.github/workflows/snapshot.yaml b/.github/workflows/snapshot.yaml index 7fd3736..2972b9d 100644 --- a/.github/workflows/snapshot.yaml +++ b/.github/workflows/snapshot.yaml @@ -28,7 +28,6 @@ jobs: -count=1 \ -vet=all \ -timeout 3m \ - {{.CLI_ARGS}} \ -coverpkg=./... \ -covermode=atomic \ -coverprofile=coverage.out \ diff --git a/go.mod b/go.mod index 25d712b..cd2a595 100644 --- a/go.mod +++ b/go.mod @@ -4,15 +4,15 @@ go 1.24.1 require ( github.com/JohannesKaufmann/html-to-markdown/v2 v2.3.1 - github.com/firebolt-db/firebolt-go-sdk v1.6.2 + github.com/firebolt-db/firebolt-go-sdk v1.7.1 github.com/gocolly/colly/v2 v2.2.0 - github.com/mark3labs/mcp-go v0.17.0 + github.com/mark3labs/mcp-go v0.18.0 github.com/neilotoole/slogt v1.1.0 github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.10.0 github.com/urfave/cli/v3 v3.1.1 - golang.org/x/oauth2 v0.28.0 - golang.org/x/sync v0.12.0 + golang.org/x/oauth2 v0.29.0 + golang.org/x/sync v0.13.0 ) require ( diff --git a/go.sum b/go.sum index 7726391..f3777c6 100644 --- a/go.sum +++ b/go.sum @@ -45,8 +45,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8Yc github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/elastic/go-elasticsearch/v6 v6.8.5/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI= github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4= -github.com/firebolt-db/firebolt-go-sdk v1.6.2 h1:gq6Ob/q9TU4/mMqj3FzLndMIAZNHJSEYUfvgjIZ8kag= -github.com/firebolt-db/firebolt-go-sdk v1.6.2/go.mod h1:jes3f/uon4qPDx94SM4cwnVZy1/Sld4ermfS9G+LY9k= +github.com/firebolt-db/firebolt-go-sdk v1.7.1 h1:aUmnHzfFUUuLLjc7PWaTWKKRFfrQq3ysxEtBtca/tG0= +github.com/firebolt-db/firebolt-go-sdk v1.7.1/go.mod h1:jes3f/uon4qPDx94SM4cwnVZy1/Sld4ermfS9G+LY9k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/glendc/gopher-json v0.0.0-20170414221815-dc4743023d0c/go.mod h1:Gja1A+xZ9BoviGJNA2E9vFkPjjsl+CoJxSXiQM1UXtw= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= @@ -105,8 +105,8 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/ledisdb/ledisdb v0.0.0-20200510135210-d35789ec47e6/go.mod h1:n931TsDuKuq+uX4v1fulaMbA/7ZLLhjc85h7chZGBCQ= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/mark3labs/mcp-go v0.17.0 h1:5Ps6T7qXr7De/2QTqs9h6BKeZ/qdeUeGrgM5lPzi930= -github.com/mark3labs/mcp-go v0.17.0/go.mod h1:KmJndYv7GIgcPVwEKJjNcbhVQ+hJGJhrCCB/9xITzpE= +github.com/mark3labs/mcp-go v0.18.0 h1:YuhgIVjNlTG2ZOwmrkORWyPTp0dz1opPEqvsPtySXao= +github.com/mark3labs/mcp-go v0.18.0/go.mod h1:KmJndYv7GIgcPVwEKJjNcbhVQ+hJGJhrCCB/9xITzpE= github.com/matishsiao/goInfo v0.0.0-20210923090445-da2e3fa8d45f h1:B0OD7nYl2FPQEVrw8g2uyc1lGEzNbvrKh7fspGZcbvY= github.com/matishsiao/goInfo v0.0.0-20210923090445-da2e3fa8d45f/go.mod h1:aEt7p9Rvh67BYApmZwNDPpgircTO2kgdmDUoF/1QmwA= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= @@ -216,8 +216,8 @@ golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c= golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= -golang.org/x/oauth2 v0.28.0 h1:CrgCKl8PPAVtLnU3c+EDw6x11699EWlsDeWNWKdIOkc= -golang.org/x/oauth2 v0.28.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= +golang.org/x/oauth2 v0.29.0 h1:WdYw2tdTK1S8olAzWHdgeqfy+Mtm9XNhv/xJsY65d98= +golang.org/x/oauth2 v0.29.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -229,8 +229,8 @@ golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= -golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= +golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/pkg/server/server.go b/pkg/server/server.go index 7c1356e..eb018e3 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -75,24 +75,27 @@ func NewServer( // Configure logging hooks to track tool calls and errors hooks := &mcpserver.Hooks{} - hooks.AddBeforeCallTool(func(id any, message *mcp.CallToolRequest) { - logger.Debug( + hooks.AddBeforeCallTool(func(ctx context.Context, id any, message *mcp.CallToolRequest) { + logger.DebugContext( + ctx, "received tool call request", slog.Any("id", id), slog.String("tool", message.Params.Name), slog.Any("arguments", message.Params.Arguments), ) }) - hooks.AddAfterCallTool(func(id any, message *mcp.CallToolRequest, result *mcp.CallToolResult) { - logger.Info( + hooks.AddAfterCallTool(func(ctx context.Context, id any, message *mcp.CallToolRequest, result *mcp.CallToolResult) { + logger.InfoContext( + ctx, "tool call finished", slog.Any("id", id), slog.String("tool", message.Params.Name), slog.Any("any", result.Result), ) }) - hooks.AddOnError(func(id any, method mcp.MCPMethod, message any, err error) { - logger.Error( + hooks.AddOnError(func(ctx context.Context, id any, method mcp.MCPMethod, message any, err error) { + logger.ErrorContext( + ctx, "error occurred", slog.Any("id", id), slog.String("method", string(method)),