You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+152-17
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,6 @@ automation and interaction capabilities for developers and tools.
15
15
## Prerequisites
16
16
17
17
1. To run the server in a container, you will need to have [Docker](https://www.docker.com/) installed.
18
-
2.[Create a GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new).
19
-
Each tool requires specific permissions to function. See the [Required Token Permissions](#required-token-permissions) section below for details.
20
18
21
19
## Required Token Permissions
22
20
@@ -77,18 +75,18 @@ Each tool requires specific GitHub Personal Access Token permissions to function
77
75
78
76
Note: For organization repositories, additional organization-specific permissions may be required.
79
77
78
+
2. Once Docker is installed, you will also need to ensure Docker is running. The image is public; if you get errors on pull, you may have an expired token and need to `docker logout ghcr.io`.
79
+
3. Lastly you will need to [Create a GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new).
80
+
The MCP server can use many of the GitHub APIs, so enable the permissions that you feel comfortable granting your AI tools (to learn more about access tokens, please check out the [documentation](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)).
81
+
80
82
## Installation
81
83
82
84
### Usage with VS Code
83
85
84
-
For quick installation, use one of the one-click install buttons at the top of this README.
86
+
For quick installation, use one of the one-click install buttons at the top of this README. Once you complete that flow, toggle Agent mode (located by the Copilot Chat text input) and the server will start.
85
87
86
88
For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing `Ctrl + Shift + P` and typing `Preferences: Open User Settings (JSON)`.
87
89
88
-
Optionally, you can add it to a file called `.vscode/mcp.json` in your workspace. This will allow you to share the configuration with others.
89
-
90
-
> Note that the `mcp` key is not needed in the `.vscode/mcp.json` file.
91
-
92
90
```json
93
91
{
94
92
"mcp": {
@@ -120,6 +118,39 @@ Optionally, you can add it to a file called `.vscode/mcp.json` in your workspace
120
118
}
121
119
```
122
120
121
+
Optionally, you can add a similar example (i.e. without the mcp key) to a file called `.vscode/mcp.json` in your workspace. This will allow you to share the configuration with others.
More about using MCP server tools in VS Code's [agent mode documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers).
124
155
125
156
### Usage with Claude Desktop
@@ -166,9 +197,91 @@ If you don't have Docker, you can use `go build` to build the binary in the
166
197
}
167
198
```
168
199
200
+
## Tool Configuration
201
+
202
+
The GitHub MCP Server supports enabling or disabling specific groups of functionalities via the `--toolsets` flag. This allows you to control which GitHub API capabilities are available to your AI tools. Enabling only the toolsets that you need can help the LLM with tool choice and reduce the context size.
203
+
204
+
### Available Toolsets
205
+
206
+
The following sets of tools are available (all are on by default):
The special toolset `all` can be provided to enable all available toolsets regardless of any other configuration:
248
+
249
+
```bash
250
+
./github-mcp-server --toolsets all
251
+
```
252
+
253
+
Or using the environment variable:
254
+
255
+
```bash
256
+
GITHUB_TOOLSETS="all" ./github-mcp-server
257
+
```
258
+
259
+
## Dynamic Tool Discovery
260
+
261
+
**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.
262
+
263
+
Instead of starting with all tools enabled, you can turn on dynamic toolset discovery. Dynamic toolsets allow the MCP host to list and enable toolsets in response to a user prompt. This should help to avoid situations where the model gets confused by the shear number of tools available.
264
+
265
+
### Using Dynamic Tool Discovery
266
+
267
+
When using the binary, you can pass the `--dynamic-toolsets` flag.
268
+
269
+
```bash
270
+
./github-mcp-server --dynamic-toolsets
271
+
```
272
+
273
+
When using Docker, you can pass the toolsets as environment variables:
274
+
275
+
```bash
276
+
docker run -i --rm \
277
+
-e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
278
+
-e GITHUB_DYNAMIC_TOOLSETS=1 \
279
+
ghcr.io/github/github-mcp-server
280
+
```
281
+
169
282
## GitHub Enterprise Server
170
283
171
-
The flag `--gh-host` and the environment variable `GH_HOST` can be used to set
284
+
The flag `--gh-host` and the environment variable `GITHUB_HOST` can be used to set
172
285
the GitHub Enterprise Server hostname.
173
286
174
287
## i18n / Overriding Descriptions
@@ -387,7 +500,6 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
387
500
### Repositories
388
501
389
502
-**create_or_update_file** - Create or update a single file in a repository
390
-
391
503
-`owner`: Repository owner (string, required)
392
504
-`repo`: Repository name (string, required)
393
505
-`path`: File path (string, required)
@@ -396,44 +508,44 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
396
508
-`branch`: Branch name (string, optional)
397
509
-`sha`: File SHA if updating (string, optional)
398
510
399
-
-**push_files** - Push multiple files in a single commit
511
+
-**list_branches** - List branches in a GitHub repository
512
+
-`owner`: Repository owner (string, required)
513
+
-`repo`: Repository name (string, required)
514
+
-`page`: Page number (number, optional)
515
+
-`perPage`: Results per page (number, optional)
400
516
517
+
-**push_files** - Push multiple files in a single commit
401
518
-`owner`: Repository owner (string, required)
402
519
-`repo`: Repository name (string, required)
403
520
-`branch`: Branch to push to (string, required)
404
521
-`files`: Files to push, each with path and content (array, required)
405
522
-`message`: Commit message (string, required)
406
523
407
524
-**search_repositories** - Search for GitHub repositories
408
-
409
525
-`query`: Search query (string, required)
410
526
-`sort`: Sort field (string, optional)
411
527
-`order`: Sort order (string, optional)
412
528
-`page`: Page number (number, optional)
413
529
-`perPage`: Results per page (number, optional)
414
530
415
531
-**create_repository** - Create a new GitHub repository
0 commit comments