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
@@ -19,20 +19,14 @@ automation and interaction capabilities for developers and tools.
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
@@ -91,14 +118,110 @@ More about using MCP server tools in VS Code's [agent mode documentation](https:
91
118
92
119
### Build from source
93
120
94
-
If you don't have Docker, you can use `go` to build the binary in the
95
-
`cmd/github-mcp-server` directory, and use the `github-mcp-server stdio`
96
-
command with the `GITHUB_PERSONAL_ACCESS_TOKEN` environment variable set to
97
-
your token.
121
+
If you don't have Docker, you can use `go build` to build the binary in the
122
+
`cmd/github-mcp-server` directory, and use the `github-mcp-server stdio` command with the `GITHUB_PERSONAL_ACCESS_TOKEN` environment variable set to your token. To specify the output location of the build, use the `-o` flag. You should configure your server to use the built executable as its `command`. For example:
123
+
124
+
```JSON
125
+
{
126
+
"mcp": {
127
+
"servers": {
128
+
"github": {
129
+
"command": "/path/to/github-mcp-server",
130
+
"args": ["stdio"],
131
+
"env": {
132
+
"GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
133
+
}
134
+
}
135
+
}
136
+
}
137
+
}
138
+
```
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
+
```
98
221
99
222
## GitHub Enterprise Server
100
223
101
-
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
102
225
the GitHub Enterprise Server hostname.
103
226
104
227
## i18n / Overriding Descriptions
@@ -309,6 +432,21 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
0 commit comments