@@ -110,6 +110,95 @@ If you don't have Docker, you can use `go build` to build the binary in the
110110}
111111```
112112
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+
113202## GitHub Enterprise Server
114203
115204The 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
331420### Repositories
332421
333422- ** create_or_update_file** - Create or update a single file in a repository
334-
335423 - ` owner ` : Repository owner (string, required)
336424 - ` repo ` : Repository name (string, required)
337425 - ` path ` : File path (string, required)
@@ -341,50 +429,43 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
341429 - ` sha ` : File SHA if updating (string, optional)
342430
343431- ** list_branches** - List branches in a GitHub repository
344-
345432 - ` owner ` : Repository owner (string, required)
346433 - ` repo ` : Repository name (string, required)
347434 - ` page ` : Page number (number, optional)
348435 - ` perPage ` : Results per page (number, optional)
349436
350437- ** push_files** - Push multiple files in a single commit
351-
352438 - ` owner ` : Repository owner (string, required)
353439 - ` repo ` : Repository name (string, required)
354440 - ` branch ` : Branch to push to (string, required)
355441 - ` files ` : Files to push, each with path and content (array, required)
356442 - ` message ` : Commit message (string, required)
357443
358444- ** search_repositories** - Search for GitHub repositories
359-
360445 - ` query ` : Search query (string, required)
361446 - ` sort ` : Sort field (string, optional)
362447 - ` order ` : Sort order (string, optional)
363448 - ` page ` : Page number (number, optional)
364449 - ` perPage ` : Results per page (number, optional)
365450
366451- ** create_repository** - Create a new GitHub repository
367-
368452 - ` name ` : Repository name (string, required)
369453 - ` description ` : Repository description (string, optional)
370454 - ` private ` : Whether the repository is private (boolean, optional)
371455 - ` autoInit ` : Auto-initialize with README (boolean, optional)
372456
373457- ** get_file_contents** - Get contents of a file or directory
374-
375458 - ` owner ` : Repository owner (string, required)
376459 - ` repo ` : Repository name (string, required)
377460 - ` path ` : File path (string, required)
378461 - ` ref ` : Git reference (string, optional)
379462
380463- ** fork_repository** - Fork a repository
381-
382464 - ` owner ` : Repository owner (string, required)
383465 - ` repo ` : Repository name (string, required)
384466 - ` organization ` : Target organization name (string, optional)
385467
386468- ** create_branch** - Create a new branch
387-
388469 - ` owner ` : Repository owner (string, required)
389470 - ` repo ` : Repository name (string, required)
390471 - ` branch ` : New branch name (string, required)
@@ -405,16 +486,15 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
405486 - ` page ` : Page number, for files in the commit (number, optional)
406487 - ` perPage ` : Results per page, for files in the commit (number, optional)
407488
408- ### Search
409-
410- - ** search_code** - Search for code across GitHub repositories
411-
489+ - ** search_code** - Search for code across GitHub repositories
412490 - ` query ` : Search query (string, required)
413491 - ` sort ` : Sort field (string, optional)
414492 - ` order ` : Sort order (string, optional)
415493 - ` page ` : Page number (number, optional)
416494 - ` perPage ` : Results per page (number, optional)
417495
496+ ### Users
497+
418498- ** search_users** - Search for GitHub users
419499 - ` query ` : Search query (string, required)
420500 - ` sort ` : Sort field (string, optional)
0 commit comments