You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The GitHub MCP Server is a Model Context Protocol (MCP) server that provides
4
+
seamless integration with GitHub's APIs, enabling advanced automation and
5
+
interaction capabilities for developers and tools.
4
6
5
-
## Setup
7
+
## Use Cases
6
8
7
-
Create a GitHub Personal Access Token with the appropriate permissions
8
-
and set it as the GITHUB_PERSONAL_ACCESS_TOKEN environment variable.
9
+
- Automating GitHub workflows and processes.
10
+
- Extracting and analyzing data from GitHub repositories.
11
+
- Building AI powered tools and applications that interact with GitHub's ecosystem.
9
12
10
-
## Testing in VS Code Insiders
13
+
## Prerequisites
11
14
12
-
### Requirements
15
+
[Create a GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new)
16
+
with the permissions you want to give the MCP server. You can also install
17
+
[Docker](https://www.docker.com/) to run the server in a container or build the
18
+
binary from the repo.
13
19
14
-
You can either use a Docker image or build the binary from the repo.
20
+
## Installation
15
21
16
-
#### Docker image
17
-
18
-
As of now, this repo is private, and hence the docker image is not available publicly. To pull it,
19
-
you need to make sure you can access the GitHub docker registry. See [this](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-with-a-personal-access-token-classic)
20
-
for more details.
21
-
22
-
To make sure you can access the GitHub docker registry, run the following command:
First, install `github-mcp-server` by cloning the repo and running the following command:
32
-
33
-
```bash
34
-
go install ./cmd/github-mcp-server
35
27
```
28
+
When you start the server, VS Code will prompt for your token. On top of
29
+
`servers`, you should see a `Start` link to start the server.
36
30
37
-
If you don't want to clone the repo, you can run:
38
-
39
-
```bash
40
-
GOPRIVATE=github.com/github go install github.com/github/github-mcp-server/cmd/github-mcp-server@latest
41
-
```
42
-
43
-
This will install the `github-mcp-server` binary in your `$GOPATH/bin` directory.
44
-
45
-
Find where the binary is installed by running:
31
+
### Usage with Claude Desktop
46
32
47
-
```bash
48
-
# note this assumes $GOPATH/bin is in your $PATH
49
-
which github-mcp-server
33
+
```json
34
+
{
35
+
"mcpServers": {
36
+
"github": {
37
+
"command": "docker",
38
+
"args": [
39
+
"run",
40
+
"-i",
41
+
"--rm",
42
+
"-e",
43
+
"GITHUB_PERSONAL_ACCESS_TOKEN",
44
+
"ghcr.io/github/github-mcp-server:main"
45
+
],
46
+
"env": {
47
+
"GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
48
+
}
49
+
}
50
+
}
51
+
}
50
52
```
51
53
52
-
### Start VS Code Insiders
54
+
### Build from source
53
55
54
-
Start VS Code Insiders and make sure you pass the `GITHUB_PERSONAL_ACCESS_TOKEN` environment variable to the process.
56
+
If you don't have Docker, you can build the binary from the repo and use the
57
+
`github-mcp-server stdio` command with the `GITHUB_PERSONAL_ACCESS_TOKEN`
58
+
environment variable set to your token.
55
59
56
-
One way to do this is to make sure that [you can run VS code from your terminal](https://code.visualstudio.com/docs/setup/mac#_launch-vs-code-from-the-command-line) and
@@ -403,73 +378,3 @@ The flag `--gh-host` and the environment variable `GH_HOST` can be used to set t
403
378
-`repo`: Repository name (string, required)
404
379
-`pr_number`: Pull request number (string, required)
405
380
-`path`: File or directory path (string, optional)
406
-
407
-
## Standard input/output server
408
-
409
-
```sh
410
-
go run cmd/github-mcp-server/main.go stdio
411
-
```
412
-
413
-
E.g:
414
-
415
-
Set the PAT token in the environment variable and run:
416
-
417
-
```sh
418
-
script/get-me
419
-
```
420
-
421
-
And you should see the output of the GitHub MCP server responding with the user information.
422
-
423
-
```sh
424
-
GitHub MCP Server running on stdio
425
-
{
426
-
"jsonrpc": "2.0",
427
-
"id": 3,
428
-
"result": {
429
-
"content": [
430
-
{
431
-
"type": "text",
432
-
"text": "{\"login\":\"juruen\",\"id\" ... }
433
-
}
434
-
]
435
-
}
436
-
}
437
-
438
-
```
439
-
440
-
## i18n / Overriding descriptions
441
-
442
-
The descriptions of the tools can be overridden by creating a github-mcp-server.json file in the same directory as the binary.
443
-
The file should contain a JSON object with the tool names as keys and the new descriptions as values.
444
-
For example:
445
-
446
-
```json
447
-
{
448
-
"TOOL_ADD_ISSUE_COMMENT_DESCRIPTION": "an alternative description",
449
-
"TOOL_CREATE_BRANCH_DESCRIPTION": "Create a new branch in a GitHub repository"
450
-
}
451
-
```
452
-
453
-
You can create an export of the current translations by running the binary with the `--export-translations` flag.
454
-
This flag will preserve any translations/overrides you have made, while adding any new translations that have been added to the binary since the last time you exported.
455
-
456
-
```sh
457
-
./github-mcp-server --export-translations
458
-
cat github-mcp-server.json
459
-
```
460
-
461
-
You can also use ENV vars to override the descriptions. The environment variable names are the same as the keys in the JSON file,
462
-
prefixed with `GITHUB_MCP_` and all uppercase.
463
-
464
-
For example, to override the `TOOL_ADD_ISSUE_COMMENT_DESCRIPTION` tool, you can set the following environment variable:
465
-
466
-
```sh
467
-
export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description"
468
-
```
469
-
470
-
## TODO
471
-
472
-
Testing
473
-
474
-
- Integration tests
475
-
- Blackbox testing: ideally comparing output to Anthropic's server to make sure that this is a fully compatible drop-in replacement.
0 commit comments