Skip to content

Commit d66769f

Browse files
authored
Merge branch 'main' into feat/mark-pr-ready-for-review
2 parents 650aac6 + d4a0764 commit d66769f

10 files changed

+28
-27
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.23.7
44

55
require (
66
github.com/google/go-github/v69 v69.2.0
7-
github.com/mark3labs/mcp-go v0.28.0
7+
github.com/mark3labs/mcp-go v0.30.0
88
github.com/migueleliasweb/go-github-mock v1.3.0
99
github.com/sirupsen/logrus v1.9.3
1010
github.com/spf13/cobra v1.9.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
3131
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
3232
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
3333
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
34-
github.com/mark3labs/mcp-go v0.28.0 h1:7yl4y5D1KYU2f/9Uxp7xfLIggfunHoESCRbrjcytcLM=
35-
github.com/mark3labs/mcp-go v0.28.0/go.mod h1:rXqOudj/djTORU/ThxYx8fqEVj/5pvTuuebQ2RC7uk4=
34+
github.com/mark3labs/mcp-go v0.30.0 h1:Taz7fiefkxY/l8jz1nA90V+WdM2eoMtlvwfWforVYbo=
35+
github.com/mark3labs/mcp-go v0.30.0/go.mod h1:rXqOudj/djTORU/ThxYx8fqEVj/5pvTuuebQ2RC7uk4=
3636
github.com/migueleliasweb/go-github-mock v1.3.0 h1:2sVP9JEMB2ubQw1IKto3/fzF51oFC6eVWOOFDgQoq88=
3737
github.com/migueleliasweb/go-github-mock v1.3.0/go.mod h1:ipQhV8fTcj/G6m7BKzin08GaJ/3B5/SonRAkgrk0zCY=
3838
github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M=

pkg/github/helper_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,12 @@ func mockResponse(t *testing.T, code int, body interface{}) http.HandlerFunc {
109109
}
110110

111111
// createMCPRequest is a helper function to create a MCP request with the given arguments.
112-
func createMCPRequest(args map[string]any) mcp.CallToolRequest {
112+
func createMCPRequest(args any) mcp.CallToolRequest {
113113
return mcp.CallToolRequest{
114114
Params: struct {
115-
Name string `json:"name"`
116-
Arguments map[string]any `json:"arguments,omitempty"`
117-
Meta *mcp.Meta `json:"_meta,omitempty"`
115+
Name string `json:"name"`
116+
Arguments any `json:"arguments,omitempty"`
117+
Meta *mcp.Meta `json:"_meta,omitempty"`
118118
}{
119119
Arguments: args,
120120
},

pkg/github/issues.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,11 +450,11 @@ func ListIssues(getClient GetClientFn, t translations.TranslationHelperFunc) (to
450450
opts.Since = timestamp
451451
}
452452

453-
if page, ok := request.Params.Arguments["page"].(float64); ok {
453+
if page, ok := request.GetArguments()["page"].(float64); ok {
454454
opts.Page = int(page)
455455
}
456456

457-
if perPage, ok := request.Params.Arguments["perPage"].(float64); ok {
457+
if perPage, ok := request.GetArguments()["perPage"].(float64); ok {
458458
opts.PerPage = int(perPage)
459459
}
460460

pkg/github/pullrequests.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ import (
77
"io"
88
"net/http"
99

10-
"github.com/github/github-mcp-server/pkg/translations"
1110
"github.com/go-viper/mapstructure/v2"
1211
"github.com/google/go-github/v69/github"
1312
"github.com/mark3labs/mcp-go/mcp"
1413
"github.com/mark3labs/mcp-go/server"
1514
"github.com/shurcooL/githubv4"
15+
16+
"github.com/github/github-mcp-server/pkg/translations"
1617
)
1718

1819
// GetPullRequest creates a tool to get details of a specific pull request.
@@ -1050,7 +1051,7 @@ func CreatePendingPullRequestReview(getGQLClient GetGQLClientFn, t translations.
10501051
// AddPullRequestReviewCommentToPendingReview creates a tool to add a comment to a pull request review.
10511052
func AddPullRequestReviewCommentToPendingReview(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc) {
10521053
return mcp.NewTool("add_pull_request_review_comment_to_pending_review",
1053-
mcp.WithDescription(t("TOOL_ADD_PULL_REQUEST_REVIEW_COMMENT_TO_PENDING_REVIEW_DESCRIPTION", "Add a comment to the requester's latest pending pull request review, a pending review needs to already exist to call this (check with the user if not sure). If you are using the LINE subjectType, use the get_line_number_in_pull_request_file tool to get an exact line number before commenting.")),
1054+
mcp.WithDescription(t("TOOL_ADD_PULL_REQUEST_REVIEW_COMMENT_TO_PENDING_REVIEW_DESCRIPTION", "Add a comment to the requester's latest pending pull request review, a pending review needs to already exist to call this (check with the user if not sure).")),
10541055
mcp.WithToolAnnotation(mcp.ToolAnnotation{
10551056
Title: t("TOOL_ADD_PULL_REQUEST_REVIEW_COMMENT_TO_PENDING_REVIEW_USER_TITLE", "Add comment to the requester's latest pending pull request review"),
10561057
ReadOnlyHint: toBoolPtr(false),

pkg/github/repositories.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ func PushFiles(getClient GetClientFn, t translations.TranslationHelperFunc) (too
869869
}
870870

871871
// Parse files parameter - this should be an array of objects with path and content
872-
filesObj, ok := request.Params.Arguments["files"].([]interface{})
872+
filesObj, ok := request.GetArguments()["files"].([]interface{})
873873
if !ok {
874874
return mcp.NewToolResultError("files parameter must be an array of objects with path and content"), nil
875875
}

pkg/github/server.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func NewServer(version string, opts ...server.ServerOption) *server.MCPServer {
3333
// It returns the value, a boolean indicating if the parameter was present, and an error if the type is wrong.
3434
func OptionalParamOK[T any](r mcp.CallToolRequest, p string) (value T, ok bool, err error) {
3535
// Check if the parameter is present in the request
36-
val, exists := r.Params.Arguments[p]
36+
val, exists := r.GetArguments()[p]
3737
if !exists {
3838
// Not present, return zero value, false, no error
3939
return
@@ -68,21 +68,21 @@ func requiredParam[T comparable](r mcp.CallToolRequest, p string) (T, error) {
6868
var zero T
6969

7070
// Check if the parameter is present in the request
71-
if _, ok := r.Params.Arguments[p]; !ok {
71+
if _, ok := r.GetArguments()[p]; !ok {
7272
return zero, fmt.Errorf("missing required parameter: %s", p)
7373
}
7474

7575
// Check if the parameter is of the expected type
76-
if _, ok := r.Params.Arguments[p].(T); !ok {
76+
if _, ok := r.GetArguments()[p].(T); !ok {
7777
return zero, fmt.Errorf("parameter %s is not of type %T", p, zero)
7878
}
7979

80-
if r.Params.Arguments[p].(T) == zero {
80+
if r.GetArguments()[p].(T) == zero {
8181
return zero, fmt.Errorf("missing required parameter: %s", p)
8282

8383
}
8484

85-
return r.Params.Arguments[p].(T), nil
85+
return r.GetArguments()[p].(T), nil
8686
}
8787

8888
// 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) {
106106
var zero T
107107

108108
// Check if the parameter is present in the request
109-
if _, ok := r.Params.Arguments[p]; !ok {
109+
if _, ok := r.GetArguments()[p]; !ok {
110110
return zero, nil
111111
}
112112

113113
// Check if the parameter is of the expected type
114-
if _, ok := r.Params.Arguments[p].(T); !ok {
115-
return zero, fmt.Errorf("parameter %s is not of type %T, is %T", p, zero, r.Params.Arguments[p])
114+
if _, ok := r.GetArguments()[p].(T); !ok {
115+
return zero, fmt.Errorf("parameter %s is not of type %T, is %T", p, zero, r.GetArguments()[p])
116116
}
117117

118-
return r.Params.Arguments[p].(T), nil
118+
return r.GetArguments()[p].(T), nil
119119
}
120120

121121
// 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
149149
// 2. If it is present, iterates the elements and checks each is a string
150150
func OptionalStringArrayParam(r mcp.CallToolRequest, p string) ([]string, error) {
151151
// Check if the parameter is present in the request
152-
if _, ok := r.Params.Arguments[p]; !ok {
152+
if _, ok := r.GetArguments()[p]; !ok {
153153
return []string{}, nil
154154
}
155155

156-
switch v := r.Params.Arguments[p].(type) {
156+
switch v := r.GetArguments()[p].(type) {
157157
case nil:
158158
return []string{}, nil
159159
case []string:
@@ -169,7 +169,7 @@ func OptionalStringArrayParam(r mcp.CallToolRequest, p string) ([]string, error)
169169
}
170170
return strSlice, nil
171171
default:
172-
return []string{}, fmt.Errorf("parameter %s could not be coerced to []string, is %T", p, r.Params.Arguments[p])
172+
return []string{}, fmt.Errorf("parameter %s could not be coerced to []string, is %T", p, r.GetArguments()[p])
173173
}
174174
}
175175

third-party-licenses.darwin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Some packages may only be included on certain architectures or operating systems
1313
- [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))
1414
- [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))
1515
- [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))
16-
- [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))
16+
- [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))
1717
- [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))
1818
- [github.com/sagikazarmark/locafero](https://pkg.go.dev/github.com/sagikazarmark/locafero) ([MIT](https://github.com/sagikazarmark/locafero/blob/v0.9.0/LICENSE))
1919
- [github.com/shurcooL/githubv4](https://pkg.go.dev/github.com/shurcooL/githubv4) ([MIT](https://github.com/shurcooL/githubv4/blob/48295856cce7/LICENSE))

third-party-licenses.linux.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Some packages may only be included on certain architectures or operating systems
1313
- [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))
1414
- [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))
1515
- [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))
16-
- [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))
16+
- [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))
1717
- [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))
1818
- [github.com/sagikazarmark/locafero](https://pkg.go.dev/github.com/sagikazarmark/locafero) ([MIT](https://github.com/sagikazarmark/locafero/blob/v0.9.0/LICENSE))
1919
- [github.com/shurcooL/githubv4](https://pkg.go.dev/github.com/shurcooL/githubv4) ([MIT](https://github.com/shurcooL/githubv4/blob/48295856cce7/LICENSE))

third-party-licenses.windows.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Some packages may only be included on certain architectures or operating systems
1414
- [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))
1515
- [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))
1616
- [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))
17-
- [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))
17+
- [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))
1818
- [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))
1919
- [github.com/sagikazarmark/locafero](https://pkg.go.dev/github.com/sagikazarmark/locafero) ([MIT](https://github.com/sagikazarmark/locafero/blob/v0.9.0/LICENSE))
2020
- [github.com/shurcooL/githubv4](https://pkg.go.dev/github.com/shurcooL/githubv4) ([MIT](https://github.com/shurcooL/githubv4/blob/48295856cce7/LICENSE))

0 commit comments

Comments
 (0)