Skip to content

Commit 388bffd

Browse files
authored
Merge branch 'main' into babbage/link-registry-publish-to-docker-image
2 parents 4856038 + dee5927 commit 388bffd

15 files changed

+653
-722
lines changed

README.md

Lines changed: 93 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,17 @@ Alternatively, to manually configure VS Code, choose the appropriate JSON block
8686
> **Note:** Each MCP host application needs to configure a GitHub App or OAuth App to support remote access via OAuth. Any host application that supports remote MCP servers should support the remote GitHub server with PAT authentication. Configuration details and support levels vary by host. Make sure to refer to the host application's documentation for more info.
8787
8888
### Configuration
89-
See [Remote Server Documentation](/docs/remote-server.md) on how to pass additional configuration settings to the remote GitHub MCP Server.
89+
90+
#### Default toolset configuration
91+
92+
The default configuration is:
93+
- context
94+
- repos
95+
- issues
96+
- pull_requests
97+
- users
98+
99+
See [Remote Server Documentation](docs/remote-server.md) for full details on remote server configuration, toolsets, headers, and advanced usage. This file provides comprehensive instructions and examples for connecting, customizing, and installing the remote GitHub MCP Server in VS Code and other MCP hosts.
90100

91101
---
92102

@@ -271,6 +281,50 @@ The GitHub MCP Server supports enabling or disabling specific groups of function
271281

272282
_Toolsets are not limited to Tools. Relevant MCP Resources and Prompts are also included where applicable._
273283

284+
The Local GitHub MCP Server follows the same [default toolset configuration](#default-toolset-configuration) as the remote version.
285+
286+
#### Specifying Toolsets
287+
288+
To specify toolsets you want available to the LLM, you can pass an allow-list in two ways:
289+
290+
1. **Using Command Line Argument**:
291+
292+
```bash
293+
github-mcp-server --toolsets repos,issues,pull_requests,actions,code_security
294+
```
295+
296+
2. **Using Environment Variable**:
297+
```bash
298+
GITHUB_TOOLSETS="repos,issues,pull_requests,actions,code_security" ./github-mcp-server
299+
```
300+
301+
The environment variable `GITHUB_TOOLSETS` takes precedence over the command line argument if both are provided.
302+
303+
### Using Toolsets With Docker
304+
305+
When using Docker, you can pass the toolsets as environment variables:
306+
307+
```bash
308+
docker run -i --rm \
309+
-e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
310+
-e GITHUB_TOOLSETS="repos,issues,pull_requests,actions,code_security,experiments" \
311+
ghcr.io/github/github-mcp-server
312+
```
313+
314+
### The "all" Toolset
315+
316+
The special toolset `all` can be provided to enable all available toolsets regardless of any other configuration:
317+
318+
```bash
319+
./github-mcp-server --toolsets all
320+
```
321+
322+
Or using the environment variable:
323+
324+
```bash
325+
GITHUB_TOOLSETS="all" ./github-mcp-server
326+
```
327+
274328
### Available Toolsets
275329

276330
The following sets of tools are available (all are on by default):
@@ -293,12 +347,12 @@ The following sets of tools are available (all are on by default):
293347
| `repos` | GitHub Repository related tools |
294348
| `secret_protection` | Secret protection related tools, such as GitHub Secret Scanning |
295349
| `security_advisories` | Security advisories related tools |
350+
| `stargazers` | GitHub Stargazers related tools |
296351
| `users` | GitHub User related tools |
297352
<!-- END AUTOMATED TOOLSETS -->
298353

299354
## Tools
300355

301-
302356
<!-- START AUTOMATED TOOLS -->
303357
<details>
304358

@@ -754,38 +808,6 @@ The following sets of tools are available (all are on by default):
754808
- `pullNumber`: Pull request number (number, required)
755809
- `repo`: Repository name (string, required)
756810

757-
- **get_pull_request** - Get pull request details
758-
- `owner`: Repository owner (string, required)
759-
- `pullNumber`: Pull request number (number, required)
760-
- `repo`: Repository name (string, required)
761-
762-
- **get_pull_request_diff** - Get pull request diff
763-
- `owner`: Repository owner (string, required)
764-
- `pullNumber`: Pull request number (number, required)
765-
- `repo`: Repository name (string, required)
766-
767-
- **get_pull_request_files** - Get pull request files
768-
- `owner`: Repository owner (string, required)
769-
- `page`: Page number for pagination (min 1) (number, optional)
770-
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
771-
- `pullNumber`: Pull request number (number, required)
772-
- `repo`: Repository name (string, required)
773-
774-
- **get_pull_request_review_comments** - Get pull request review comments
775-
- `owner`: Repository owner (string, required)
776-
- `pullNumber`: Pull request number (number, required)
777-
- `repo`: Repository name (string, required)
778-
779-
- **get_pull_request_reviews** - Get pull request reviews
780-
- `owner`: Repository owner (string, required)
781-
- `pullNumber`: Pull request number (number, required)
782-
- `repo`: Repository name (string, required)
783-
784-
- **get_pull_request_status** - Get pull request status checks
785-
- `owner`: Repository owner (string, required)
786-
- `pullNumber`: Pull request number (number, required)
787-
- `repo`: Repository name (string, required)
788-
789811
- **list_pull_requests** - List pull requests
790812
- `base`: Filter by base branch (string, optional)
791813
- `direction`: Sort direction (string, optional)
@@ -805,6 +827,22 @@ The following sets of tools are available (all are on by default):
805827
- `pullNumber`: Pull request number (number, required)
806828
- `repo`: Repository name (string, required)
807829

830+
- **pull_request_read** - Get details for a single pull request
831+
- `method`: Action to specify what pull request data needs to be retrieved from GitHub.
832+
Possible options:
833+
1. get - Get details of a specific pull request.
834+
2. get_diff - Get the diff of a pull request.
835+
3. get_status - Get status of a head commit in a pull request. This reflects status of builds and checks.
836+
4. get_files - Get the list of files changed in a pull request. Use with pagination parameters to control the number of results returned.
837+
5. get_review_comments - Get the review comments on a pull request. Use with pagination parameters to control the number of results returned.
838+
6. get_reviews - Get the reviews on a pull request. When asked for review comments, use get_review_comments method.
839+
(string, required)
840+
- `owner`: Repository owner (string, required)
841+
- `page`: Page number for pagination (min 1) (number, optional)
842+
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
843+
- `pullNumber`: Pull request number (number, required)
844+
- `repo`: Repository name (string, required)
845+
808846
- **request_copilot_review** - Request Copilot review
809847
- `owner`: Repository owner (string, required)
810848
- `pullNumber`: Pull request number (number, required)
@@ -933,13 +971,6 @@ The following sets of tools are available (all are on by default):
933971
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
934972
- `repo`: Repository name (string, required)
935973

936-
- **list_starred_repositories** - List starred repositories
937-
- `direction`: The direction to sort the results by. (string, optional)
938-
- `page`: Page number for pagination (min 1) (number, optional)
939-
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
940-
- `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)
941-
- `username`: Username to list starred repositories for. Defaults to the authenticated user. (string, optional)
942-
943974
- **list_tags** - List tags
944975
- `owner`: Repository owner (string, required)
945976
- `page`: Page number for pagination (min 1) (number, optional)
@@ -966,14 +997,6 @@ The following sets of tools are available (all are on by default):
966997
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
967998
- `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)
968999

969-
- **star_repository** - Star repository
970-
- `owner`: Repository owner (string, required)
971-
- `repo`: Repository name (string, required)
972-
973-
- **unstar_repository** - Unstar repository
974-
- `owner`: Repository owner (string, required)
975-
- `repo`: Repository name (string, required)
976-
9771000
</details>
9781001

9791002
<details>
@@ -1031,6 +1054,27 @@ The following sets of tools are available (all are on by default):
10311054

10321055
<details>
10331056

1057+
<summary>Stargazers</summary>
1058+
1059+
- **list_starred_repositories** - List starred repositories
1060+
- `direction`: The direction to sort the results by. (string, optional)
1061+
- `page`: Page number for pagination (min 1) (number, optional)
1062+
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
1063+
- `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)
1064+
- `username`: Username to list starred repositories for. Defaults to the authenticated user. (string, optional)
1065+
1066+
- **star_repository** - Star repository
1067+
- `owner`: Repository owner (string, required)
1068+
- `repo`: Repository name (string, required)
1069+
1070+
- **unstar_repository** - Unstar repository
1071+
- `owner`: Repository owner (string, required)
1072+
- `repo`: Repository name (string, required)
1073+
1074+
</details>
1075+
1076+
<details>
1077+
10341078
<summary>Users</summary>
10351079

10361080
- **search_users** - Search users
@@ -1069,48 +1113,6 @@ The following sets of tools are available (all are on by default):
10691113
- **list_copilot_spaces** - List Copilot Spaces
10701114
</details>
10711115

1072-
#### Specifying Toolsets
1073-
1074-
To specify toolsets you want available to the LLM, you can pass an allow-list in two ways:
1075-
1076-
1. **Using Command Line Argument**:
1077-
1078-
```bash
1079-
github-mcp-server --toolsets repos,issues,pull_requests,actions,code_security
1080-
```
1081-
1082-
2. **Using Environment Variable**:
1083-
```bash
1084-
GITHUB_TOOLSETS="repos,issues,pull_requests,actions,code_security" ./github-mcp-server
1085-
```
1086-
1087-
The environment variable `GITHUB_TOOLSETS` takes precedence over the command line argument if both are provided.
1088-
1089-
### Using Toolsets With Docker
1090-
1091-
When using Docker, you can pass the toolsets as environment variables:
1092-
1093-
```bash
1094-
docker run -i --rm \
1095-
-e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
1096-
-e GITHUB_TOOLSETS="repos,issues,pull_requests,actions,code_security,experiments" \
1097-
ghcr.io/github/github-mcp-server
1098-
```
1099-
1100-
### The "all" Toolset
1101-
1102-
The special toolset `all` can be provided to enable all available toolsets regardless of any other configuration:
1103-
1104-
```bash
1105-
./github-mcp-server --toolsets all
1106-
```
1107-
1108-
Or using the environment variable:
1109-
1110-
```bash
1111-
GITHUB_TOOLSETS="all" ./github-mcp-server
1112-
```
1113-
11141116
## Dynamic Tool Discovery
11151117

11161118
**Note**: This feature is currently in beta and may not be available in all environments. Please test it out and let us know if you encounter any issues.

cmd/github-mcp-server/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ var (
4545
return fmt.Errorf("failed to unmarshal toolsets: %w", err)
4646
}
4747

48+
if len(enabledToolsets) == 0 {
49+
enabledToolsets = github.GetDefaultToolsetIDs()
50+
}
51+
4852
stdioServerConfig := ghmcp.StdioServerConfig{
4953
Version: version,
5054
Host: viper.GetString("host"),
@@ -69,7 +73,7 @@ func init() {
6973
rootCmd.SetVersionTemplate("{{.Short}}\n{{.Version}}\n")
7074

7175
// Add global flags that will be shared by all commands
72-
rootCmd.PersistentFlags().StringSlice("toolsets", github.DefaultTools, "An optional comma separated list of groups of tools to allow, defaults to enabling all")
76+
rootCmd.PersistentFlags().StringSlice("toolsets", nil, github.GenerateToolsetsHelp())
7377
rootCmd.PersistentFlags().Bool("dynamic-toolsets", false, "Enable dynamic toolsets")
7478
rootCmd.PersistentFlags().Bool("read-only", false, "Restrict the server to read-only operations")
7579
rootCmd.PersistentFlags().String("log-file", "", "Path to log file")

docs/remote-server.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Below is a table of available toolsets for the remote GitHub MCP Server. Each to
3434
| 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) |
3535
| 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) |
3636
| 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) |
37+
| Stargazers | GitHub Stargazers 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) |
3738
| 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) |
3839

3940
<!-- END AUTOMATED TOOLSETS -->

pkg/github/__toolsnaps__/get_pull_request.snap

Lines changed: 0 additions & 30 deletions
This file was deleted.

pkg/github/__toolsnaps__/get_pull_request_diff.snap

Lines changed: 0 additions & 30 deletions
This file was deleted.

pkg/github/__toolsnaps__/get_pull_request_files.snap

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)