diff --git a/README.md b/README.md
index bd0963abf..0b275ecb2 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 |
| `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 |
| `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 |
+| `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 |
| `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)
@@ -718,7 +731,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)
@@ -746,48 +759,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)
@@ -812,11 +843,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)
@@ -826,13 +852,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)
@@ -855,6 +874,38 @@ 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)
+
+- **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)
+
+
+
+
+
Repositories
- **create_branch** - Create branch
@@ -863,15 +914,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)
@@ -879,13 +921,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)
@@ -899,27 +934,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)
- - `tag`: Tag name (string, required)
-
- **list_branches** - List branches
- `owner`: Repository owner (string, required)
- `page`: Page number for pagination (min 1) (number, optional)
@@ -934,32 +948,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_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)
@@ -973,14 +961,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)
-
@@ -1038,6 +1018,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
@@ -1078,6 +1113,13 @@ The following sets of tools are available (all are on by default):
#### Specifying Toolsets
+The default configuration of enabled toolsets is:
+- context(should be part of every configuration)
+- users
+- 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**:
diff --git a/cmd/github-mcp-server/main.go b/cmd/github-mcp-server/main.go
old mode 100644
new mode 100755
index 0a4545835..ee869ba62
--- 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, defaults to enabling all")
+ 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/docs/remote-server.md b/docs/remote-server.md
index 7be9d83bb..1b986141e 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 | 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 | 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 | 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 | 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/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/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 dec0a9e37..f6ea1777c 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"
@@ -14,37 +16,106 @@ import (
type GetClientFn func(context.Context) (*github.Client, error)
type GetGQLClientFn func(context.Context) (*githubv4.Client, error)
-var DefaultTools = []string{"all"}
+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"
+ 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"
+)
+
+// DefaultToolsets contains the default toolsets to enable
+var DefaultToolsets = []Toolset{ToolsetContext, ToolsetUsers, 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))
+ for i, toolset := range DefaultToolsets {
+ tools[i] = string(toolset)
+ }
+ 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)
// 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 management").
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)),
- toolsets.NewServerTool(ListStarredRepositories(getClient, t)),
).
AddWriteTools(
- toolsets.NewServerTool(CreateOrUpdateFile(getClient, t)),
toolsets.NewServerTool(CreateRepository(getClient, t)),
toolsets.NewServerTool(ForkRepository(getClient, t)),
toolsets.NewServerTool(CreateBranch(getClient, t)),
+ )
+
+ contents := toolsets.NewToolset(string(ToolsetContents), "Repository contents").
+ AddReadTools(
+ toolsets.NewServerTool(GetFileContents(getClient, getRawClient, t)),
+ ).
+ AddWriteTools(
+ toolsets.NewServerTool(CreateOrUpdateFile(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)),
@@ -53,77 +124,97 @@ 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").
+
+ 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").
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)),
)
- users := toolsets.NewToolset("users", "GitHub User related tools").
+
+ subIssues := toolsets.NewToolset(string(ToolsetSubIssues), "Sub-issue management").
+ 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)),
)
- 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 operations").
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").
+ 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)),
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)),
@@ -135,7 +226,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)),
@@ -143,7 +234,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)),
@@ -163,7 +254,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)),
@@ -172,16 +263,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)),
).
@@ -190,7 +281,7 @@ 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)),
toolsets.NewServerTool(GetProject(getClient, t)),
@@ -205,13 +296,23 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG
toolsets.NewServerTool(UpdateProjectItem(getClient, t)),
)
+ 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)),
+ )
+
// 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)
@@ -222,6 +323,7 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG
tsg.AddToolset(gists)
tsg.AddToolset(securityAdvisories)
tsg.AddToolset(projects)
+ tsg.AddToolset(stargazers)
return tsg
}
@@ -230,7 +332,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)),
@@ -254,3 +356,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
+}