From de09628d3301c0872e0a52be4cb7c4c1cdd4121e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 May 2025 17:10:43 +0000 Subject: [PATCH 1/2] build(deps): bump github.com/mark3labs/mcp-go from 0.25.0 to 0.27.0 Bumps [github.com/mark3labs/mcp-go](https://github.com/mark3labs/mcp-go) from 0.25.0 to 0.27.0. - [Release notes](https://github.com/mark3labs/mcp-go/releases) - [Commits](https://github.com/mark3labs/mcp-go/compare/v0.25.0...v0.27.0) --- updated-dependencies: - dependency-name: github.com/mark3labs/mcp-go dependency-version: 0.27.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d62362198..7b850829e 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.25.0 + github.com/mark3labs/mcp-go v0.27.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 b11bccdc2..8b960ad56 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.25.0 h1:UUpcMT3L5hIhuDy7aifj4Bphw4Pfx1Rf8mzMXDe8RQw= -github.com/mark3labs/mcp-go v0.25.0/go.mod h1:rXqOudj/djTORU/ThxYx8fqEVj/5pvTuuebQ2RC7uk4= +github.com/mark3labs/mcp-go v0.27.0 h1:iok9kU4DUIU2/XVLgFS2Q9biIDqstC0jY4EQTK2Erzc= +github.com/mark3labs/mcp-go v0.27.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= From 15133bdda8c4c261fc52c4a941b6fcb7e05ec730 Mon Sep 17 00:00:00 2001 From: William Martin Date: Tue, 13 May 2025 13:16:11 +0200 Subject: [PATCH 2/2] Fix linter errors with mcp-go 0.27.0 bump --- pkg/github/code_scanning.go | 4 ++-- pkg/github/context_tools.go | 2 +- pkg/github/dynamic_tools.go | 6 +++--- pkg/github/issues.go | 14 +++++++------- pkg/github/pullrequests.go | 24 ++++++++++++------------ pkg/github/repositories.go | 22 +++++++++++----------- pkg/github/search.go | 6 +++--- pkg/github/secret_scanning.go | 4 ++-- pkg/github/tools.go | 4 ++++ pkg/toolsets/toolsets.go | 8 ++------ third-party-licenses.darwin.md | 2 +- third-party-licenses.linux.md | 2 +- third-party-licenses.windows.md | 2 +- 13 files changed, 50 insertions(+), 50 deletions(-) diff --git a/pkg/github/code_scanning.go b/pkg/github/code_scanning.go index 93e7e0e55..34a1b9eda 100644 --- a/pkg/github/code_scanning.go +++ b/pkg/github/code_scanning.go @@ -18,7 +18,7 @@ func GetCodeScanningAlert(getClient GetClientFn, t translations.TranslationHelpe mcp.WithDescription(t("TOOL_GET_CODE_SCANNING_ALERT_DESCRIPTION", "Get details of a specific code scanning alert in a GitHub repository.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_GET_CODE_SCANNING_ALERT_USER_TITLE", "Get code scanning alert"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("owner", mcp.Required(), @@ -80,7 +80,7 @@ func ListCodeScanningAlerts(getClient GetClientFn, t translations.TranslationHel mcp.WithDescription(t("TOOL_LIST_CODE_SCANNING_ALERTS_DESCRIPTION", "List code scanning alerts in a GitHub repository.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_LIST_CODE_SCANNING_ALERTS_USER_TITLE", "List code scanning alerts"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("owner", mcp.Required(), diff --git a/pkg/github/context_tools.go b/pkg/github/context_tools.go index 3511e23a3..0e8bcacbd 100644 --- a/pkg/github/context_tools.go +++ b/pkg/github/context_tools.go @@ -18,7 +18,7 @@ func GetMe(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mc mcp.WithDescription(t("TOOL_GET_ME_DESCRIPTION", "Get details of the authenticated GitHub user. Use this when a request include \"me\", \"my\"...")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_GET_ME_USER_TITLE", "Get my user profile"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("reason", mcp.Description("Optional: reason the session was created"), diff --git a/pkg/github/dynamic_tools.go b/pkg/github/dynamic_tools.go index 30dfd4a37..0b098fb39 100644 --- a/pkg/github/dynamic_tools.go +++ b/pkg/github/dynamic_tools.go @@ -25,7 +25,7 @@ func EnableToolset(s *server.MCPServer, toolsetGroup *toolsets.ToolsetGroup, t t mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_ENABLE_TOOLSET_USER_TITLE", "Enable a toolset"), // Not modifying GitHub data so no need to show a warning - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("toolset", mcp.Required(), @@ -64,7 +64,7 @@ func ListAvailableToolsets(toolsetGroup *toolsets.ToolsetGroup, t translations.T mcp.WithDescription(t("TOOL_LIST_AVAILABLE_TOOLSETS_DESCRIPTION", "List all available toolsets this GitHub MCP server can offer, providing the enabled status of each. Use this when a task could be achieved with a GitHub tool and the currently available tools aren't enough. Call get_toolset_tools with these toolset names to discover specific tools you can call")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_LIST_AVAILABLE_TOOLSETS_USER_TITLE", "List available toolsets"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), ), func(_ context.Context, _ mcp.CallToolRequest) (*mcp.CallToolResult, error) { @@ -98,7 +98,7 @@ func GetToolsetsTools(toolsetGroup *toolsets.ToolsetGroup, t translations.Transl mcp.WithDescription(t("TOOL_GET_TOOLSET_TOOLS_DESCRIPTION", "Lists all the capabilities that are enabled with the specified toolset, use this to get clarity on whether enabling a toolset would help you to complete a task")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_GET_TOOLSET_TOOLS_USER_TITLE", "List all tools in a toolset"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("toolset", mcp.Required(), diff --git a/pkg/github/issues.go b/pkg/github/issues.go index 0fcc2502f..7c8451d39 100644 --- a/pkg/github/issues.go +++ b/pkg/github/issues.go @@ -20,7 +20,7 @@ func GetIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.WithDescription(t("TOOL_GET_ISSUE_DESCRIPTION", "Get details of a specific issue in a GitHub repository.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_GET_ISSUE_USER_TITLE", "Get issue details"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("owner", mcp.Required(), @@ -82,7 +82,7 @@ func AddIssueComment(getClient GetClientFn, t translations.TranslationHelperFunc mcp.WithDescription(t("TOOL_ADD_ISSUE_COMMENT_DESCRIPTION", "Add a comment to a specific issue in a GitHub repository.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_ADD_ISSUE_COMMENT_USER_TITLE", "Add comment to issue"), - ReadOnlyHint: false, + ReadOnlyHint: toBoolPtr(false), }), mcp.WithString("owner", mcp.Required(), @@ -156,7 +156,7 @@ func SearchIssues(getClient GetClientFn, t translations.TranslationHelperFunc) ( mcp.WithDescription(t("TOOL_SEARCH_ISSUES_DESCRIPTION", "Search for issues in GitHub repositories.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_SEARCH_ISSUES_USER_TITLE", "Search issues"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("q", mcp.Required(), @@ -244,7 +244,7 @@ func CreateIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (t mcp.WithDescription(t("TOOL_CREATE_ISSUE_DESCRIPTION", "Create a new issue in a GitHub repository.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_CREATE_ISSUE_USER_TITLE", "Open new issue"), - ReadOnlyHint: false, + ReadOnlyHint: toBoolPtr(false), }), mcp.WithString("owner", mcp.Required(), @@ -366,7 +366,7 @@ func ListIssues(getClient GetClientFn, t translations.TranslationHelperFunc) (to mcp.WithDescription(t("TOOL_LIST_ISSUES_DESCRIPTION", "List issues in a GitHub repository.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_LIST_ISSUES_USER_TITLE", "List issues"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("owner", mcp.Required(), @@ -488,7 +488,7 @@ func UpdateIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (t mcp.WithDescription(t("TOOL_UPDATE_ISSUE_DESCRIPTION", "Update an existing issue in a GitHub repository.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_UPDATE_ISSUE_USER_TITLE", "Edit issue"), - ReadOnlyHint: false, + ReadOnlyHint: toBoolPtr(false), }), mcp.WithString("owner", mcp.Required(), @@ -634,7 +634,7 @@ func GetIssueComments(getClient GetClientFn, t translations.TranslationHelperFun mcp.WithDescription(t("TOOL_GET_ISSUE_COMMENTS_DESCRIPTION", "Get comments for a specific issue in a GitHub repository.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_GET_ISSUE_COMMENTS_USER_TITLE", "Get issue comments"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("owner", mcp.Required(), diff --git a/pkg/github/pullrequests.go b/pkg/github/pullrequests.go index 9c8fca171..f4470b7b4 100644 --- a/pkg/github/pullrequests.go +++ b/pkg/github/pullrequests.go @@ -19,7 +19,7 @@ func GetPullRequest(getClient GetClientFn, t translations.TranslationHelperFunc) mcp.WithDescription(t("TOOL_GET_PULL_REQUEST_DESCRIPTION", "Get details of a specific pull request in a GitHub repository.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_GET_PULL_REQUEST_USER_TITLE", "Get pull request details"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("owner", mcp.Required(), @@ -81,7 +81,7 @@ func UpdatePullRequest(getClient GetClientFn, t translations.TranslationHelperFu mcp.WithDescription(t("TOOL_UPDATE_PULL_REQUEST_DESCRIPTION", "Update an existing pull request in a GitHub repository.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_UPDATE_PULL_REQUEST_USER_TITLE", "Edit pull request"), - ReadOnlyHint: false, + ReadOnlyHint: toBoolPtr(false), }), mcp.WithString("owner", mcp.Required(), @@ -202,7 +202,7 @@ func ListPullRequests(getClient GetClientFn, t translations.TranslationHelperFun mcp.WithDescription(t("TOOL_LIST_PULL_REQUESTS_DESCRIPTION", "List pull requests in a GitHub repository.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_LIST_PULL_REQUESTS_USER_TITLE", "List pull requests"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("owner", mcp.Required(), @@ -311,7 +311,7 @@ func MergePullRequest(getClient GetClientFn, t translations.TranslationHelperFun mcp.WithDescription(t("TOOL_MERGE_PULL_REQUEST_DESCRIPTION", "Merge a pull request in a GitHub repository.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_MERGE_PULL_REQUEST_USER_TITLE", "Merge pull request"), - ReadOnlyHint: false, + ReadOnlyHint: toBoolPtr(false), }), mcp.WithString("owner", mcp.Required(), @@ -400,7 +400,7 @@ func GetPullRequestFiles(getClient GetClientFn, t translations.TranslationHelper mcp.WithDescription(t("TOOL_GET_PULL_REQUEST_FILES_DESCRIPTION", "Get the files changed in a specific pull request.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_GET_PULL_REQUEST_FILES_USER_TITLE", "Get pull request files"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("owner", mcp.Required(), @@ -463,7 +463,7 @@ func GetPullRequestStatus(getClient GetClientFn, t translations.TranslationHelpe mcp.WithDescription(t("TOOL_GET_PULL_REQUEST_STATUS_DESCRIPTION", "Get the status of a specific pull request.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_GET_PULL_REQUEST_STATUS_USER_TITLE", "Get pull request status checks"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("owner", mcp.Required(), @@ -540,7 +540,7 @@ func UpdatePullRequestBranch(getClient GetClientFn, t translations.TranslationHe mcp.WithDescription(t("TOOL_UPDATE_PULL_REQUEST_BRANCH_DESCRIPTION", "Update the branch of a pull request with the latest changes from the base branch.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_UPDATE_PULL_REQUEST_BRANCH_USER_TITLE", "Update pull request branch"), - ReadOnlyHint: false, + ReadOnlyHint: toBoolPtr(false), }), mcp.WithString("owner", mcp.Required(), @@ -618,7 +618,7 @@ func GetPullRequestComments(getClient GetClientFn, t translations.TranslationHel mcp.WithDescription(t("TOOL_GET_PULL_REQUEST_COMMENTS_DESCRIPTION", "Get comments for a specific pull request.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_GET_PULL_REQUEST_COMMENTS_USER_TITLE", "Get pull request comments"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("owner", mcp.Required(), @@ -686,7 +686,7 @@ func AddPullRequestReviewComment(getClient GetClientFn, t translations.Translati mcp.WithDescription(t("TOOL_ADD_PULL_REQUEST_REVIEW_COMMENT_DESCRIPTION", "Add a review comment to a pull request.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_ADD_PULL_REQUEST_REVIEW_COMMENT_USER_TITLE", "Add review comment to pull request"), - ReadOnlyHint: false, + ReadOnlyHint: toBoolPtr(false), }), mcp.WithString("owner", mcp.Required(), @@ -860,7 +860,7 @@ func GetPullRequestReviews(getClient GetClientFn, t translations.TranslationHelp mcp.WithDescription(t("TOOL_GET_PULL_REQUEST_REVIEWS_DESCRIPTION", "Get reviews for a specific pull request.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_GET_PULL_REQUEST_REVIEWS_USER_TITLE", "Get pull request reviews"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("owner", mcp.Required(), @@ -922,7 +922,7 @@ func CreatePullRequestReview(getClient GetClientFn, t translations.TranslationHe mcp.WithDescription(t("TOOL_CREATE_PULL_REQUEST_REVIEW_DESCRIPTION", "Create a review for a pull request.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_CREATE_PULL_REQUEST_REVIEW_USER_TITLE", "Submit pull request review"), - ReadOnlyHint: false, + ReadOnlyHint: toBoolPtr(false), }), mcp.WithString("owner", mcp.Required(), @@ -1138,7 +1138,7 @@ func CreatePullRequest(getClient GetClientFn, t translations.TranslationHelperFu mcp.WithDescription(t("TOOL_CREATE_PULL_REQUEST_DESCRIPTION", "Create a new pull request in a GitHub repository.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_CREATE_PULL_REQUEST_USER_TITLE", "Open new pull request"), - ReadOnlyHint: false, + ReadOnlyHint: toBoolPtr(false), }), mcp.WithString("owner", mcp.Required(), diff --git a/pkg/github/repositories.go b/pkg/github/repositories.go index 4c168c204..fa69de558 100644 --- a/pkg/github/repositories.go +++ b/pkg/github/repositories.go @@ -18,7 +18,7 @@ func GetCommit(getClient GetClientFn, t translations.TranslationHelperFunc) (too mcp.WithDescription(t("TOOL_GET_COMMITS_DESCRIPTION", "Get details for a commit from a GitHub repository")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_GET_COMMITS_USER_TITLE", "Get commit details"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("owner", mcp.Required(), @@ -90,7 +90,7 @@ func ListCommits(getClient GetClientFn, t translations.TranslationHelperFunc) (t mcp.WithDescription(t("TOOL_LIST_COMMITS_DESCRIPTION", "Get list of commits of a branch in a GitHub repository")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_LIST_COMMITS_USER_TITLE", "List commits"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("owner", mcp.Required(), @@ -164,7 +164,7 @@ func ListBranches(getClient GetClientFn, t translations.TranslationHelperFunc) ( mcp.WithDescription(t("TOOL_LIST_BRANCHES_DESCRIPTION", "List branches in a GitHub repository")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_LIST_BRANCHES_USER_TITLE", "List branches"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("owner", mcp.Required(), @@ -231,7 +231,7 @@ func CreateOrUpdateFile(getClient GetClientFn, t translations.TranslationHelperF mcp.WithDescription(t("TOOL_CREATE_OR_UPDATE_FILE_DESCRIPTION", "Create or update a single file in a GitHub repository. If updating, you must provide the SHA of the file you want to update.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_CREATE_OR_UPDATE_FILE_USER_TITLE", "Create or update file"), - ReadOnlyHint: false, + ReadOnlyHint: toBoolPtr(false), }), mcp.WithString("owner", mcp.Required(), @@ -340,7 +340,7 @@ func CreateRepository(getClient GetClientFn, t translations.TranslationHelperFun mcp.WithDescription(t("TOOL_CREATE_REPOSITORY_DESCRIPTION", "Create a new GitHub repository in your account")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_CREATE_REPOSITORY_USER_TITLE", "Create repository"), - ReadOnlyHint: false, + ReadOnlyHint: toBoolPtr(false), }), mcp.WithString("name", mcp.Required(), @@ -414,7 +414,7 @@ func GetFileContents(getClient GetClientFn, t translations.TranslationHelperFunc mcp.WithDescription(t("TOOL_GET_FILE_CONTENTS_DESCRIPTION", "Get the contents of a file or directory from a GitHub repository")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_GET_FILE_CONTENTS_USER_TITLE", "Get file or directory contents"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("owner", mcp.Required(), @@ -491,7 +491,7 @@ func ForkRepository(getClient GetClientFn, t translations.TranslationHelperFunc) mcp.WithDescription(t("TOOL_FORK_REPOSITORY_DESCRIPTION", "Fork a GitHub repository to your account or specified organization")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_FORK_REPOSITORY_USER_TITLE", "Fork repository"), - ReadOnlyHint: false, + ReadOnlyHint: toBoolPtr(false), }), mcp.WithString("owner", mcp.Required(), @@ -562,7 +562,7 @@ func CreateBranch(getClient GetClientFn, t translations.TranslationHelperFunc) ( mcp.WithDescription(t("TOOL_CREATE_BRANCH_DESCRIPTION", "Create a new branch in a GitHub repository")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_CREATE_BRANCH_USER_TITLE", "Create branch"), - ReadOnlyHint: false, + ReadOnlyHint: toBoolPtr(false), }), mcp.WithString("owner", mcp.Required(), @@ -651,7 +651,7 @@ func PushFiles(getClient GetClientFn, t translations.TranslationHelperFunc) (too mcp.WithDescription(t("TOOL_PUSH_FILES_DESCRIPTION", "Push multiple files to a GitHub repository in a single commit")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_PUSH_FILES_USER_TITLE", "Push files to repository"), - ReadOnlyHint: false, + ReadOnlyHint: toBoolPtr(false), }), mcp.WithString("owner", mcp.Required(), @@ -803,7 +803,7 @@ func ListTags(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.WithDescription(t("TOOL_LIST_TAGS_DESCRIPTION", "List git tags in a GitHub repository")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_LIST_TAGS_USER_TITLE", "List tags"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("owner", mcp.Required(), @@ -868,7 +868,7 @@ func GetTag(getClient GetClientFn, t translations.TranslationHelperFunc) (tool m mcp.WithDescription(t("TOOL_GET_TAG_DESCRIPTION", "Get details about a specific git tag in a GitHub repository")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_GET_TAG_USER_TITLE", "Get tag details"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("owner", mcp.Required(), diff --git a/pkg/github/search.go b/pkg/github/search.go index 86a4f431d..ac5e2994c 100644 --- a/pkg/github/search.go +++ b/pkg/github/search.go @@ -18,7 +18,7 @@ func SearchRepositories(getClient GetClientFn, t translations.TranslationHelperF mcp.WithDescription(t("TOOL_SEARCH_REPOSITORIES_DESCRIPTION", "Search for GitHub repositories")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_SEARCH_REPOSITORIES_USER_TITLE", "Search repositories"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("query", mcp.Required(), @@ -76,7 +76,7 @@ func SearchCode(getClient GetClientFn, t translations.TranslationHelperFunc) (to mcp.WithDescription(t("TOOL_SEARCH_CODE_DESCRIPTION", "Search for code across GitHub repositories")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_SEARCH_CODE_USER_TITLE", "Search code"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("q", mcp.Required(), @@ -152,7 +152,7 @@ func SearchUsers(getClient GetClientFn, t translations.TranslationHelperFunc) (t mcp.WithDescription(t("TOOL_SEARCH_USERS_DESCRIPTION", "Search for GitHub users")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_SEARCH_USERS_USER_TITLE", "Search users"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("q", mcp.Required(), diff --git a/pkg/github/secret_scanning.go b/pkg/github/secret_scanning.go index cd0fd0408..847fcfc6d 100644 --- a/pkg/github/secret_scanning.go +++ b/pkg/github/secret_scanning.go @@ -19,7 +19,7 @@ func GetSecretScanningAlert(getClient GetClientFn, t translations.TranslationHel mcp.WithDescription(t("TOOL_GET_SECRET_SCANNING_ALERT_DESCRIPTION", "Get details of a specific secret scanning alert in a GitHub repository.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_GET_SECRET_SCANNING_ALERT_USER_TITLE", "Get secret scanning alert"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("owner", mcp.Required(), @@ -82,7 +82,7 @@ func ListSecretScanningAlerts(getClient GetClientFn, t translations.TranslationH mcp.WithDescription(t("TOOL_LIST_SECRET_SCANNING_ALERTS_DESCRIPTION", "List secret scanning alerts in a GitHub repository.")), mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_LIST_SECRET_SCANNING_ALERTS_USER_TITLE", "List secret scanning alerts"), - ReadOnlyHint: true, + ReadOnlyHint: toBoolPtr(true), }), mcp.WithString("owner", mcp.Required(), diff --git a/pkg/github/tools.go b/pkg/github/tools.go index 3776a1299..0d8099785 100644 --- a/pkg/github/tools.go +++ b/pkg/github/tools.go @@ -124,3 +124,7 @@ func InitDynamicToolset(s *server.MCPServer, tsg *toolsets.ToolsetGroup, t trans dynamicToolSelection.Enabled = true return dynamicToolSelection } + +func toBoolPtr(b bool) *bool { + return &b +} diff --git a/pkg/toolsets/toolsets.go b/pkg/toolsets/toolsets.go index b316aae30..7400119c8 100644 --- a/pkg/toolsets/toolsets.go +++ b/pkg/toolsets/toolsets.go @@ -59,7 +59,7 @@ func (t *Toolset) SetReadOnly() { func (t *Toolset) AddWriteTools(tools ...server.ServerTool) *Toolset { // Silently ignore if the toolset is read-only to avoid any breach of that contract for _, tool := range tools { - if tool.Tool.Annotations.ReadOnlyHint { + if *tool.Tool.Annotations.ReadOnlyHint { panic(fmt.Sprintf("tool (%s) is incorrectly annotated as read-only", tool.Tool.Name)) } } @@ -71,13 +71,9 @@ func (t *Toolset) AddWriteTools(tools ...server.ServerTool) *Toolset { func (t *Toolset) AddReadTools(tools ...server.ServerTool) *Toolset { for _, tool := range tools { - if !tool.Tool.Annotations.ReadOnlyHint { + if !*tool.Tool.Annotations.ReadOnlyHint { panic(fmt.Sprintf("tool (%s) must be annotated as read-only", tool.Tool.Name)) } - tool.Tool.Annotations = mcp.ToolAnnotation{ - ReadOnlyHint: true, - Title: tool.Tool.Annotations.Title, - } } t.readTools = append(t.readTools, tools...) return t diff --git a/third-party-licenses.darwin.md b/third-party-licenses.darwin.md index 6e47b8211..18c0379e4 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.25.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.27.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/sirupsen/logrus](https://pkg.go.dev/github.com/sirupsen/logrus) ([MIT](https://github.com/sirupsen/logrus/blob/v1.9.3/LICENSE)) diff --git a/third-party-licenses.linux.md b/third-party-licenses.linux.md index 6e47b8211..18c0379e4 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.25.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.27.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/sirupsen/logrus](https://pkg.go.dev/github.com/sirupsen/logrus) ([MIT](https://github.com/sirupsen/logrus/blob/v1.9.3/LICENSE)) diff --git a/third-party-licenses.windows.md b/third-party-licenses.windows.md index 58a1c0001..72f669db9 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.25.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.27.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/sirupsen/logrus](https://pkg.go.dev/github.com/sirupsen/logrus) ([MIT](https://github.com/sirupsen/logrus/blob/v1.9.3/LICENSE)) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy