Skip to content

Commit 61f28e5

Browse files
authored
Update README.md
1 parent f04d217 commit 61f28e5

1 file changed

Lines changed: 147 additions & 147 deletions

File tree

README.md

Lines changed: 147 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -297,153 +297,6 @@ The following sets of tools are available (all are on by default):
297297
| `users` | GitHub User related tools |
298298
<!-- END AUTOMATED TOOLSETS -->
299299

300-
#### Specifying Toolsets
301-
302-
To specify toolsets you want available to the LLM, you can pass an allow-list in two ways:
303-
304-
1. **Using Command Line Argument**:
305-
306-
```bash
307-
github-mcp-server --toolsets repos,issues,pull_requests,actions,code_security
308-
```
309-
310-
2. **Using Environment Variable**:
311-
```bash
312-
GITHUB_TOOLSETS="repos,issues,pull_requests,actions,code_security" ./github-mcp-server
313-
```
314-
315-
The environment variable `GITHUB_TOOLSETS` takes precedence over the command line argument if both are provided.
316-
317-
### Using Toolsets With Docker
318-
319-
When using Docker, you can pass the toolsets as environment variables:
320-
321-
```bash
322-
docker run -i --rm \
323-
-e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
324-
-e GITHUB_TOOLSETS="repos,issues,pull_requests,actions,code_security,experiments" \
325-
ghcr.io/github/github-mcp-server
326-
```
327-
328-
### The "all" Toolset
329-
330-
The special toolset `all` can be provided to enable all available toolsets regardless of any other configuration:
331-
332-
```bash
333-
./github-mcp-server --toolsets all
334-
```
335-
336-
Or using the environment variable:
337-
338-
```bash
339-
GITHUB_TOOLSETS="all" ./github-mcp-server
340-
```
341-
342-
## Dynamic Tool Discovery
343-
344-
**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.
345-
346-
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 sheer number of tools available.
347-
348-
### Using Dynamic Tool Discovery
349-
350-
When using the binary, you can pass the `--dynamic-toolsets` flag.
351-
352-
```bash
353-
./github-mcp-server --dynamic-toolsets
354-
```
355-
356-
When using Docker, you can pass the toolsets as environment variables:
357-
358-
```bash
359-
docker run -i --rm \
360-
-e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
361-
-e GITHUB_DYNAMIC_TOOLSETS=1 \
362-
ghcr.io/github/github-mcp-server
363-
```
364-
365-
## Read-Only Mode
366-
367-
To run the server in read-only mode, you can use the `--read-only` flag. This will only offer read-only tools, preventing any modifications to repositories, issues, pull requests, etc.
368-
369-
```bash
370-
./github-mcp-server --read-only
371-
```
372-
373-
When using Docker, you can pass the read-only mode as an environment variable:
374-
375-
```bash
376-
docker run -i --rm \
377-
-e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
378-
-e GITHUB_READ_ONLY=1 \
379-
ghcr.io/github/github-mcp-server
380-
```
381-
382-
## GitHub Enterprise Server and Enterprise Cloud with data residency (ghe.com)
383-
384-
The flag `--gh-host` and the environment variable `GITHUB_HOST` can be used to set
385-
the hostname for GitHub Enterprise Server or GitHub Enterprise Cloud with data residency.
386-
387-
- For GitHub Enterprise Server, prefix the hostname with the `https://` URI scheme, as it otherwise defaults to `http://`, which GitHub Enterprise Server does not support.
388-
- For GitHub Enterprise Cloud with data residency, use `https://YOURSUBDOMAIN.ghe.com` as the hostname.
389-
``` json
390-
"github": {
391-
"command": "docker",
392-
"args": [
393-
"run",
394-
"-i",
395-
"--rm",
396-
"-e",
397-
"GITHUB_PERSONAL_ACCESS_TOKEN",
398-
"-e",
399-
"GITHUB_HOST",
400-
"ghcr.io/github/github-mcp-server"
401-
],
402-
"env": {
403-
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}",
404-
"GITHUB_HOST": "https://<your GHES or ghe.com domain name>"
405-
}
406-
}
407-
```
408-
409-
## i18n / Overriding Descriptions
410-
411-
The descriptions of the tools can be overridden by creating a
412-
`github-mcp-server-config.json` file in the same directory as the binary.
413-
414-
The file should contain a JSON object with the tool names as keys and the new
415-
descriptions as values. For example:
416-
417-
```json
418-
{
419-
"TOOL_ADD_ISSUE_COMMENT_DESCRIPTION": "an alternative description",
420-
"TOOL_CREATE_BRANCH_DESCRIPTION": "Create a new branch in a GitHub repository"
421-
}
422-
```
423-
424-
You can create an export of the current translations by running the binary with
425-
the `--export-translations` flag.
426-
427-
This flag will preserve any translations/overrides you have made, while adding
428-
any new translations that have been added to the binary since the last time you
429-
exported.
430-
431-
```sh
432-
./github-mcp-server --export-translations
433-
cat github-mcp-server-config.json
434-
```
435-
436-
You can also use ENV vars to override the descriptions. The environment
437-
variable names are the same as the keys in the JSON file, prefixed with
438-
`GITHUB_MCP_` and all uppercase.
439-
440-
For example, to override the `TOOL_ADD_ISSUE_COMMENT_DESCRIPTION` tool, you can
441-
set the following environment variable:
442-
443-
```sh
444-
export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description"
445-
```
446-
447300
## Tools
448301

449302

@@ -1013,6 +866,153 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
1013866

1014867
</details>
1015868

869+
#### Specifying Toolsets
870+
871+
To specify toolsets you want available to the LLM, you can pass an allow-list in two ways:
872+
873+
1. **Using Command Line Argument**:
874+
875+
```bash
876+
github-mcp-server --toolsets repos,issues,pull_requests,actions,code_security
877+
```
878+
879+
2. **Using Environment Variable**:
880+
```bash
881+
GITHUB_TOOLSETS="repos,issues,pull_requests,actions,code_security" ./github-mcp-server
882+
```
883+
884+
The environment variable `GITHUB_TOOLSETS` takes precedence over the command line argument if both are provided.
885+
886+
### Using Toolsets With Docker
887+
888+
When using Docker, you can pass the toolsets as environment variables:
889+
890+
```bash
891+
docker run -i --rm \
892+
-e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
893+
-e GITHUB_TOOLSETS="repos,issues,pull_requests,actions,code_security,experiments" \
894+
ghcr.io/github/github-mcp-server
895+
```
896+
897+
### The "all" Toolset
898+
899+
The special toolset `all` can be provided to enable all available toolsets regardless of any other configuration:
900+
901+
```bash
902+
./github-mcp-server --toolsets all
903+
```
904+
905+
Or using the environment variable:
906+
907+
```bash
908+
GITHUB_TOOLSETS="all" ./github-mcp-server
909+
```
910+
911+
## Dynamic Tool Discovery
912+
913+
**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.
914+
915+
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 sheer number of tools available.
916+
917+
### Using Dynamic Tool Discovery
918+
919+
When using the binary, you can pass the `--dynamic-toolsets` flag.
920+
921+
```bash
922+
./github-mcp-server --dynamic-toolsets
923+
```
924+
925+
When using Docker, you can pass the toolsets as environment variables:
926+
927+
```bash
928+
docker run -i --rm \
929+
-e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
930+
-e GITHUB_DYNAMIC_TOOLSETS=1 \
931+
ghcr.io/github/github-mcp-server
932+
```
933+
934+
## Read-Only Mode
935+
936+
To run the server in read-only mode, you can use the `--read-only` flag. This will only offer read-only tools, preventing any modifications to repositories, issues, pull requests, etc.
937+
938+
```bash
939+
./github-mcp-server --read-only
940+
```
941+
942+
When using Docker, you can pass the read-only mode as an environment variable:
943+
944+
```bash
945+
docker run -i --rm \
946+
-e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
947+
-e GITHUB_READ_ONLY=1 \
948+
ghcr.io/github/github-mcp-server
949+
```
950+
951+
## GitHub Enterprise Server and Enterprise Cloud with data residency (ghe.com)
952+
953+
The flag `--gh-host` and the environment variable `GITHUB_HOST` can be used to set
954+
the hostname for GitHub Enterprise Server or GitHub Enterprise Cloud with data residency.
955+
956+
- For GitHub Enterprise Server, prefix the hostname with the `https://` URI scheme, as it otherwise defaults to `http://`, which GitHub Enterprise Server does not support.
957+
- For GitHub Enterprise Cloud with data residency, use `https://YOURSUBDOMAIN.ghe.com` as the hostname.
958+
``` json
959+
"github": {
960+
"command": "docker",
961+
"args": [
962+
"run",
963+
"-i",
964+
"--rm",
965+
"-e",
966+
"GITHUB_PERSONAL_ACCESS_TOKEN",
967+
"-e",
968+
"GITHUB_HOST",
969+
"ghcr.io/github/github-mcp-server"
970+
],
971+
"env": {
972+
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}",
973+
"GITHUB_HOST": "https://<your GHES or ghe.com domain name>"
974+
}
975+
}
976+
```
977+
978+
## i18n / Overriding Descriptions
979+
980+
The descriptions of the tools can be overridden by creating a
981+
`github-mcp-server-config.json` file in the same directory as the binary.
982+
983+
The file should contain a JSON object with the tool names as keys and the new
984+
descriptions as values. For example:
985+
986+
```json
987+
{
988+
"TOOL_ADD_ISSUE_COMMENT_DESCRIPTION": "an alternative description",
989+
"TOOL_CREATE_BRANCH_DESCRIPTION": "Create a new branch in a GitHub repository"
990+
}
991+
```
992+
993+
You can create an export of the current translations by running the binary with
994+
the `--export-translations` flag.
995+
996+
This flag will preserve any translations/overrides you have made, while adding
997+
any new translations that have been added to the binary since the last time you
998+
exported.
999+
1000+
```sh
1001+
./github-mcp-server --export-translations
1002+
cat github-mcp-server-config.json
1003+
```
1004+
1005+
You can also use ENV vars to override the descriptions. The environment
1006+
variable names are the same as the keys in the JSON file, prefixed with
1007+
`GITHUB_MCP_` and all uppercase.
1008+
1009+
For example, to override the `TOOL_ADD_ISSUE_COMMENT_DESCRIPTION` tool, you can
1010+
set the following environment variable:
1011+
1012+
```sh
1013+
export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description"
1014+
```
1015+
10161016
## Library Usage
10171017

10181018
The exported Go API of this module should currently be considered unstable, and subject to breaking changes. In the future, we may offer stability; please file an issue if there is a use case where this would be valuable.

0 commit comments

Comments
 (0)