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