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
@@ -15,24 +15,18 @@ 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. Once Docker is installed, you will also need to ensure Docker is running.
18
+
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`.
19
19
3. Lastly you will need to[Create a GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new).
20
20
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)).
21
21
22
-
23
-
24
22
##Installation
25
23
26
24
###Usage with VS Code
27
25
28
-
For quick installation, use one of the one-click install buttons at the top of this README.
26
+
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.
29
27
30
28
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)`.
31
29
32
-
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.
33
-
34
-
>Note that the`mcp` key is not needed in the`.vscode/mcp.json` file.
35
-
36
30
```json
37
31
{
38
32
"mcp": {
@@ -64,6 +58,39 @@ Optionally, you can add it to a file called `.vscode/mcp.json` in your workspace
64
58
}
65
59
```
66
60
61
+
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).
68
95
69
96
###Usage with Claude Desktop
@@ -110,9 +137,91 @@ If you don't have Docker, you can use `go build` to build the binary in the
110
137
}
111
138
```
112
139
140
+
##Tool Configuration
141
+
142
+
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.
143
+
144
+
###Available Toolsets
145
+
146
+
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:
188
+
189
+
```bash
190
+
./github-mcp-server --toolsets all
191
+
```
192
+
193
+
Or using the environment variable:
194
+
195
+
```bash
196
+
GITHUB_TOOLSETS="all" ./github-mcp-server
197
+
```
198
+
199
+
##Dynamic Tool Discovery
200
+
201
+
**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.
202
+
203
+
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.
204
+
205
+
###Using Dynamic Tool Discovery
206
+
207
+
When using the binary, you can pass the`--dynamic-toolsets` flag.
208
+
209
+
```bash
210
+
./github-mcp-server --dynamic-toolsets
211
+
```
212
+
213
+
When using Docker, you can pass the toolsets as environment variables:
214
+
215
+
```bash
216
+
docker run -i --rm \
217
+
-e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
218
+
-e GITHUB_DYNAMIC_TOOLSETS=1 \
219
+
ghcr.io/github/github-mcp-server
220
+
```
221
+
113
222
##GitHub Enterprise Server
114
223
115
-
The flag`--gh-host` and the environment variable`GH_HOST` can be used to set
224
+
The flag`--gh-host` and the environment variable`GITHUB_HOST` can be used to set
116
225
the GitHub Enterprise Server hostname.
117
226
118
227
##i18n / Overriding Descriptions
@@ -331,7 +440,6 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
331
440
###Repositories
332
441
333
442
-**create_or_update_file** - Create or update a single file in a repository
334
-
335
443
-`owner`: Repository owner (string, required)
336
444
-`repo`: Repository name (string, required)
337
445
-`path`: File path (string, required)
@@ -341,50 +449,43 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
341
449
-`sha`: File SHA if updating (string, optional)
342
450
343
451
-**list_branches** - List branches in a GitHub repository
344
-
345
452
-`owner`: Repository owner (string, required)
346
453
-`repo`: Repository name (string, required)
347
454
-`page`: Page number (number, optional)
348
455
-`perPage`: Results per page (number, optional)
349
456
350
457
-**push_files** - Push multiple files in a single commit
351
-
352
458
-`owner`: Repository owner (string, required)
353
459
-`repo`: Repository name (string, required)
354
460
-`branch`: Branch to push to (string, required)
355
461
-`files`: Files to push, each with path and content (array, required)
356
462
-`message`: Commit message (string, required)
357
463
358
464
-**search_repositories** - Search for GitHub repositories
359
-
360
465
-`query`: Search query (string, required)
361
466
-`sort`: Sort field (string, optional)
362
467
-`order`: Sort order (string, optional)
363
468
-`page`: Page number (number, optional)
364
469
-`perPage`: Results per page (number, optional)
365
470
366
471
-**create_repository** - Create a new GitHub repository