From d42ced3b56365b857a363622cdb9baed8854abee Mon Sep 17 00:00:00 2001 From: tonytrg Date: Thu, 25 Sep 2025 13:17:01 +0200 Subject: [PATCH 01/12] adding default toolset --- cmd/github-mcp-server/main.go | 2 +- go.mod | 2 +- pkg/github/tools.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 cmd/github-mcp-server/main.go diff --git a/cmd/github-mcp-server/main.go b/cmd/github-mcp-server/main.go old mode 100644 new mode 100755 index 0a4545835..3e38cecc6 --- a/cmd/github-mcp-server/main.go +++ b/cmd/github-mcp-server/main.go @@ -69,7 +69,7 @@ func init() { rootCmd.SetVersionTemplate("{{.Short}}\n{{.Version}}\n") // Add global flags that will be shared by all commands - rootCmd.PersistentFlags().StringSlice("toolsets", github.DefaultTools, "An optional comma separated list of groups of tools to allow, defaults to enabling all") + rootCmd.PersistentFlags().StringSlice("toolsets", github.DefaultTools, "An optional comma separated list of groups of tools to allow") rootCmd.PersistentFlags().Bool("dynamic-toolsets", false, "Enable dynamic toolsets") rootCmd.PersistentFlags().Bool("read-only", false, "Restrict the server to read-only operations") rootCmd.PersistentFlags().String("log-file", "", "Path to log file") diff --git a/go.mod b/go.mod index 73a043f8c..61b4b971a 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-viper/mapstructure/v2 v2.4.0 github.com/google/go-github/v71 v71.0.0 // indirect - github.com/google/go-querystring v1.1.0 // indirect + github.com/google/go-querystring v1.1.0 github.com/google/uuid v1.6.0 // indirect github.com/gorilla/mux v1.8.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect diff --git a/pkg/github/tools.go b/pkg/github/tools.go index 7fb5332aa..95778bef2 100644 --- a/pkg/github/tools.go +++ b/pkg/github/tools.go @@ -14,7 +14,7 @@ import ( type GetClientFn func(context.Context) (*github.Client, error) type GetGQLClientFn func(context.Context) (*githubv4.Client, error) -var DefaultTools = []string{"all"} +var DefaultTools = []string{"context", "repos", "issues", "pull_requests"} func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetGQLClientFn, getRawClient raw.GetRawClientFn, t translations.TranslationHelperFunc, contentWindowSize int) *toolsets.ToolsetGroup { tsg := toolsets.NewToolsetGroup(readOnly) From 3a7a498088d4cb933d0e76494e5ecab51982f2c4 Mon Sep 17 00:00:00 2001 From: tonytrg Date: Thu, 25 Sep 2025 15:52:11 +0200 Subject: [PATCH 02/12] extract stargazer toolset --- pkg/github/tools.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/github/tools.go b/pkg/github/tools.go index 95778bef2..3de0118c1 100644 --- a/pkg/github/tools.go +++ b/pkg/github/tools.go @@ -34,7 +34,6 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG toolsets.NewServerTool(ListReleases(getClient, t)), toolsets.NewServerTool(GetLatestRelease(getClient, t)), toolsets.NewServerTool(GetReleaseByTag(getClient, t)), - toolsets.NewServerTool(ListStarredRepositories(getClient, t)), ). AddWriteTools( toolsets.NewServerTool(CreateOrUpdateFile(getClient, t)), @@ -43,8 +42,6 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG toolsets.NewServerTool(CreateBranch(getClient, t)), toolsets.NewServerTool(PushFiles(getClient, t)), toolsets.NewServerTool(DeleteFile(getClient, t)), - toolsets.NewServerTool(StarRepository(getClient, t)), - toolsets.NewServerTool(UnstarRepository(getClient, t)), ). AddResourceTemplates( toolsets.NewServerResourceTemplate(GetRepositoryResourceContent(getClient, getRawClient, t)), @@ -195,6 +192,12 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG toolsets.NewServerTool(ListProjects(getClient, t)), ) + stargazers := toolsets.NewToolset("stargazers", "GitHub Starring related tools"). + AddReadTools(toolsets.NewServerTool(ListStarredRepositories(getClient, t))).AddWriteTools( + toolsets.NewServerTool(StarRepository(getClient, t)), + toolsets.NewServerTool(UnstarRepository(getClient, t)), + ) + // Add toolsets to the group tsg.AddToolset(contextTools) tsg.AddToolset(repos) @@ -212,6 +215,7 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG tsg.AddToolset(gists) tsg.AddToolset(securityAdvisories) tsg.AddToolset(projects) + tsg.AddToolset(stargazers) return tsg } From 69f4f7b083af16a54696d7e6739158629f4c3df1 Mon Sep 17 00:00:00 2001 From: tonytrg Date: Thu, 25 Sep 2025 17:02:08 +0200 Subject: [PATCH 03/12] turn toolsets into types --- pkg/github/tools.go | 62 +++++++++++++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 19 deletions(-) diff --git a/pkg/github/tools.go b/pkg/github/tools.go index 3de0118c1..95ee5efb1 100644 --- a/pkg/github/tools.go +++ b/pkg/github/tools.go @@ -14,14 +14,38 @@ import ( type GetClientFn func(context.Context) (*github.Client, error) type GetGQLClientFn func(context.Context) (*githubv4.Client, error) -var DefaultTools = []string{"context", "repos", "issues", "pull_requests"} +type Toolset string + +const ( + ToolsetContext Toolset = "context" + ToolsetRepos Toolset = "repos" + ToolsetIssues Toolset = "issues" + ToolsetUsers Toolset = "users" + ToolsetOrgs Toolset = "orgs" + ToolsetPullRequests Toolset = "pull_requests" + ToolsetCodeSecurity Toolset = "code_security" + ToolsetSecretProtection Toolset = "secret_protection" + ToolsetDependabot Toolset = "dependabot" + ToolsetNotifications Toolset = "notifications" + ToolsetDiscussions Toolset = "discussions" + ToolsetActions Toolset = "actions" + ToolsetSecurityAdvisories Toolset = "security_advisories" + ToolsetExperiments Toolset = "experiments" + ToolsetGists Toolset = "gists" + ToolsetProjects Toolset = "projects" + ToolsetStargazers Toolset = "stargazers" + ToolsetDynamic Toolset = "dynamic" +) + +// DefaultTools contains the default toolsets to enable +var DefaultTools = []Toolset{ToolsetContext, ToolsetRepos, ToolsetIssues, ToolsetPullRequests} func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetGQLClientFn, getRawClient raw.GetRawClientFn, t translations.TranslationHelperFunc, contentWindowSize int) *toolsets.ToolsetGroup { tsg := toolsets.NewToolsetGroup(readOnly) // Define all available features with their default state (disabled) // Create toolsets - repos := toolsets.NewToolset("repos", "GitHub Repository related tools"). + repos := toolsets.NewToolset(string(ToolsetRepos), "GitHub Repository related tools"). AddReadTools( toolsets.NewServerTool(SearchRepositories(getClient, t)), toolsets.NewServerTool(GetFileContents(getClient, getRawClient, t)), @@ -50,7 +74,7 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG toolsets.NewServerResourceTemplate(GetRepositoryResourceTagContent(getClient, getRawClient, t)), toolsets.NewServerResourceTemplate(GetRepositoryResourcePrContent(getClient, getRawClient, t)), ) - issues := toolsets.NewToolset("issues", "GitHub Issues related tools"). + issues := toolsets.NewToolset(string(ToolsetIssues), "GitHub Issues related tools"). AddReadTools( toolsets.NewServerTool(GetIssue(getClient, t)), toolsets.NewServerTool(SearchIssues(getClient, t)), @@ -71,15 +95,15 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG toolsets.NewServerPrompt(AssignCodingAgentPrompt(t)), toolsets.NewServerPrompt(IssueToFixWorkflowPrompt(t)), ) - users := toolsets.NewToolset("users", "GitHub User related tools"). + users := toolsets.NewToolset(string(ToolsetUsers), "GitHub User related tools"). AddReadTools( toolsets.NewServerTool(SearchUsers(getClient, t)), ) - orgs := toolsets.NewToolset("orgs", "GitHub Organization related tools"). + orgs := toolsets.NewToolset(string(ToolsetOrgs), "GitHub Organization related tools"). AddReadTools( toolsets.NewServerTool(SearchOrgs(getClient, t)), ) - pullRequests := toolsets.NewToolset("pull_requests", "GitHub Pull Request related tools"). + pullRequests := toolsets.NewToolset(string(ToolsetPullRequests), "GitHub Pull Request related tools"). AddReadTools( toolsets.NewServerTool(GetPullRequest(getClient, t)), toolsets.NewServerTool(ListPullRequests(getClient, t)), @@ -104,23 +128,23 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG toolsets.NewServerTool(SubmitPendingPullRequestReview(getGQLClient, t)), toolsets.NewServerTool(DeletePendingPullRequestReview(getGQLClient, t)), ) - codeSecurity := toolsets.NewToolset("code_security", "Code security related tools, such as GitHub Code Scanning"). + codeSecurity := toolsets.NewToolset(string(ToolsetCodeSecurity), "Code security related tools, such as GitHub Code Scanning"). AddReadTools( toolsets.NewServerTool(GetCodeScanningAlert(getClient, t)), toolsets.NewServerTool(ListCodeScanningAlerts(getClient, t)), ) - secretProtection := toolsets.NewToolset("secret_protection", "Secret protection related tools, such as GitHub Secret Scanning"). + secretProtection := toolsets.NewToolset(string(ToolsetSecretProtection), "Secret protection related tools, such as GitHub Secret Scanning"). AddReadTools( toolsets.NewServerTool(GetSecretScanningAlert(getClient, t)), toolsets.NewServerTool(ListSecretScanningAlerts(getClient, t)), ) - dependabot := toolsets.NewToolset("dependabot", "Dependabot tools"). + dependabot := toolsets.NewToolset(string(ToolsetDependabot), "Dependabot tools"). AddReadTools( toolsets.NewServerTool(GetDependabotAlert(getClient, t)), toolsets.NewServerTool(ListDependabotAlerts(getClient, t)), ) - notifications := toolsets.NewToolset("notifications", "GitHub Notifications related tools"). + notifications := toolsets.NewToolset(string(ToolsetNotifications), "GitHub Notifications related tools"). AddReadTools( toolsets.NewServerTool(ListNotifications(getClient, t)), toolsets.NewServerTool(GetNotificationDetails(getClient, t)), @@ -132,7 +156,7 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG toolsets.NewServerTool(ManageRepositoryNotificationSubscription(getClient, t)), ) - discussions := toolsets.NewToolset("discussions", "GitHub Discussions related tools"). + discussions := toolsets.NewToolset(string(ToolsetDiscussions), "GitHub Discussions related tools"). AddReadTools( toolsets.NewServerTool(ListDiscussions(getGQLClient, t)), toolsets.NewServerTool(GetDiscussion(getGQLClient, t)), @@ -140,7 +164,7 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG toolsets.NewServerTool(ListDiscussionCategories(getGQLClient, t)), ) - actions := toolsets.NewToolset("actions", "GitHub Actions workflows and CI/CD operations"). + actions := toolsets.NewToolset(string(ToolsetActions), "GitHub Actions workflows and CI/CD operations"). AddReadTools( toolsets.NewServerTool(ListWorkflows(getClient, t)), toolsets.NewServerTool(ListWorkflowRuns(getClient, t)), @@ -160,7 +184,7 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG toolsets.NewServerTool(DeleteWorkflowRunLogs(getClient, t)), ) - securityAdvisories := toolsets.NewToolset("security_advisories", "Security advisories related tools"). + securityAdvisories := toolsets.NewToolset(string(ToolsetSecurityAdvisories), "Security advisories related tools"). AddReadTools( toolsets.NewServerTool(ListGlobalSecurityAdvisories(getClient, t)), toolsets.NewServerTool(GetGlobalSecurityAdvisory(getClient, t)), @@ -169,16 +193,16 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG ) // Keep experiments alive so the system doesn't error out when it's always enabled - experiments := toolsets.NewToolset("experiments", "Experimental features that are not considered stable yet") + experiments := toolsets.NewToolset(string(ToolsetExperiments), "Experimental features that are not considered stable yet") - contextTools := toolsets.NewToolset("context", "Tools that provide context about the current user and GitHub context you are operating in"). + contextTools := toolsets.NewToolset(string(ToolsetContext), "Tools that provide context about the current user and GitHub context you are operating in"). AddReadTools( toolsets.NewServerTool(GetMe(getClient, t)), toolsets.NewServerTool(GetTeams(getClient, getGQLClient, t)), toolsets.NewServerTool(GetTeamMembers(getGQLClient, t)), ) - gists := toolsets.NewToolset("gists", "GitHub Gist related tools"). + gists := toolsets.NewToolset(string(ToolsetGists), "GitHub Gist related tools"). AddReadTools( toolsets.NewServerTool(ListGists(getClient, t)), ). @@ -187,12 +211,12 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG toolsets.NewServerTool(UpdateGist(getClient, t)), ) - projects := toolsets.NewToolset("projects", "GitHub Projects related tools"). + projects := toolsets.NewToolset(string(ToolsetProjects), "GitHub Projects related tools"). AddReadTools( toolsets.NewServerTool(ListProjects(getClient, t)), ) - stargazers := toolsets.NewToolset("stargazers", "GitHub Starring related tools"). + stargazers := toolsets.NewToolset(string(ToolsetStargazers), "GitHub Starring related tools"). AddReadTools(toolsets.NewServerTool(ListStarredRepositories(getClient, t))).AddWriteTools( toolsets.NewServerTool(StarRepository(getClient, t)), toolsets.NewServerTool(UnstarRepository(getClient, t)), @@ -224,7 +248,7 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG func InitDynamicToolset(s *server.MCPServer, tsg *toolsets.ToolsetGroup, t translations.TranslationHelperFunc) *toolsets.Toolset { // Create a new dynamic toolset // Need to add the dynamic toolset last so it can be used to enable other toolsets - dynamicToolSelection := toolsets.NewToolset("dynamic", "Discover GitHub MCP tools that can help achieve tasks by enabling additional sets of tools, you can control the enablement of any toolset to access its tools when this toolset is enabled."). + dynamicToolSelection := toolsets.NewToolset(string(ToolsetDynamic), "Discover GitHub MCP tools that can help achieve tasks by enabling additional sets of tools, you can control the enablement of any toolset to access its tools when this toolset is enabled."). AddReadTools( toolsets.NewServerTool(ListAvailableToolsets(tsg, t)), toolsets.NewServerTool(GetToolsetsTools(tsg, t)), From c91c4d0407267d92df9066434ff0a40d25944fef Mon Sep 17 00:00:00 2001 From: tonytrg Date: Thu, 25 Sep 2025 17:18:59 +0200 Subject: [PATCH 04/12] extracting into subspecializations for tools --- cmd/github-mcp-server/main.go | 2 +- pkg/github/tools.go | 78 +++++++++++++++++++++++++---------- 2 files changed, 57 insertions(+), 23 deletions(-) diff --git a/cmd/github-mcp-server/main.go b/cmd/github-mcp-server/main.go index 3e38cecc6..e3fd126e8 100755 --- a/cmd/github-mcp-server/main.go +++ b/cmd/github-mcp-server/main.go @@ -69,7 +69,7 @@ func init() { rootCmd.SetVersionTemplate("{{.Short}}\n{{.Version}}\n") // Add global flags that will be shared by all commands - rootCmd.PersistentFlags().StringSlice("toolsets", github.DefaultTools, "An optional comma separated list of groups of tools to allow") + rootCmd.PersistentFlags().StringSlice("toolsets", github.DefaultTools(), "An optional comma separated list of groups of tools to allow") rootCmd.PersistentFlags().Bool("dynamic-toolsets", false, "Enable dynamic toolsets") rootCmd.PersistentFlags().Bool("read-only", false, "Restrict the server to read-only operations") rootCmd.PersistentFlags().String("log-file", "", "Path to log file") diff --git a/pkg/github/tools.go b/pkg/github/tools.go index 95ee5efb1..22fc68a69 100644 --- a/pkg/github/tools.go +++ b/pkg/github/tools.go @@ -19,10 +19,14 @@ type Toolset string const ( ToolsetContext Toolset = "context" ToolsetRepos Toolset = "repos" + ToolsetContents Toolset = "contents" + ToolsetReleases Toolset = "releases" ToolsetIssues Toolset = "issues" + ToolsetSubIssues Toolset = "sub_issues" ToolsetUsers Toolset = "users" ToolsetOrgs Toolset = "orgs" ToolsetPullRequests Toolset = "pull_requests" + ToolsetPullRequestReviews Toolset = "pull_request_reviews" ToolsetCodeSecurity Toolset = "code_security" ToolsetSecretProtection Toolset = "secret_protection" ToolsetDependabot Toolset = "dependabot" @@ -37,35 +41,33 @@ const ( ToolsetDynamic Toolset = "dynamic" ) -// DefaultTools contains the default toolsets to enable -var DefaultTools = []Toolset{ToolsetContext, ToolsetRepos, ToolsetIssues, ToolsetPullRequests} +// DefaultToolsets contains the default toolsets to enable +var DefaultToolsets = []Toolset{ToolsetContext, ToolsetRepos, ToolsetIssues, ToolsetPullRequests} + +// DefaultTools returns the default toolset names as strings for CLI flags +func DefaultTools() []string { + return []string{string(ToolsetContext), string(ToolsetRepos), string(ToolsetIssues), string(ToolsetPullRequests)} +} func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetGQLClientFn, getRawClient raw.GetRawClientFn, t translations.TranslationHelperFunc, contentWindowSize int) *toolsets.ToolsetGroup { tsg := toolsets.NewToolsetGroup(readOnly) // Define all available features with their default state (disabled) // Create toolsets - repos := toolsets.NewToolset(string(ToolsetRepos), "GitHub Repository related tools"). + repos := toolsets.NewToolset(string(ToolsetRepos), "GitHub Repository management - search, create, fork, branches, commits, tags"). AddReadTools( toolsets.NewServerTool(SearchRepositories(getClient, t)), - toolsets.NewServerTool(GetFileContents(getClient, getRawClient, t)), toolsets.NewServerTool(ListCommits(getClient, t)), toolsets.NewServerTool(SearchCode(getClient, t)), toolsets.NewServerTool(GetCommit(getClient, t)), toolsets.NewServerTool(ListBranches(getClient, t)), toolsets.NewServerTool(ListTags(getClient, t)), toolsets.NewServerTool(GetTag(getClient, t)), - toolsets.NewServerTool(ListReleases(getClient, t)), - toolsets.NewServerTool(GetLatestRelease(getClient, t)), - toolsets.NewServerTool(GetReleaseByTag(getClient, t)), ). AddWriteTools( - toolsets.NewServerTool(CreateOrUpdateFile(getClient, t)), toolsets.NewServerTool(CreateRepository(getClient, t)), toolsets.NewServerTool(ForkRepository(getClient, t)), toolsets.NewServerTool(CreateBranch(getClient, t)), - toolsets.NewServerTool(PushFiles(getClient, t)), - toolsets.NewServerTool(DeleteFile(getClient, t)), ). AddResourceTemplates( toolsets.NewServerResourceTemplate(GetRepositoryResourceContent(getClient, getRawClient, t)), @@ -74,27 +76,51 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG toolsets.NewServerResourceTemplate(GetRepositoryResourceTagContent(getClient, getRawClient, t)), toolsets.NewServerResourceTemplate(GetRepositoryResourcePrContent(getClient, getRawClient, t)), ) - issues := toolsets.NewToolset(string(ToolsetIssues), "GitHub Issues related tools"). + + contents := toolsets.NewToolset(string(ToolsetContents), "Repository contents - get, create, update, delete files and directories"). + AddReadTools( + toolsets.NewServerTool(GetFileContents(getClient, getRawClient, t)), + ). + AddWriteTools( + toolsets.NewServerTool(CreateOrUpdateFile(getClient, t)), + toolsets.NewServerTool(PushFiles(getClient, t)), + toolsets.NewServerTool(DeleteFile(getClient, t)), + ) + + releases := toolsets.NewToolset(string(ToolsetReleases), "GitHub Repository releases - list, get, and manage releases"). + AddReadTools( + toolsets.NewServerTool(ListReleases(getClient, t)), + toolsets.NewServerTool(GetLatestRelease(getClient, t)), + toolsets.NewServerTool(GetReleaseByTag(getClient, t)), + ) + + issues := toolsets.NewToolset(string(ToolsetIssues), "GitHub Issues - create, read, update, comment on issues"). AddReadTools( toolsets.NewServerTool(GetIssue(getClient, t)), toolsets.NewServerTool(SearchIssues(getClient, t)), toolsets.NewServerTool(ListIssues(getGQLClient, t)), toolsets.NewServerTool(GetIssueComments(getClient, t)), toolsets.NewServerTool(ListIssueTypes(getClient, t)), - toolsets.NewServerTool(ListSubIssues(getClient, t)), ). AddWriteTools( toolsets.NewServerTool(CreateIssue(getClient, t)), toolsets.NewServerTool(AddIssueComment(getClient, t)), toolsets.NewServerTool(UpdateIssue(getClient, getGQLClient, t)), toolsets.NewServerTool(AssignCopilotToIssue(getGQLClient, t)), - toolsets.NewServerTool(AddSubIssue(getClient, t)), - toolsets.NewServerTool(RemoveSubIssue(getClient, t)), - toolsets.NewServerTool(ReprioritizeSubIssue(getClient, t)), ).AddPrompts( toolsets.NewServerPrompt(AssignCodingAgentPrompt(t)), toolsets.NewServerPrompt(IssueToFixWorkflowPrompt(t)), ) + + subIssues := toolsets.NewToolset(string(ToolsetSubIssues), "Sub-issue management - create, manage, and organize sub-issues"). + AddReadTools( + toolsets.NewServerTool(ListSubIssues(getClient, t)), + ). + AddWriteTools( + toolsets.NewServerTool(AddSubIssue(getClient, t)), + toolsets.NewServerTool(RemoveSubIssue(getClient, t)), + toolsets.NewServerTool(ReprioritizeSubIssue(getClient, t)), + ) users := toolsets.NewToolset(string(ToolsetUsers), "GitHub User related tools"). AddReadTools( toolsets.NewServerTool(SearchUsers(getClient, t)), @@ -103,25 +129,29 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG AddReadTools( toolsets.NewServerTool(SearchOrgs(getClient, t)), ) - pullRequests := toolsets.NewToolset(string(ToolsetPullRequests), "GitHub Pull Request related tools"). + pullRequests := toolsets.NewToolset(string(ToolsetPullRequests), "GitHub Pull Request operations - create, read, update, merge"). AddReadTools( toolsets.NewServerTool(GetPullRequest(getClient, t)), toolsets.NewServerTool(ListPullRequests(getClient, t)), toolsets.NewServerTool(GetPullRequestFiles(getClient, t)), toolsets.NewServerTool(SearchPullRequests(getClient, t)), toolsets.NewServerTool(GetPullRequestStatus(getClient, t)), - toolsets.NewServerTool(GetPullRequestReviewComments(getClient, t)), - toolsets.NewServerTool(GetPullRequestReviews(getClient, t)), toolsets.NewServerTool(GetPullRequestDiff(getClient, t)), ). AddWriteTools( - toolsets.NewServerTool(MergePullRequest(getClient, t)), - toolsets.NewServerTool(UpdatePullRequestBranch(getClient, t)), toolsets.NewServerTool(CreatePullRequest(getClient, t)), toolsets.NewServerTool(UpdatePullRequest(getClient, getGQLClient, t)), - toolsets.NewServerTool(RequestCopilotReview(getClient, t)), + toolsets.NewServerTool(MergePullRequest(getClient, t)), + toolsets.NewServerTool(UpdatePullRequestBranch(getClient, t)), + ) - // Reviews + pullRequestReviews := toolsets.NewToolset(string(ToolsetPullRequestReviews), "Pull request review operations - create, submit, manage reviews"). + AddReadTools( + toolsets.NewServerTool(GetPullRequestReviewComments(getClient, t)), + toolsets.NewServerTool(GetPullRequestReviews(getClient, t)), + ). + AddWriteTools( + toolsets.NewServerTool(RequestCopilotReview(getClient, t)), toolsets.NewServerTool(CreateAndSubmitPullRequestReview(getGQLClient, t)), toolsets.NewServerTool(CreatePendingPullRequestReview(getGQLClient, t)), toolsets.NewServerTool(AddCommentToPendingReview(getGQLClient, t)), @@ -225,10 +255,14 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG // Add toolsets to the group tsg.AddToolset(contextTools) tsg.AddToolset(repos) + tsg.AddToolset(contents) + tsg.AddToolset(releases) tsg.AddToolset(issues) + tsg.AddToolset(subIssues) tsg.AddToolset(orgs) tsg.AddToolset(users) tsg.AddToolset(pullRequests) + tsg.AddToolset(pullRequestReviews) tsg.AddToolset(actions) tsg.AddToolset(codeSecurity) tsg.AddToolset(secretProtection) From 4b1e7e32d4788c0fa96779fe76f86d29e23eb6eb Mon Sep 17 00:00:00 2001 From: tonytrg Date: Thu, 25 Sep 2025 17:21:10 +0200 Subject: [PATCH 05/12] experimental split --- pkg/github/tools.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/github/tools.go b/pkg/github/tools.go index 22fc68a69..5bcda0e26 100644 --- a/pkg/github/tools.go +++ b/pkg/github/tools.go @@ -68,13 +68,6 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG toolsets.NewServerTool(CreateRepository(getClient, t)), toolsets.NewServerTool(ForkRepository(getClient, t)), toolsets.NewServerTool(CreateBranch(getClient, t)), - ). - AddResourceTemplates( - toolsets.NewServerResourceTemplate(GetRepositoryResourceContent(getClient, getRawClient, t)), - toolsets.NewServerResourceTemplate(GetRepositoryResourceBranchContent(getClient, getRawClient, t)), - toolsets.NewServerResourceTemplate(GetRepositoryResourceCommitContent(getClient, getRawClient, t)), - toolsets.NewServerResourceTemplate(GetRepositoryResourceTagContent(getClient, getRawClient, t)), - toolsets.NewServerResourceTemplate(GetRepositoryResourcePrContent(getClient, getRawClient, t)), ) contents := toolsets.NewToolset(string(ToolsetContents), "Repository contents - get, create, update, delete files and directories"). @@ -85,6 +78,13 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG toolsets.NewServerTool(CreateOrUpdateFile(getClient, t)), toolsets.NewServerTool(PushFiles(getClient, t)), toolsets.NewServerTool(DeleteFile(getClient, t)), + ). + AddResourceTemplates( + toolsets.NewServerResourceTemplate(GetRepositoryResourceContent(getClient, getRawClient, t)), + toolsets.NewServerResourceTemplate(GetRepositoryResourceBranchContent(getClient, getRawClient, t)), + toolsets.NewServerResourceTemplate(GetRepositoryResourceCommitContent(getClient, getRawClient, t)), + toolsets.NewServerResourceTemplate(GetRepositoryResourceTagContent(getClient, getRawClient, t)), + toolsets.NewServerResourceTemplate(GetRepositoryResourcePrContent(getClient, getRawClient, t)), ) releases := toolsets.NewToolset(string(ToolsetReleases), "GitHub Repository releases - list, get, and manage releases"). From 325d6ef774031586d3352b8aa4646069190dd983 Mon Sep 17 00:00:00 2001 From: tonytrg Date: Mon, 29 Sep 2025 12:19:57 +0200 Subject: [PATCH 06/12] adding default toolsets --- README.md | 273 ++++++++++++++++++++++++------------------ docs/remote-server.md | 11 +- 2 files changed, 162 insertions(+), 122 deletions(-) diff --git a/README.md b/README.md index 9a96cfd04..dbd0e8f73 100644 --- a/README.md +++ b/README.md @@ -281,18 +281,23 @@ The following sets of tools are available (all are on by default): | `context` | **Strongly recommended**: Tools that provide context about the current user and GitHub context you are operating in | | `actions` | GitHub Actions workflows and CI/CD operations | | `code_security` | Code security related tools, such as GitHub Code Scanning | +| `contents` | Repository contents - get, create, update, delete files and directories | | `dependabot` | Dependabot tools | | `discussions` | GitHub Discussions related tools | | `experiments` | Experimental features that are not considered stable yet | | `gists` | GitHub Gist related tools | -| `issues` | GitHub Issues related tools | +| `issues` | GitHub Issues - create, read, update, comment on issues | | `notifications` | GitHub Notifications related tools | | `orgs` | GitHub Organization related tools | | `projects` | GitHub Projects related tools | -| `pull_requests` | GitHub Pull Request related tools | -| `repos` | GitHub Repository related tools | +| `pull_request_reviews` | Pull request review operations - create, submit, manage reviews | +| `pull_requests` | GitHub Pull Request operations - create, read, update, merge | +| `releases` | GitHub Repository releases - list, get, and manage releases | +| `repos` | GitHub Repository management - search, create, fork, branches, commits, tags | | `secret_protection` | Secret protection related tools, such as GitHub Secret Scanning | | `security_advisories` | Security advisories related tools | +| `stargazers` | GitHub Starring related tools | +| `sub_issues` | Sub-issue management - create, manage, and organize sub-issues | | `users` | GitHub User related tools | @@ -415,6 +420,42 @@ The following sets of tools are available (all are on by default):
+Contents + +- **create_or_update_file** - Create or update file + - `branch`: Branch to create/update the file in (string, required) + - `content`: Content of the file (string, required) + - `message`: Commit message (string, required) + - `owner`: Repository owner (username or organization) (string, required) + - `path`: Path where to create/update the file (string, required) + - `repo`: Repository name (string, required) + - `sha`: Required if updating an existing file. The blob SHA of the file being replaced. (string, optional) + +- **delete_file** - Delete file + - `branch`: Branch to delete the file from (string, required) + - `message`: Commit message (string, required) + - `owner`: Repository owner (username or organization) (string, required) + - `path`: Path to the file to delete (string, required) + - `repo`: Repository name (string, required) + +- **get_file_contents** - Get file or directory contents + - `owner`: Repository owner (username or organization) (string, required) + - `path`: Path to file/directory (directories must end with a slash '/') (string, optional) + - `ref`: Accepts optional git refs such as `refs/tags/{tag}`, `refs/heads/{branch}` or `refs/pull/{pr_number}/head` (string, optional) + - `repo`: Repository name (string, required) + - `sha`: Accepts optional commit SHA. If specified, it will be used instead of ref (string, optional) + +- **push_files** - Push files to repository + - `branch`: Branch to push to (string, required) + - `files`: Array of file objects to push, each object with path (string) and content (string) (object[], required) + - `message`: Commit message (string, required) + - `owner`: Repository owner (string, required) + - `repo`: Repository name (string, required) + +
+ +
+ Context - **get_me** - Get my user profile @@ -511,13 +552,6 @@ The following sets of tools are available (all are on by default): - `owner`: Repository owner (string, required) - `repo`: Repository name (string, required) -- **add_sub_issue** - Add sub-issue - - `issue_number`: The number of the parent issue (number, required) - - `owner`: Repository owner (string, required) - - `replace_parent`: When true, replaces the sub-issue's current parent issue (boolean, optional) - - `repo`: Repository name (string, required) - - `sub_issue_id`: The ID of the sub-issue to add. ID is not the same as issue number (number, required) - - **assign_copilot_to_issue** - Assign Copilot to issue - `issueNumber`: Issue number (number, required) - `owner`: Repository owner (string, required) @@ -559,27 +593,6 @@ The following sets of tools are available (all are on by default): - `since`: Filter by date (ISO 8601 timestamp) (string, optional) - `state`: Filter by state, by default both open and closed issues are returned when not provided (string, optional) -- **list_sub_issues** - List sub-issues - - `issue_number`: Issue number (number, required) - - `owner`: Repository owner (string, required) - - `page`: Page number for pagination (default: 1) (number, optional) - - `per_page`: Number of results per page (max 100, default: 30) (number, optional) - - `repo`: Repository name (string, required) - -- **remove_sub_issue** - Remove sub-issue - - `issue_number`: The number of the parent issue (number, required) - - `owner`: Repository owner (string, required) - - `repo`: Repository name (string, required) - - `sub_issue_id`: The ID of the sub-issue to remove. ID is not the same as issue number (number, required) - -- **reprioritize_sub_issue** - Reprioritize sub-issue - - `after_id`: The ID of the sub-issue to be prioritized after (either after_id OR before_id should be specified) (number, optional) - - `before_id`: The ID of the sub-issue to be prioritized before (either after_id OR before_id should be specified) (number, optional) - - `issue_number`: The number of the parent issue (number, required) - - `owner`: Repository owner (string, required) - - `repo`: Repository name (string, required) - - `sub_issue_id`: The ID of the sub-issue to reprioritize. ID is not the same as issue number (number, required) - - **search_issues** - Search issues - `order`: Sort order (string, optional) - `owner`: Optional repository owner. If provided with repo, only issues for this repository are listed. (string, optional) @@ -670,7 +683,7 @@ The following sets of tools are available (all are on by default):
-Pull Requests +Pull Request Reviews - **add_comment_to_pending_review** - Add review comment to the requester's latest pending pull request review - `body`: The text of the review comment (string, required) @@ -698,48 +711,66 @@ The following sets of tools are available (all are on by default): - `pullNumber`: Pull request number (number, required) - `repo`: Repository name (string, required) -- **create_pull_request** - Open new pull request - - `base`: Branch to merge into (string, required) - - `body`: PR description (string, optional) - - `draft`: Create as draft PR (boolean, optional) - - `head`: Branch containing changes (string, required) - - `maintainer_can_modify`: Allow maintainer edits (boolean, optional) +- **delete_pending_pull_request_review** - Delete the requester's latest pending pull request review - `owner`: Repository owner (string, required) + - `pullNumber`: Pull request number (number, required) - `repo`: Repository name (string, required) - - `title`: PR title (string, required) -- **delete_pending_pull_request_review** - Delete the requester's latest pending pull request review +- **get_pull_request_review_comments** - Get pull request review comments - `owner`: Repository owner (string, required) - `pullNumber`: Pull request number (number, required) - `repo`: Repository name (string, required) -- **get_pull_request** - Get pull request details +- **get_pull_request_reviews** - Get pull request reviews - `owner`: Repository owner (string, required) - `pullNumber`: Pull request number (number, required) - `repo`: Repository name (string, required) -- **get_pull_request_diff** - Get pull request diff +- **request_copilot_review** - Request Copilot review - `owner`: Repository owner (string, required) - `pullNumber`: Pull request number (number, required) - `repo`: Repository name (string, required) -- **get_pull_request_files** - Get pull request files +- **submit_pending_pull_request_review** - Submit the requester's latest pending pull request review + - `body`: The text of the review comment (string, optional) + - `event`: The event to perform (string, required) - `owner`: Repository owner (string, required) - - `page`: Page number for pagination (min 1) (number, optional) - - `perPage`: Results per page for pagination (min 1, max 100) (number, optional) - `pullNumber`: Pull request number (number, required) - `repo`: Repository name (string, required) -- **get_pull_request_review_comments** - Get pull request review comments +
+ +
+ +Pull Requests + +- **create_pull_request** - Open new pull request + - `base`: Branch to merge into (string, required) + - `body`: PR description (string, optional) + - `draft`: Create as draft PR (boolean, optional) + - `head`: Branch containing changes (string, required) + - `maintainer_can_modify`: Allow maintainer edits (boolean, optional) + - `owner`: Repository owner (string, required) + - `repo`: Repository name (string, required) + - `title`: PR title (string, required) + +- **get_pull_request** - Get pull request details - `owner`: Repository owner (string, required) - `pullNumber`: Pull request number (number, required) - `repo`: Repository name (string, required) -- **get_pull_request_reviews** - Get pull request reviews +- **get_pull_request_diff** - Get pull request diff - `owner`: Repository owner (string, required) - `pullNumber`: Pull request number (number, required) - `repo`: Repository name (string, required) +- **get_pull_request_files** - Get pull request files + - `owner`: Repository owner (string, required) + - `page`: Page number for pagination (min 1) (number, optional) + - `perPage`: Results per page for pagination (min 1, max 100) (number, optional) + - `pullNumber`: Pull request number (number, required) + - `repo`: Repository name (string, required) + - **get_pull_request_status** - Get pull request status checks - `owner`: Repository owner (string, required) - `pullNumber`: Pull request number (number, required) @@ -764,11 +795,6 @@ The following sets of tools are available (all are on by default): - `pullNumber`: Pull request number (number, required) - `repo`: Repository name (string, required) -- **request_copilot_review** - Request Copilot review - - `owner`: Repository owner (string, required) - - `pullNumber`: Pull request number (number, required) - - `repo`: Repository name (string, required) - - **search_pull_requests** - Search pull requests - `order`: Sort order (string, optional) - `owner`: Optional repository owner. If provided with repo, only pull requests for this repository are listed. (string, optional) @@ -778,13 +804,6 @@ The following sets of tools are available (all are on by default): - `repo`: Optional repository name. If provided with owner, only pull requests for this repository are listed. (string, optional) - `sort`: Sort field by number of matches of categories, defaults to best match (string, optional) -- **submit_pending_pull_request_review** - Submit the requester's latest pending pull request review - - `body`: The text of the review comment (string, optional) - - `event`: The event to perform (string, required) - - `owner`: Repository owner (string, required) - - `pullNumber`: Pull request number (number, required) - - `repo`: Repository name (string, required) - - **update_pull_request** - Edit pull request - `base`: New base branch name (string, optional) - `body`: New description (string, optional) @@ -807,6 +826,27 @@ The following sets of tools are available (all are on by default):
+Releases + +- **get_latest_release** - Get latest release + - `owner`: Repository owner (string, required) + - `repo`: Repository name (string, required) + +- **get_release_by_tag** - Get a release by tag name + - `owner`: Repository owner (string, required) + - `repo`: Repository name (string, required) + - `tag`: Tag name (e.g., 'v1.0.0') (string, required) + +- **list_releases** - List releases + - `owner`: Repository owner (string, required) + - `page`: Page number for pagination (min 1) (number, optional) + - `perPage`: Results per page for pagination (min 1, max 100) (number, optional) + - `repo`: Repository name (string, required) + +
+ +
+ Repositories - **create_branch** - Create branch @@ -815,15 +855,6 @@ The following sets of tools are available (all are on by default): - `owner`: Repository owner (string, required) - `repo`: Repository name (string, required) -- **create_or_update_file** - Create or update file - - `branch`: Branch to create/update the file in (string, required) - - `content`: Content of the file (string, required) - - `message`: Commit message (string, required) - - `owner`: Repository owner (username or organization) (string, required) - - `path`: Path where to create/update the file (string, required) - - `repo`: Repository name (string, required) - - `sha`: Required if updating an existing file. The blob SHA of the file being replaced. (string, optional) - - **create_repository** - Create repository - `autoInit`: Initialize with README (boolean, optional) - `description`: Repository description (string, optional) @@ -831,13 +862,6 @@ The following sets of tools are available (all are on by default): - `organization`: Organization to create the repository in (omit to create in your personal account) (string, optional) - `private`: Whether repo should be private (boolean, optional) -- **delete_file** - Delete file - - `branch`: Branch to delete the file from (string, required) - - `message`: Commit message (string, required) - - `owner`: Repository owner (username or organization) (string, required) - - `path`: Path to the file to delete (string, required) - - `repo`: Repository name (string, required) - - **fork_repository** - Fork repository - `organization`: Organization to fork to (string, optional) - `owner`: Repository owner (string, required) @@ -851,22 +875,6 @@ The following sets of tools are available (all are on by default): - `repo`: Repository name (string, required) - `sha`: Commit SHA, branch name, or tag name (string, required) -- **get_file_contents** - Get file or directory contents - - `owner`: Repository owner (username or organization) (string, required) - - `path`: Path to file/directory (directories must end with a slash '/') (string, optional) - - `ref`: Accepts optional git refs such as `refs/tags/{tag}`, `refs/heads/{branch}` or `refs/pull/{pr_number}/head` (string, optional) - - `repo`: Repository name (string, required) - - `sha`: Accepts optional commit SHA. If specified, it will be used instead of ref (string, optional) - -- **get_latest_release** - Get latest release - - `owner`: Repository owner (string, required) - - `repo`: Repository name (string, required) - -- **get_release_by_tag** - Get a release by tag name - - `owner`: Repository owner (string, required) - - `repo`: Repository name (string, required) - - `tag`: Tag name (e.g., 'v1.0.0') (string, required) - - **get_tag** - Get tag details - `owner`: Repository owner (string, required) - `repo`: Repository name (string, required) @@ -886,32 +894,12 @@ The following sets of tools are available (all are on by default): - `repo`: Repository name (string, required) - `sha`: Commit SHA, branch or tag name to list commits of. If not provided, uses the default branch of the repository. If a commit SHA is provided, will list commits up to that SHA. (string, optional) -- **list_releases** - List releases - - `owner`: Repository owner (string, required) - - `page`: Page number for pagination (min 1) (number, optional) - - `perPage`: Results per page for pagination (min 1, max 100) (number, optional) - - `repo`: Repository name (string, required) - -- **list_starred_repositories** - List starred repositories - - `direction`: The direction to sort the results by. (string, optional) - - `page`: Page number for pagination (min 1) (number, optional) - - `perPage`: Results per page for pagination (min 1, max 100) (number, optional) - - `sort`: How to sort the results. Can be either 'created' (when the repository was starred) or 'updated' (when the repository was last pushed to). (string, optional) - - `username`: Username to list starred repositories for. Defaults to the authenticated user. (string, optional) - - **list_tags** - List tags - `owner`: Repository owner (string, required) - `page`: Page number for pagination (min 1) (number, optional) - `perPage`: Results per page for pagination (min 1, max 100) (number, optional) - `repo`: Repository name (string, required) -- **push_files** - Push files to repository - - `branch`: Branch to push to (string, required) - - `files`: Array of file objects to push, each object with path (string) and content (string) (object[], required) - - `message`: Commit message (string, required) - - `owner`: Repository owner (string, required) - - `repo`: Repository name (string, required) - - **search_code** - Search code - `order`: Sort order for results (string, optional) - `page`: Page number for pagination (min 1) (number, optional) @@ -925,14 +913,6 @@ The following sets of tools are available (all are on by default): - `perPage`: Results per page for pagination (min 1, max 100) (number, optional) - `query`: Repository search query. Examples: 'machine learning in:name stars:>1000 language:python', 'topic:react', 'user:facebook'. Supports advanced search syntax for precise filtering. (string, required) -- **star_repository** - Star repository - - `owner`: Repository owner (string, required) - - `repo`: Repository name (string, required) - -- **unstar_repository** - Unstar repository - - `owner`: Repository owner (string, required) - - `repo`: Repository name (string, required) -
@@ -990,6 +970,61 @@ The following sets of tools are available (all are on by default):
+Stargazers + +- **list_starred_repositories** - List starred repositories + - `direction`: The direction to sort the results by. (string, optional) + - `page`: Page number for pagination (min 1) (number, optional) + - `perPage`: Results per page for pagination (min 1, max 100) (number, optional) + - `sort`: How to sort the results. Can be either 'created' (when the repository was starred) or 'updated' (when the repository was last pushed to). (string, optional) + - `username`: Username to list starred repositories for. Defaults to the authenticated user. (string, optional) + +- **star_repository** - Star repository + - `owner`: Repository owner (string, required) + - `repo`: Repository name (string, required) + +- **unstar_repository** - Unstar repository + - `owner`: Repository owner (string, required) + - `repo`: Repository name (string, required) + +
+ +
+ +Sub Issues + +- **add_sub_issue** - Add sub-issue + - `issue_number`: The number of the parent issue (number, required) + - `owner`: Repository owner (string, required) + - `replace_parent`: When true, replaces the sub-issue's current parent issue (boolean, optional) + - `repo`: Repository name (string, required) + - `sub_issue_id`: The ID of the sub-issue to add. ID is not the same as issue number (number, required) + +- **list_sub_issues** - List sub-issues + - `issue_number`: Issue number (number, required) + - `owner`: Repository owner (string, required) + - `page`: Page number for pagination (default: 1) (number, optional) + - `per_page`: Number of results per page (max 100, default: 30) (number, optional) + - `repo`: Repository name (string, required) + +- **remove_sub_issue** - Remove sub-issue + - `issue_number`: The number of the parent issue (number, required) + - `owner`: Repository owner (string, required) + - `repo`: Repository name (string, required) + - `sub_issue_id`: The ID of the sub-issue to remove. ID is not the same as issue number (number, required) + +- **reprioritize_sub_issue** - Reprioritize sub-issue + - `after_id`: The ID of the sub-issue to be prioritized after (either after_id OR before_id should be specified) (number, optional) + - `before_id`: The ID of the sub-issue to be prioritized before (either after_id OR before_id should be specified) (number, optional) + - `issue_number`: The number of the parent issue (number, required) + - `owner`: Repository owner (string, required) + - `repo`: Repository name (string, required) + - `sub_issue_id`: The ID of the sub-issue to reprioritize. ID is not the same as issue number (number, required) + +
+ +
+ Users - **search_users** - Search users diff --git a/docs/remote-server.md b/docs/remote-server.md index 7be9d83bb..49a982e36 100644 --- a/docs/remote-server.md +++ b/docs/remote-server.md @@ -22,18 +22,23 @@ Below is a table of available toolsets for the remote GitHub MCP Server. Each to | all | All available GitHub MCP tools | https://api.githubcopilot.com/mcp/ | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=github&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2F%22%7D) | [read-only](https://api.githubcopilot.com/mcp/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=github&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Freadonly%22%7D) | | Actions | GitHub Actions workflows and CI/CD operations | https://api.githubcopilot.com/mcp/x/actions | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-actions&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Factions%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/actions/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-actions&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Factions%2Freadonly%22%7D) | | Code Security | Code security related tools, such as GitHub Code Scanning | https://api.githubcopilot.com/mcp/x/code_security | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-code_security&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fcode_security%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/code_security/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-code_security&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fcode_security%2Freadonly%22%7D) | +| Contents | Repository contents - get, create, update, delete files and directories | https://api.githubcopilot.com/mcp/x/contents | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-contents&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fcontents%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/contents/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-contents&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fcontents%2Freadonly%22%7D) | | Dependabot | Dependabot tools | https://api.githubcopilot.com/mcp/x/dependabot | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-dependabot&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fdependabot%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/dependabot/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-dependabot&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fdependabot%2Freadonly%22%7D) | | Discussions | GitHub Discussions related tools | https://api.githubcopilot.com/mcp/x/discussions | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-discussions&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fdiscussions%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/discussions/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-discussions&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fdiscussions%2Freadonly%22%7D) | | Experiments | Experimental features that are not considered stable yet | https://api.githubcopilot.com/mcp/x/experiments | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-experiments&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fexperiments%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/experiments/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-experiments&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fexperiments%2Freadonly%22%7D) | | Gists | GitHub Gist related tools | https://api.githubcopilot.com/mcp/x/gists | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-gists&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fgists%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/gists/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-gists&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fgists%2Freadonly%22%7D) | -| Issues | GitHub Issues related tools | https://api.githubcopilot.com/mcp/x/issues | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-issues&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fissues%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/issues/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-issues&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fissues%2Freadonly%22%7D) | +| Issues | GitHub Issues - create, read, update, comment on issues | https://api.githubcopilot.com/mcp/x/issues | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-issues&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fissues%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/issues/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-issues&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fissues%2Freadonly%22%7D) | | Notifications | GitHub Notifications related tools | https://api.githubcopilot.com/mcp/x/notifications | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-notifications&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fnotifications%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/notifications/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-notifications&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fnotifications%2Freadonly%22%7D) | | Organizations | GitHub Organization related tools | https://api.githubcopilot.com/mcp/x/orgs | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-orgs&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Forgs%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/orgs/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-orgs&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Forgs%2Freadonly%22%7D) | | Projects | GitHub Projects related tools | https://api.githubcopilot.com/mcp/x/projects | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-projects&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fprojects%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/projects/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-projects&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fprojects%2Freadonly%22%7D) | -| Pull Requests | GitHub Pull Request related tools | https://api.githubcopilot.com/mcp/x/pull_requests | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-pull_requests&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fpull_requests%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/pull_requests/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-pull_requests&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fpull_requests%2Freadonly%22%7D) | -| Repositories | GitHub Repository related tools | https://api.githubcopilot.com/mcp/x/repos | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-repos&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Frepos%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/repos/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-repos&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Frepos%2Freadonly%22%7D) | +| Pull Request Reviews | Pull request review operations - create, submit, manage reviews | https://api.githubcopilot.com/mcp/x/pull_request_reviews | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-pull_request_reviews&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fpull_request_reviews%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/pull_request_reviews/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-pull_request_reviews&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fpull_request_reviews%2Freadonly%22%7D) | +| Pull Requests | GitHub Pull Request operations - create, read, update, merge | https://api.githubcopilot.com/mcp/x/pull_requests | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-pull_requests&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fpull_requests%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/pull_requests/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-pull_requests&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fpull_requests%2Freadonly%22%7D) | +| Releases | GitHub Repository releases - list, get, and manage releases | https://api.githubcopilot.com/mcp/x/releases | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-releases&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Freleases%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/releases/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-releases&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Freleases%2Freadonly%22%7D) | +| Repositories | GitHub Repository management - search, create, fork, branches, commits, tags | https://api.githubcopilot.com/mcp/x/repos | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-repos&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Frepos%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/repos/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-repos&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Frepos%2Freadonly%22%7D) | | Secret Protection | Secret protection related tools, such as GitHub Secret Scanning | https://api.githubcopilot.com/mcp/x/secret_protection | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-secret_protection&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fsecret_protection%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/secret_protection/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-secret_protection&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fsecret_protection%2Freadonly%22%7D) | | Security Advisories | Security advisories related tools | https://api.githubcopilot.com/mcp/x/security_advisories | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-security_advisories&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fsecurity_advisories%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/security_advisories/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-security_advisories&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fsecurity_advisories%2Freadonly%22%7D) | +| Stargazers | GitHub Starring related tools | https://api.githubcopilot.com/mcp/x/stargazers | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-stargazers&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fstargazers%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/stargazers/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-stargazers&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fstargazers%2Freadonly%22%7D) | +| Sub Issues | Sub-issue management - create, manage, and organize sub-issues | https://api.githubcopilot.com/mcp/x/sub_issues | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-sub_issues&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fsub_issues%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/sub_issues/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-sub_issues&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fsub_issues%2Freadonly%22%7D) | | Users | GitHub User related tools | https://api.githubcopilot.com/mcp/x/users | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-users&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fusers%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/users/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-users&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fusers%2Freadonly%22%7D) | From 247031c41207f83c8e1e39ec627b49279857d21f Mon Sep 17 00:00:00 2001 From: tonytrg Date: Mon, 29 Sep 2025 19:12:23 +0200 Subject: [PATCH 07/12] test new setup --- README.md | 36 ++++++++++++++++++------------------ docs/remote-server.md | 14 +++++++------- pkg/github/tools.go | 26 +++++++++++++++----------- 3 files changed, 40 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index dbd0e8f73..522335c98 100644 --- a/README.md +++ b/README.md @@ -281,23 +281,23 @@ The following sets of tools are available (all are on by default): | `context` | **Strongly recommended**: Tools that provide context about the current user and GitHub context you are operating in | | `actions` | GitHub Actions workflows and CI/CD operations | | `code_security` | Code security related tools, such as GitHub Code Scanning | -| `contents` | Repository contents - get, create, update, delete files and directories | +| `contents` | Repository contents | | `dependabot` | Dependabot tools | | `discussions` | GitHub Discussions related tools | | `experiments` | Experimental features that are not considered stable yet | | `gists` | GitHub Gist related tools | -| `issues` | GitHub Issues - create, read, update, comment on issues | +| `issues` | GitHub Issues | | `notifications` | GitHub Notifications related tools | | `orgs` | GitHub Organization related tools | | `projects` | GitHub Projects related tools | -| `pull_request_reviews` | Pull request review operations - create, submit, manage reviews | -| `pull_requests` | GitHub Pull Request operations - create, read, update, merge | -| `releases` | GitHub Repository releases - list, get, and manage releases | -| `repos` | GitHub Repository management - search, create, fork, branches, commits, tags | +| `pull_request_reviews` | Pull request review operations | +| `pull_requests` | GitHub Pull Request operations | +| `releases` | GitHub Repository releases/tags | +| `repos` | GitHub Repository management | | `secret_protection` | Secret protection related tools, such as GitHub Secret Scanning | | `security_advisories` | Security advisories related tools | | `stargazers` | GitHub Starring related tools | -| `sub_issues` | Sub-issue management - create, manage, and organize sub-issues | +| `sub_issues` | Sub-issue management | | `users` | GitHub User related tools | @@ -837,12 +837,23 @@ The following sets of tools are available (all are on by default): - `repo`: Repository name (string, required) - `tag`: Tag name (e.g., 'v1.0.0') (string, required) +- **get_tag** - Get tag details + - `owner`: Repository owner (string, required) + - `repo`: Repository name (string, required) + - `tag`: Tag name (string, required) + - **list_releases** - List releases - `owner`: Repository owner (string, required) - `page`: Page number for pagination (min 1) (number, optional) - `perPage`: Results per page for pagination (min 1, max 100) (number, optional) - `repo`: Repository name (string, required) +- **list_tags** - List tags + - `owner`: Repository owner (string, required) + - `page`: Page number for pagination (min 1) (number, optional) + - `perPage`: Results per page for pagination (min 1, max 100) (number, optional) + - `repo`: Repository name (string, required) +
@@ -875,11 +886,6 @@ The following sets of tools are available (all are on by default): - `repo`: Repository name (string, required) - `sha`: Commit SHA, branch name, or tag name (string, required) -- **get_tag** - Get tag details - - `owner`: Repository owner (string, required) - - `repo`: Repository name (string, required) - - `tag`: Tag name (string, required) - - **list_branches** - List branches - `owner`: Repository owner (string, required) - `page`: Page number for pagination (min 1) (number, optional) @@ -894,12 +900,6 @@ The following sets of tools are available (all are on by default): - `repo`: Repository name (string, required) - `sha`: Commit SHA, branch or tag name to list commits of. If not provided, uses the default branch of the repository. If a commit SHA is provided, will list commits up to that SHA. (string, optional) -- **list_tags** - List tags - - `owner`: Repository owner (string, required) - - `page`: Page number for pagination (min 1) (number, optional) - - `perPage`: Results per page for pagination (min 1, max 100) (number, optional) - - `repo`: Repository name (string, required) - - **search_code** - Search code - `order`: Sort order for results (string, optional) - `page`: Page number for pagination (min 1) (number, optional) diff --git a/docs/remote-server.md b/docs/remote-server.md index 49a982e36..1b986141e 100644 --- a/docs/remote-server.md +++ b/docs/remote-server.md @@ -22,23 +22,23 @@ Below is a table of available toolsets for the remote GitHub MCP Server. Each to | all | All available GitHub MCP tools | https://api.githubcopilot.com/mcp/ | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=github&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2F%22%7D) | [read-only](https://api.githubcopilot.com/mcp/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=github&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Freadonly%22%7D) | | Actions | GitHub Actions workflows and CI/CD operations | https://api.githubcopilot.com/mcp/x/actions | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-actions&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Factions%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/actions/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-actions&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Factions%2Freadonly%22%7D) | | Code Security | Code security related tools, such as GitHub Code Scanning | https://api.githubcopilot.com/mcp/x/code_security | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-code_security&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fcode_security%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/code_security/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-code_security&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fcode_security%2Freadonly%22%7D) | -| Contents | Repository contents - get, create, update, delete files and directories | https://api.githubcopilot.com/mcp/x/contents | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-contents&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fcontents%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/contents/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-contents&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fcontents%2Freadonly%22%7D) | +| Contents | Repository contents | https://api.githubcopilot.com/mcp/x/contents | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-contents&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fcontents%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/contents/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-contents&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fcontents%2Freadonly%22%7D) | | Dependabot | Dependabot tools | https://api.githubcopilot.com/mcp/x/dependabot | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-dependabot&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fdependabot%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/dependabot/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-dependabot&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fdependabot%2Freadonly%22%7D) | | Discussions | GitHub Discussions related tools | https://api.githubcopilot.com/mcp/x/discussions | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-discussions&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fdiscussions%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/discussions/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-discussions&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fdiscussions%2Freadonly%22%7D) | | Experiments | Experimental features that are not considered stable yet | https://api.githubcopilot.com/mcp/x/experiments | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-experiments&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fexperiments%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/experiments/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-experiments&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fexperiments%2Freadonly%22%7D) | | Gists | GitHub Gist related tools | https://api.githubcopilot.com/mcp/x/gists | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-gists&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fgists%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/gists/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-gists&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fgists%2Freadonly%22%7D) | -| Issues | GitHub Issues - create, read, update, comment on issues | https://api.githubcopilot.com/mcp/x/issues | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-issues&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fissues%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/issues/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-issues&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fissues%2Freadonly%22%7D) | +| Issues | GitHub Issues | https://api.githubcopilot.com/mcp/x/issues | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-issues&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fissues%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/issues/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-issues&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fissues%2Freadonly%22%7D) | | Notifications | GitHub Notifications related tools | https://api.githubcopilot.com/mcp/x/notifications | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-notifications&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fnotifications%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/notifications/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-notifications&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fnotifications%2Freadonly%22%7D) | | Organizations | GitHub Organization related tools | https://api.githubcopilot.com/mcp/x/orgs | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-orgs&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Forgs%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/orgs/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-orgs&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Forgs%2Freadonly%22%7D) | | Projects | GitHub Projects related tools | https://api.githubcopilot.com/mcp/x/projects | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-projects&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fprojects%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/projects/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-projects&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fprojects%2Freadonly%22%7D) | -| Pull Request Reviews | Pull request review operations - create, submit, manage reviews | https://api.githubcopilot.com/mcp/x/pull_request_reviews | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-pull_request_reviews&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fpull_request_reviews%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/pull_request_reviews/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-pull_request_reviews&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fpull_request_reviews%2Freadonly%22%7D) | -| Pull Requests | GitHub Pull Request operations - create, read, update, merge | https://api.githubcopilot.com/mcp/x/pull_requests | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-pull_requests&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fpull_requests%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/pull_requests/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-pull_requests&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fpull_requests%2Freadonly%22%7D) | -| Releases | GitHub Repository releases - list, get, and manage releases | https://api.githubcopilot.com/mcp/x/releases | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-releases&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Freleases%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/releases/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-releases&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Freleases%2Freadonly%22%7D) | -| Repositories | GitHub Repository management - search, create, fork, branches, commits, tags | https://api.githubcopilot.com/mcp/x/repos | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-repos&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Frepos%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/repos/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-repos&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Frepos%2Freadonly%22%7D) | +| Pull Request Reviews | Pull request review operations | https://api.githubcopilot.com/mcp/x/pull_request_reviews | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-pull_request_reviews&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fpull_request_reviews%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/pull_request_reviews/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-pull_request_reviews&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fpull_request_reviews%2Freadonly%22%7D) | +| Pull Requests | GitHub Pull Request operations | https://api.githubcopilot.com/mcp/x/pull_requests | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-pull_requests&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fpull_requests%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/pull_requests/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-pull_requests&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fpull_requests%2Freadonly%22%7D) | +| Releases | GitHub Repository releases/tags | https://api.githubcopilot.com/mcp/x/releases | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-releases&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Freleases%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/releases/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-releases&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Freleases%2Freadonly%22%7D) | +| Repositories | GitHub Repository management | https://api.githubcopilot.com/mcp/x/repos | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-repos&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Frepos%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/repos/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-repos&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Frepos%2Freadonly%22%7D) | | Secret Protection | Secret protection related tools, such as GitHub Secret Scanning | https://api.githubcopilot.com/mcp/x/secret_protection | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-secret_protection&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fsecret_protection%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/secret_protection/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-secret_protection&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fsecret_protection%2Freadonly%22%7D) | | Security Advisories | Security advisories related tools | https://api.githubcopilot.com/mcp/x/security_advisories | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-security_advisories&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fsecurity_advisories%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/security_advisories/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-security_advisories&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fsecurity_advisories%2Freadonly%22%7D) | | Stargazers | GitHub Starring related tools | https://api.githubcopilot.com/mcp/x/stargazers | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-stargazers&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fstargazers%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/stargazers/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-stargazers&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fstargazers%2Freadonly%22%7D) | -| Sub Issues | Sub-issue management - create, manage, and organize sub-issues | https://api.githubcopilot.com/mcp/x/sub_issues | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-sub_issues&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fsub_issues%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/sub_issues/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-sub_issues&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fsub_issues%2Freadonly%22%7D) | +| Sub Issues | Sub-issue management | https://api.githubcopilot.com/mcp/x/sub_issues | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-sub_issues&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fsub_issues%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/sub_issues/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-sub_issues&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fsub_issues%2Freadonly%22%7D) | | Users | GitHub User related tools | https://api.githubcopilot.com/mcp/x/users | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-users&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fusers%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/users/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-users&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fusers%2Freadonly%22%7D) | diff --git a/pkg/github/tools.go b/pkg/github/tools.go index 5bcda0e26..44b5211fa 100644 --- a/pkg/github/tools.go +++ b/pkg/github/tools.go @@ -42,11 +42,15 @@ const ( ) // DefaultToolsets contains the default toolsets to enable -var DefaultToolsets = []Toolset{ToolsetContext, ToolsetRepos, ToolsetIssues, ToolsetPullRequests} +var DefaultToolsets = []Toolset{ToolsetContext, ToolsetRepos, ToolsetContents, ToolsetPullRequests} // DefaultTools returns the default toolset names as strings for CLI flags func DefaultTools() []string { - return []string{string(ToolsetContext), string(ToolsetRepos), string(ToolsetIssues), string(ToolsetPullRequests)} + tools := make([]string, len(DefaultToolsets)) + for i, toolset := range DefaultToolsets { + tools[i] = string(toolset) + } + return tools } func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetGQLClientFn, getRawClient raw.GetRawClientFn, t translations.TranslationHelperFunc, contentWindowSize int) *toolsets.ToolsetGroup { @@ -54,15 +58,13 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG // Define all available features with their default state (disabled) // Create toolsets - repos := toolsets.NewToolset(string(ToolsetRepos), "GitHub Repository management - search, create, fork, branches, commits, tags"). + repos := toolsets.NewToolset(string(ToolsetRepos), "GitHub Repository management"). AddReadTools( toolsets.NewServerTool(SearchRepositories(getClient, t)), toolsets.NewServerTool(ListCommits(getClient, t)), toolsets.NewServerTool(SearchCode(getClient, t)), toolsets.NewServerTool(GetCommit(getClient, t)), toolsets.NewServerTool(ListBranches(getClient, t)), - toolsets.NewServerTool(ListTags(getClient, t)), - toolsets.NewServerTool(GetTag(getClient, t)), ). AddWriteTools( toolsets.NewServerTool(CreateRepository(getClient, t)), @@ -70,7 +72,7 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG toolsets.NewServerTool(CreateBranch(getClient, t)), ) - contents := toolsets.NewToolset(string(ToolsetContents), "Repository contents - get, create, update, delete files and directories"). + contents := toolsets.NewToolset(string(ToolsetContents), "Repository contents"). AddReadTools( toolsets.NewServerTool(GetFileContents(getClient, getRawClient, t)), ). @@ -87,14 +89,16 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG toolsets.NewServerResourceTemplate(GetRepositoryResourcePrContent(getClient, getRawClient, t)), ) - releases := toolsets.NewToolset(string(ToolsetReleases), "GitHub Repository releases - list, get, and manage releases"). + releases := toolsets.NewToolset(string(ToolsetReleases), "GitHub Repository releases/tags"). AddReadTools( toolsets.NewServerTool(ListReleases(getClient, t)), toolsets.NewServerTool(GetLatestRelease(getClient, t)), toolsets.NewServerTool(GetReleaseByTag(getClient, t)), + toolsets.NewServerTool(ListTags(getClient, t)), + toolsets.NewServerTool(GetTag(getClient, t)), ) - issues := toolsets.NewToolset(string(ToolsetIssues), "GitHub Issues - create, read, update, comment on issues"). + issues := toolsets.NewToolset(string(ToolsetIssues), "GitHub Issues"). AddReadTools( toolsets.NewServerTool(GetIssue(getClient, t)), toolsets.NewServerTool(SearchIssues(getClient, t)), @@ -112,7 +116,7 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG toolsets.NewServerPrompt(IssueToFixWorkflowPrompt(t)), ) - subIssues := toolsets.NewToolset(string(ToolsetSubIssues), "Sub-issue management - create, manage, and organize sub-issues"). + subIssues := toolsets.NewToolset(string(ToolsetSubIssues), "Sub-issue management"). AddReadTools( toolsets.NewServerTool(ListSubIssues(getClient, t)), ). @@ -129,7 +133,7 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG AddReadTools( toolsets.NewServerTool(SearchOrgs(getClient, t)), ) - pullRequests := toolsets.NewToolset(string(ToolsetPullRequests), "GitHub Pull Request operations - create, read, update, merge"). + pullRequests := toolsets.NewToolset(string(ToolsetPullRequests), "GitHub Pull Request operations"). AddReadTools( toolsets.NewServerTool(GetPullRequest(getClient, t)), toolsets.NewServerTool(ListPullRequests(getClient, t)), @@ -145,7 +149,7 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG toolsets.NewServerTool(UpdatePullRequestBranch(getClient, t)), ) - pullRequestReviews := toolsets.NewToolset(string(ToolsetPullRequestReviews), "Pull request review operations - create, submit, manage reviews"). + pullRequestReviews := toolsets.NewToolset(string(ToolsetPullRequestReviews), "Pull request review operations"). AddReadTools( toolsets.NewServerTool(GetPullRequestReviewComments(getClient, t)), toolsets.NewServerTool(GetPullRequestReviews(getClient, t)), From 3a4b2ccd2dd175d83fbd4a3ef30e6e02e3af2690 Mon Sep 17 00:00:00 2001 From: tonytrg Date: Tue, 30 Sep 2025 09:21:16 +0200 Subject: [PATCH 08/12] add available tools --- pkg/github/tools.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/pkg/github/tools.go b/pkg/github/tools.go index 44b5211fa..ddc67edd8 100644 --- a/pkg/github/tools.go +++ b/pkg/github/tools.go @@ -44,6 +44,32 @@ const ( // DefaultToolsets contains the default toolsets to enable var DefaultToolsets = []Toolset{ToolsetContext, ToolsetRepos, ToolsetContents, ToolsetPullRequests} +// AvailableToolsets contains all available toolsets +var AvailableToolsets = []Toolset{ + ToolsetContext, + ToolsetRepos, + ToolsetContents, + ToolsetReleases, + ToolsetIssues, + ToolsetSubIssues, + ToolsetUsers, + ToolsetOrgs, + ToolsetPullRequests, + ToolsetPullRequestReviews, + ToolsetCodeSecurity, + ToolsetSecretProtection, + ToolsetDependabot, + ToolsetNotifications, + ToolsetDiscussions, + ToolsetActions, + ToolsetSecurityAdvisories, + ToolsetExperiments, + ToolsetGists, + ToolsetProjects, + ToolsetStargazers, + ToolsetDynamic, +} + // DefaultTools returns the default toolset names as strings for CLI flags func DefaultTools() []string { tools := make([]string, len(DefaultToolsets)) From a7f54cace375969846823336f5d8948a5c65ffe3 Mon Sep 17 00:00:00 2001 From: tonytrg Date: Tue, 30 Sep 2025 10:36:53 +0200 Subject: [PATCH 09/12] add fix for e2e --- cmd/github-mcp-server/main.go | 7 +++++- e2e/e2e_test.go | 16 +++++++------ pkg/github/tools.go | 44 +++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 8 deletions(-) diff --git a/cmd/github-mcp-server/main.go b/cmd/github-mcp-server/main.go index e3fd126e8..ee869ba62 100755 --- a/cmd/github-mcp-server/main.go +++ b/cmd/github-mcp-server/main.go @@ -45,6 +45,11 @@ var ( return fmt.Errorf("failed to unmarshal toolsets: %w", err) } + // If no toolsets are specified, use the default ones + if len(enabledToolsets) == 0 { + enabledToolsets = github.DefaultTools() + } + stdioServerConfig := ghmcp.StdioServerConfig{ Version: version, Host: viper.GetString("host"), @@ -69,7 +74,7 @@ func init() { rootCmd.SetVersionTemplate("{{.Short}}\n{{.Version}}\n") // Add global flags that will be shared by all commands - rootCmd.PersistentFlags().StringSlice("toolsets", github.DefaultTools(), "An optional comma separated list of groups of tools to allow") + rootCmd.PersistentFlags().StringSlice("toolsets", nil, github.GenerateToolsetsHelp()) rootCmd.PersistentFlags().Bool("dynamic-toolsets", false, "Enable dynamic toolsets") rootCmd.PersistentFlags().Bool("read-only", false, "Restrict the server to read-only operations") rootCmd.PersistentFlags().String("log-file", "", "Path to log file") diff --git a/e2e/e2e_test.go b/e2e/e2e_test.go index 24cfc7096..ae898d305 100644 --- a/e2e/e2e_test.go +++ b/e2e/e2e_test.go @@ -16,7 +16,6 @@ import ( "time" "github.com/github/github-mcp-server/internal/ghmcp" - "github.com/github/github-mcp-server/pkg/github" "github.com/github/github-mcp-server/pkg/translations" gogithub "github.com/google/go-github/v74/github" mcpClient "github.com/mark3labs/mcp-go/client" @@ -141,9 +140,12 @@ func setupMCPClient(t *testing.T, options ...clientOption) *mcpClient.Client { } // Add toolsets environment variable to the Docker arguments - if len(opts.enabledToolsets) > 0 { - args = append(args, "-e", "GITHUB_TOOLSETS") + // Default to "all" if no specific toolsets are configured + enabledToolsets := opts.enabledToolsets + if len(enabledToolsets) == 0 { + enabledToolsets = []string{"all"} } + args = append(args, "-e", "GITHUB_TOOLSETS") // Add the image name args = append(args, "github/e2e-github-mcp-server") @@ -151,7 +153,7 @@ func setupMCPClient(t *testing.T, options ...clientOption) *mcpClient.Client { // Construct the env vars for the MCP Client to execute docker with dockerEnvVars := []string{ fmt.Sprintf("GITHUB_PERSONAL_ACCESS_TOKEN=%s", token), - fmt.Sprintf("GITHUB_TOOLSETS=%s", strings.Join(opts.enabledToolsets, ",")), + fmt.Sprintf("GITHUB_TOOLSETS=%s", strings.Join(enabledToolsets, ",")), } if host != "" { @@ -168,8 +170,8 @@ func setupMCPClient(t *testing.T, options ...clientOption) *mcpClient.Client { // not in scope for using the MCP server directly. This probably indicates that we should refactor // so that there is a shared setup mechanism, but let's wait till we feel more friction. enabledToolsets := opts.enabledToolsets - if enabledToolsets == nil { - enabledToolsets = github.DefaultTools + if len(enabledToolsets) == 0 { + enabledToolsets = []string{"all"} } ghServer, err := ghmcp.NewMCPServer(ghmcp.MCPServerConfig{ @@ -190,7 +192,7 @@ func setupMCPClient(t *testing.T, options ...clientOption) *mcpClient.Client { }) // Initialize the client - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() request := mcp.InitializeRequest{} diff --git a/pkg/github/tools.go b/pkg/github/tools.go index ddc67edd8..26f2fb5bd 100644 --- a/pkg/github/tools.go +++ b/pkg/github/tools.go @@ -2,6 +2,8 @@ package github import ( "context" + "fmt" + "strings" "github.com/github/github-mcp-server/pkg/raw" "github.com/github/github-mcp-server/pkg/toolsets" @@ -79,6 +81,14 @@ func DefaultTools() []string { return tools } +func AvailableTools() []string { + tools := make([]string, len(AvailableToolsets)) + for i, toolset := range AvailableToolsets { + tools[i] = string(toolset) + } + return tools +} + func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetGQLClientFn, getRawClient raw.GetRawClientFn, t translations.TranslationHelperFunc, contentWindowSize int) *toolsets.ToolsetGroup { tsg := toolsets.NewToolsetGroup(readOnly) @@ -336,3 +346,37 @@ func ToStringPtr(s string) *string { } return &s } + +// GenerateToolsetsHelp generates the help text for the toolsets flag +func GenerateToolsetsHelp() string { + // Format default tools + defaultTools := strings.Join(DefaultTools(), ", ") + + // Format available tools with line breaks for better readability + allTools := AvailableTools() + var availableToolsLines []string + const maxLineLength = 70 + currentLine := "" + + for i, tool := range allTools { + if i == 0 { + currentLine = tool + } else if len(currentLine)+len(tool)+2 <= maxLineLength { + currentLine += ", " + tool + } else { + availableToolsLines = append(availableToolsLines, currentLine) + currentLine = tool + } + } + if currentLine != "" { + availableToolsLines = append(availableToolsLines, currentLine) + } + + availableTools := strings.Join(availableToolsLines, ",\n\t ") + + toolsetsHelp := fmt.Sprintf("Comma-separated list of tool groups to enable (no spaces).\n"+ + "Default: %s\n"+ + "To enable all tools, use all\n"+ + "Available: %s", defaultTools, availableTools) + return toolsetsHelp +} From 94a5f8aac8aad3fd8ec83c762e2516c654bcb221 Mon Sep 17 00:00:00 2001 From: tonytrg Date: Tue, 30 Sep 2025 10:46:01 +0200 Subject: [PATCH 10/12] adding section to readme --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 421653c43..caa8338a3 100644 --- a/README.md +++ b/README.md @@ -1113,6 +1113,12 @@ The following sets of tools are available (all are on by default): #### Specifying Toolsets +The default configuration of enabled toolsets is: +- context +- content +- repos +- pull_requests + To specify toolsets you want available to the LLM, you can pass an allow-list in two ways: 1. **Using Command Line Argument**: From a594eaa47ee117dfd741f27cad82b51051bf26cc Mon Sep 17 00:00:00 2001 From: tonytrg Date: Tue, 30 Sep 2025 11:04:44 +0200 Subject: [PATCH 11/12] adding users --- README.md | 1 + pkg/github/tools.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index caa8338a3..7d25f8df9 100644 --- a/README.md +++ b/README.md @@ -1115,6 +1115,7 @@ The following sets of tools are available (all are on by default): The default configuration of enabled toolsets is: - context +- users - content - repos - pull_requests diff --git a/pkg/github/tools.go b/pkg/github/tools.go index 891f8787f..d0bda4686 100644 --- a/pkg/github/tools.go +++ b/pkg/github/tools.go @@ -44,7 +44,7 @@ const ( ) // DefaultToolsets contains the default toolsets to enable -var DefaultToolsets = []Toolset{ToolsetContext, ToolsetRepos, ToolsetContents, ToolsetPullRequests} +var DefaultToolsets = []Toolset{ToolsetContext, ToolsetUsers, ToolsetRepos, ToolsetContents, ToolsetPullRequests, ToolsetIssues} // AvailableToolsets contains all available toolsets var AvailableToolsets = []Toolset{ From d7bf6f588d805cb0b8134ec4cb8f12d31d7aa435 Mon Sep 17 00:00:00 2001 From: tonytrg Date: Tue, 30 Sep 2025 11:20:02 +0200 Subject: [PATCH 12/12] removing issues again --- README.md | 2 +- pkg/github/tools.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7d25f8df9..0b275ecb2 100644 --- a/README.md +++ b/README.md @@ -1114,7 +1114,7 @@ The following sets of tools are available (all are on by default): #### Specifying Toolsets The default configuration of enabled toolsets is: -- context +- context(should be part of every configuration) - users - content - repos diff --git a/pkg/github/tools.go b/pkg/github/tools.go index d0bda4686..f6ea1777c 100644 --- a/pkg/github/tools.go +++ b/pkg/github/tools.go @@ -44,7 +44,7 @@ const ( ) // DefaultToolsets contains the default toolsets to enable -var DefaultToolsets = []Toolset{ToolsetContext, ToolsetUsers, ToolsetRepos, ToolsetContents, ToolsetPullRequests, ToolsetIssues} +var DefaultToolsets = []Toolset{ToolsetContext, ToolsetUsers, ToolsetRepos, ToolsetContents, ToolsetPullRequests} // AvailableToolsets contains all available toolsets var AvailableToolsets = []Toolset{