Skip to content

Commit aa57315

Browse files
chore: update readme for tool paritioning
1 parent 22e4936 commit aa57315

File tree

1 file changed

+92
-12
lines changed

1 file changed

+92
-12
lines changed

README.md

+92-12
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,95 @@ If you don't have Docker, you can use `go build` to build the binary in the
108108
}
109109
```
110110

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+
111200
## GitHub Enterprise Server
112201

113202
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
329418
### Repositories
330419

331420
- **create_or_update_file** - Create or update a single file in a repository
332-
333421
- `owner`: Repository owner (string, required)
334422
- `repo`: Repository name (string, required)
335423
- `path`: File path (string, required)
@@ -339,50 +427,43 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
339427
- `sha`: File SHA if updating (string, optional)
340428

341429
- **list_branches** - List branches in a GitHub repository
342-
343430
- `owner`: Repository owner (string, required)
344431
- `repo`: Repository name (string, required)
345432
- `page`: Page number (number, optional)
346433
- `perPage`: Results per page (number, optional)
347434

348435
- **push_files** - Push multiple files in a single commit
349-
350436
- `owner`: Repository owner (string, required)
351437
- `repo`: Repository name (string, required)
352438
- `branch`: Branch to push to (string, required)
353439
- `files`: Files to push, each with path and content (array, required)
354440
- `message`: Commit message (string, required)
355441

356442
- **search_repositories** - Search for GitHub repositories
357-
358443
- `query`: Search query (string, required)
359444
- `sort`: Sort field (string, optional)
360445
- `order`: Sort order (string, optional)
361446
- `page`: Page number (number, optional)
362447
- `perPage`: Results per page (number, optional)
363448

364449
- **create_repository** - Create a new GitHub repository
365-
366450
- `name`: Repository name (string, required)
367451
- `description`: Repository description (string, optional)
368452
- `private`: Whether the repository is private (boolean, optional)
369453
- `autoInit`: Auto-initialize with README (boolean, optional)
370454

371455
- **get_file_contents** - Get contents of a file or directory
372-
373456
- `owner`: Repository owner (string, required)
374457
- `repo`: Repository name (string, required)
375458
- `path`: File path (string, required)
376459
- `ref`: Git reference (string, optional)
377460

378461
- **fork_repository** - Fork a repository
379-
380462
- `owner`: Repository owner (string, required)
381463
- `repo`: Repository name (string, required)
382464
- `organization`: Target organization name (string, optional)
383465

384466
- **create_branch** - Create a new branch
385-
386467
- `owner`: Repository owner (string, required)
387468
- `repo`: Repository name (string, required)
388469
- `branch`: New branch name (string, required)
@@ -403,16 +484,15 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
403484
- `page`: Page number, for files in the commit (number, optional)
404485
- `perPage`: Results per page, for files in the commit (number, optional)
405486

406-
### Search
407-
408-
- **search_code** - Search for code across GitHub repositories
409-
487+
- **search_code** - Search for code across GitHub repositories
410488
- `query`: Search query (string, required)
411489
- `sort`: Sort field (string, optional)
412490
- `order`: Sort order (string, optional)
413491
- `page`: Page number (number, optional)
414492
- `perPage`: Results per page (number, optional)
415493

494+
### Users
495+
416496
- **search_users** - Search for GitHub users
417497
- `query`: Search query (string, required)
418498
- `sort`: Sort field (string, optional)

0 commit comments

Comments
 (0)