@@ -110,6 +110,95 @@ If you don't have Docker, you can use `go build` to build the binary in the
110
110
}
111
111
```
112
112
113
+ ## Tool Configuration
114
+
115
+ 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.
116
+
117
+ ### Available Toolsets
118
+
119
+ The following sets of tools are available (all are on by default):
120
+
121
+ | Toolset | Description |
122
+ | ----------------------- | ------------------------------------------------------------- |
123
+ | ` repos ` | Repository-related tools (file operations, branches, commits) |
124
+ | ` issues ` | Issue-related tools (create, read, update, comment) |
125
+ | ` users ` | Anything relating to GitHub Users |
126
+ | ` pull_requests ` | Pull request operations (create, merge, review) |
127
+ | ` code_security ` | Code scanning alerts and security features |
128
+ | ` experiments ` | Experimental features (not considered stable) |
129
+
130
+ #### Specifying Toolsets
131
+
132
+ To reduce the available tools, you can pass an allow-list in two ways:
133
+
134
+ 1 . ** Using Command Line Argument** :
135
+
136
+ ``` bash
137
+ github-mcp-server --toolsets repos,issues,pull_requests,code_security
138
+ ```
139
+
140
+ 2 . ** Using Environment Variable** :
141
+ ``` bash
142
+ GITHUB_TOOLSETS=" repos,issues,pull_requests,code_security" ./github-mcp-server
143
+ ```
144
+
145
+ The environment variable ` GITHUB_TOOLSETS ` takes precedence over the command line argument if both are provided.
146
+
147
+ Any toolsets you specify will be enabled from the start, including when ` --dynamic-toolsets ` is on.
148
+
149
+ You might want to do this if the model is confused about which tools to call and you only require a subset.
150
+
151
+
152
+ ### Using Toolsets With Docker
153
+
154
+ When using Docker, you can pass the toolsets as environment variables:
155
+
156
+ ``` bash
157
+ docker run -i --rm \
158
+ -e GITHUB_PERSONAL_ACCESS_TOKEN=< your-token> \
159
+ -e GITHUB_TOOLSETS=" repos,issues,pull_requests,code_security,experiments" \
160
+ ghcr.io/github/github-mcp-server
161
+ ```
162
+
163
+ ### The "all" Toolset
164
+
165
+ The special toolset ` all ` can be provided to enable all available toolsets regardless of any other configuration:
166
+
167
+ ``` bash
168
+ ./github-mcp-server --toolsets all
169
+ ```
170
+
171
+ Or using the environment variable:
172
+
173
+ ``` bash
174
+ GITHUB_TOOLSETS=" all" ./github-mcp-server
175
+ ```
176
+
177
+ ## Dynamic Tool Discovery
178
+
179
+ Instead of starting with all tools enabled, you can turn on Dynamic Toolset Discovery.
180
+ This feature provides tools that help the MCP Host application to discover and enable sets of GitHub tools only when needed.
181
+ This helps to avoid situations where models get confused by the shear number of tools available to them, which varies by model.
182
+
183
+ ### Using Dynamic Tool Discovery
184
+
185
+ When using the binary, you can pass the ` --dynamic-toolsets ` flag.
186
+
187
+ ``` bash
188
+ ./github-mcp-server --dynamic-toolsets
189
+ ```
190
+
191
+ When using Docker, you can pass the toolsets as environment variables:
192
+
193
+ ``` bash
194
+ docker run -i --rm \
195
+ -e GITHUB_PERSONAL_ACCESS_TOKEN=< your-token> \
196
+ -e GITHUB_DYNAMIC_TOOLSETS=1 \
197
+ ghcr.io/github/github-mcp-server
198
+ ```
199
+
200
+
201
+
113
202
## GitHub Enterprise Server
114
203
115
204
The flag ` --gh-host ` and the environment variable ` GH_HOST ` can be used to set
@@ -331,7 +420,6 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
331
420
### Repositories
332
421
333
422
- ** create_or_update_file** - Create or update a single file in a repository
334
-
335
423
- ` owner ` : Repository owner (string, required)
336
424
- ` repo ` : Repository name (string, required)
337
425
- ` path ` : File path (string, required)
@@ -341,50 +429,43 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
341
429
- ` sha ` : File SHA if updating (string, optional)
342
430
343
431
- ** list_branches** - List branches in a GitHub repository
344
-
345
432
- ` owner ` : Repository owner (string, required)
346
433
- ` repo ` : Repository name (string, required)
347
434
- ` page ` : Page number (number, optional)
348
435
- ` perPage ` : Results per page (number, optional)
349
436
350
437
- ** push_files** - Push multiple files in a single commit
351
-
352
438
- ` owner ` : Repository owner (string, required)
353
439
- ` repo ` : Repository name (string, required)
354
440
- ` branch ` : Branch to push to (string, required)
355
441
- ` files ` : Files to push, each with path and content (array, required)
356
442
- ` message ` : Commit message (string, required)
357
443
358
444
- ** search_repositories** - Search for GitHub repositories
359
-
360
445
- ` query ` : Search query (string, required)
361
446
- ` sort ` : Sort field (string, optional)
362
447
- ` order ` : Sort order (string, optional)
363
448
- ` page ` : Page number (number, optional)
364
449
- ` perPage ` : Results per page (number, optional)
365
450
366
451
- ** create_repository** - Create a new GitHub repository
367
-
368
452
- ` name ` : Repository name (string, required)
369
453
- ` description ` : Repository description (string, optional)
370
454
- ` private ` : Whether the repository is private (boolean, optional)
371
455
- ` autoInit ` : Auto-initialize with README (boolean, optional)
372
456
373
457
- ** get_file_contents** - Get contents of a file or directory
374
-
375
458
- ` owner ` : Repository owner (string, required)
376
459
- ` repo ` : Repository name (string, required)
377
460
- ` path ` : File path (string, required)
378
461
- ` ref ` : Git reference (string, optional)
379
462
380
463
- ** fork_repository** - Fork a repository
381
-
382
464
- ` owner ` : Repository owner (string, required)
383
465
- ` repo ` : Repository name (string, required)
384
466
- ` organization ` : Target organization name (string, optional)
385
467
386
468
- ** create_branch** - Create a new branch
387
-
388
469
- ` owner ` : Repository owner (string, required)
389
470
- ` repo ` : Repository name (string, required)
390
471
- ` branch ` : New branch name (string, required)
@@ -405,16 +486,15 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
405
486
- ` page ` : Page number, for files in the commit (number, optional)
406
487
- ` perPage ` : Results per page, for files in the commit (number, optional)
407
488
408
- ### Search
409
-
410
- - ** search_code** - Search for code across GitHub repositories
411
-
489
+ - ** search_code** - Search for code across GitHub repositories
412
490
- ` query ` : Search query (string, required)
413
491
- ` sort ` : Sort field (string, optional)
414
492
- ` order ` : Sort order (string, optional)
415
493
- ` page ` : Page number (number, optional)
416
494
- ` perPage ` : Results per page (number, optional)
417
495
496
+ ### Users
497
+
418
498
- ** search_users** - Search for GitHub users
419
499
- ` query ` : Search query (string, required)
420
500
- ` sort ` : Sort field (string, optional)
0 commit comments