diff --git a/go.mod b/go.mod index 5c9bc081..cb0c9648 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.23.7 require ( github.com/google/go-github/v69 v69.2.0 - github.com/mark3labs/mcp-go v0.28.0 + github.com/mark3labs/mcp-go v0.30.0 github.com/migueleliasweb/go-github-mock v1.3.0 github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.9.1 diff --git a/go.sum b/go.sum index 6d3d2976..73dbb709 100644 --- a/go.sum +++ b/go.sum @@ -31,8 +31,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mark3labs/mcp-go v0.28.0 h1:7yl4y5D1KYU2f/9Uxp7xfLIggfunHoESCRbrjcytcLM= -github.com/mark3labs/mcp-go v0.28.0/go.mod h1:rXqOudj/djTORU/ThxYx8fqEVj/5pvTuuebQ2RC7uk4= +github.com/mark3labs/mcp-go v0.30.0 h1:Taz7fiefkxY/l8jz1nA90V+WdM2eoMtlvwfWforVYbo= +github.com/mark3labs/mcp-go v0.30.0/go.mod h1:rXqOudj/djTORU/ThxYx8fqEVj/5pvTuuebQ2RC7uk4= github.com/migueleliasweb/go-github-mock v1.3.0 h1:2sVP9JEMB2ubQw1IKto3/fzF51oFC6eVWOOFDgQoq88= github.com/migueleliasweb/go-github-mock v1.3.0/go.mod h1:ipQhV8fTcj/G6m7BKzin08GaJ/3B5/SonRAkgrk0zCY= github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= diff --git a/pkg/github/helper_test.go b/pkg/github/helper_test.go index 06bc1d54..4b9a243d 100644 --- a/pkg/github/helper_test.go +++ b/pkg/github/helper_test.go @@ -109,12 +109,12 @@ func mockResponse(t *testing.T, code int, body interface{}) http.HandlerFunc { } // createMCPRequest is a helper function to create a MCP request with the given arguments. -func createMCPRequest(args map[string]any) mcp.CallToolRequest { +func createMCPRequest(args any) mcp.CallToolRequest { return mcp.CallToolRequest{ Params: struct { - Name string `json:"name"` - Arguments map[string]any `json:"arguments,omitempty"` - Meta *mcp.Meta `json:"_meta,omitempty"` + Name string `json:"name"` + Arguments any `json:"arguments,omitempty"` + Meta *mcp.Meta `json:"_meta,omitempty"` }{ Arguments: args, }, diff --git a/pkg/github/issues.go b/pkg/github/issues.go index 68e7a36c..07c76078 100644 --- a/pkg/github/issues.go +++ b/pkg/github/issues.go @@ -450,11 +450,11 @@ func ListIssues(getClient GetClientFn, t translations.TranslationHelperFunc) (to opts.Since = timestamp } - if page, ok := request.Params.Arguments["page"].(float64); ok { + if page, ok := request.GetArguments()["page"].(float64); ok { opts.Page = int(page) } - if perPage, ok := request.Params.Arguments["perPage"].(float64); ok { + if perPage, ok := request.GetArguments()["perPage"].(float64); ok { opts.PerPage = int(perPage) } diff --git a/pkg/github/repositories.go b/pkg/github/repositories.go index 4403e2a1..8c337163 100644 --- a/pkg/github/repositories.go +++ b/pkg/github/repositories.go @@ -869,7 +869,7 @@ func PushFiles(getClient GetClientFn, t translations.TranslationHelperFunc) (too } // Parse files parameter - this should be an array of objects with path and content - filesObj, ok := request.Params.Arguments["files"].([]interface{}) + filesObj, ok := request.GetArguments()["files"].([]interface{}) if !ok { return mcp.NewToolResultError("files parameter must be an array of objects with path and content"), nil } diff --git a/pkg/github/server.go b/pkg/github/server.go index e4c24171..e525da0a 100644 --- a/pkg/github/server.go +++ b/pkg/github/server.go @@ -33,7 +33,7 @@ func NewServer(version string, opts ...server.ServerOption) *server.MCPServer { // It returns the value, a boolean indicating if the parameter was present, and an error if the type is wrong. func OptionalParamOK[T any](r mcp.CallToolRequest, p string) (value T, ok bool, err error) { // Check if the parameter is present in the request - val, exists := r.Params.Arguments[p] + val, exists := r.GetArguments()[p] if !exists { // Not present, return zero value, false, no error return @@ -68,21 +68,21 @@ func requiredParam[T comparable](r mcp.CallToolRequest, p string) (T, error) { var zero T // Check if the parameter is present in the request - if _, ok := r.Params.Arguments[p]; !ok { + if _, ok := r.GetArguments()[p]; !ok { return zero, fmt.Errorf("missing required parameter: %s", p) } // Check if the parameter is of the expected type - if _, ok := r.Params.Arguments[p].(T); !ok { + if _, ok := r.GetArguments()[p].(T); !ok { return zero, fmt.Errorf("parameter %s is not of type %T", p, zero) } - if r.Params.Arguments[p].(T) == zero { + if r.GetArguments()[p].(T) == zero { return zero, fmt.Errorf("missing required parameter: %s", p) } - return r.Params.Arguments[p].(T), nil + return r.GetArguments()[p].(T), nil } // RequiredInt is a helper function that can be used to fetch a requested parameter from the request. @@ -106,16 +106,16 @@ func OptionalParam[T any](r mcp.CallToolRequest, p string) (T, error) { var zero T // Check if the parameter is present in the request - if _, ok := r.Params.Arguments[p]; !ok { + if _, ok := r.GetArguments()[p]; !ok { return zero, nil } // Check if the parameter is of the expected type - if _, ok := r.Params.Arguments[p].(T); !ok { - return zero, fmt.Errorf("parameter %s is not of type %T, is %T", p, zero, r.Params.Arguments[p]) + if _, ok := r.GetArguments()[p].(T); !ok { + return zero, fmt.Errorf("parameter %s is not of type %T, is %T", p, zero, r.GetArguments()[p]) } - return r.Params.Arguments[p].(T), nil + return r.GetArguments()[p].(T), nil } // OptionalIntParam is a helper function that can be used to fetch a requested parameter from the request. @@ -149,11 +149,11 @@ func OptionalIntParamWithDefault(r mcp.CallToolRequest, p string, d int) (int, e // 2. If it is present, iterates the elements and checks each is a string func OptionalStringArrayParam(r mcp.CallToolRequest, p string) ([]string, error) { // Check if the parameter is present in the request - if _, ok := r.Params.Arguments[p]; !ok { + if _, ok := r.GetArguments()[p]; !ok { return []string{}, nil } - switch v := r.Params.Arguments[p].(type) { + switch v := r.GetArguments()[p].(type) { case nil: return []string{}, nil case []string: @@ -169,7 +169,7 @@ func OptionalStringArrayParam(r mcp.CallToolRequest, p string) ([]string, error) } return strSlice, nil default: - return []string{}, fmt.Errorf("parameter %s could not be coerced to []string, is %T", p, r.Params.Arguments[p]) + return []string{}, fmt.Errorf("parameter %s could not be coerced to []string, is %T", p, r.GetArguments()[p]) } } diff --git a/third-party-licenses.darwin.md b/third-party-licenses.darwin.md index cdb2af5b..6afdad8d 100644 --- a/third-party-licenses.darwin.md +++ b/third-party-licenses.darwin.md @@ -13,7 +13,7 @@ Some packages may only be included on certain architectures or operating systems - [github.com/google/go-github/v69/github](https://pkg.go.dev/github.com/google/go-github/v69/github) ([BSD-3-Clause](https://github.com/google/go-github/blob/v69.2.0/LICENSE)) - [github.com/google/go-querystring/query](https://pkg.go.dev/github.com/google/go-querystring/query) ([BSD-3-Clause](https://github.com/google/go-querystring/blob/v1.1.0/LICENSE)) - [github.com/google/uuid](https://pkg.go.dev/github.com/google/uuid) ([BSD-3-Clause](https://github.com/google/uuid/blob/v1.6.0/LICENSE)) - - [github.com/mark3labs/mcp-go](https://pkg.go.dev/github.com/mark3labs/mcp-go) ([MIT](https://github.com/mark3labs/mcp-go/blob/v0.28.0/LICENSE)) + - [github.com/mark3labs/mcp-go](https://pkg.go.dev/github.com/mark3labs/mcp-go) ([MIT](https://github.com/mark3labs/mcp-go/blob/v0.30.0/LICENSE)) - [github.com/pelletier/go-toml/v2](https://pkg.go.dev/github.com/pelletier/go-toml/v2) ([MIT](https://github.com/pelletier/go-toml/blob/v2.2.3/LICENSE)) - [github.com/sagikazarmark/locafero](https://pkg.go.dev/github.com/sagikazarmark/locafero) ([MIT](https://github.com/sagikazarmark/locafero/blob/v0.9.0/LICENSE)) - [github.com/shurcooL/githubv4](https://pkg.go.dev/github.com/shurcooL/githubv4) ([MIT](https://github.com/shurcooL/githubv4/blob/48295856cce7/LICENSE)) diff --git a/third-party-licenses.linux.md b/third-party-licenses.linux.md index cdb2af5b..6afdad8d 100644 --- a/third-party-licenses.linux.md +++ b/third-party-licenses.linux.md @@ -13,7 +13,7 @@ Some packages may only be included on certain architectures or operating systems - [github.com/google/go-github/v69/github](https://pkg.go.dev/github.com/google/go-github/v69/github) ([BSD-3-Clause](https://github.com/google/go-github/blob/v69.2.0/LICENSE)) - [github.com/google/go-querystring/query](https://pkg.go.dev/github.com/google/go-querystring/query) ([BSD-3-Clause](https://github.com/google/go-querystring/blob/v1.1.0/LICENSE)) - [github.com/google/uuid](https://pkg.go.dev/github.com/google/uuid) ([BSD-3-Clause](https://github.com/google/uuid/blob/v1.6.0/LICENSE)) - - [github.com/mark3labs/mcp-go](https://pkg.go.dev/github.com/mark3labs/mcp-go) ([MIT](https://github.com/mark3labs/mcp-go/blob/v0.28.0/LICENSE)) + - [github.com/mark3labs/mcp-go](https://pkg.go.dev/github.com/mark3labs/mcp-go) ([MIT](https://github.com/mark3labs/mcp-go/blob/v0.30.0/LICENSE)) - [github.com/pelletier/go-toml/v2](https://pkg.go.dev/github.com/pelletier/go-toml/v2) ([MIT](https://github.com/pelletier/go-toml/blob/v2.2.3/LICENSE)) - [github.com/sagikazarmark/locafero](https://pkg.go.dev/github.com/sagikazarmark/locafero) ([MIT](https://github.com/sagikazarmark/locafero/blob/v0.9.0/LICENSE)) - [github.com/shurcooL/githubv4](https://pkg.go.dev/github.com/shurcooL/githubv4) ([MIT](https://github.com/shurcooL/githubv4/blob/48295856cce7/LICENSE)) diff --git a/third-party-licenses.windows.md b/third-party-licenses.windows.md index 74d13898..9c43f29f 100644 --- a/third-party-licenses.windows.md +++ b/third-party-licenses.windows.md @@ -14,7 +14,7 @@ Some packages may only be included on certain architectures or operating systems - [github.com/google/go-querystring/query](https://pkg.go.dev/github.com/google/go-querystring/query) ([BSD-3-Clause](https://github.com/google/go-querystring/blob/v1.1.0/LICENSE)) - [github.com/google/uuid](https://pkg.go.dev/github.com/google/uuid) ([BSD-3-Clause](https://github.com/google/uuid/blob/v1.6.0/LICENSE)) - [github.com/inconshreveable/mousetrap](https://pkg.go.dev/github.com/inconshreveable/mousetrap) ([Apache-2.0](https://github.com/inconshreveable/mousetrap/blob/v1.1.0/LICENSE)) - - [github.com/mark3labs/mcp-go](https://pkg.go.dev/github.com/mark3labs/mcp-go) ([MIT](https://github.com/mark3labs/mcp-go/blob/v0.28.0/LICENSE)) + - [github.com/mark3labs/mcp-go](https://pkg.go.dev/github.com/mark3labs/mcp-go) ([MIT](https://github.com/mark3labs/mcp-go/blob/v0.30.0/LICENSE)) - [github.com/pelletier/go-toml/v2](https://pkg.go.dev/github.com/pelletier/go-toml/v2) ([MIT](https://github.com/pelletier/go-toml/blob/v2.2.3/LICENSE)) - [github.com/sagikazarmark/locafero](https://pkg.go.dev/github.com/sagikazarmark/locafero) ([MIT](https://github.com/sagikazarmark/locafero/blob/v0.9.0/LICENSE)) - [github.com/shurcooL/githubv4](https://pkg.go.dev/github.com/shurcooL/githubv4) ([MIT](https://github.com/shurcooL/githubv4/blob/48295856cce7/LICENSE))