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
Copy file name to clipboardExpand all lines: README.md
+209-9Lines changed: 209 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,128 @@ The GitHub MCP Server is a [Model Context Protocol (MCP)](https://modelcontextpr
4
4
server that provides seamless integration with GitHub APIs, enabling advanced
5
5
automation and interaction capabilities for developers and tools.
6
6
7
-
[](https://insiders.vscode.dev/redirect/mcp/install?name=github&inputs=%5B%7B%22id%22%3A%22github_token%22%2C%22type%22%3A%22promptString%22%2C%22description%22%3A%22GitHub%20Personal%20Access%20Token%22%2C%22password%22%3Atrue%7D%5D&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22-e%22%2C%22GITHUB_PERSONAL_ACCESS_TOKEN%22%2C%22ghcr.io%2Fgithub%2Fgithub-mcp-server%22%5D%2C%22env%22%3A%7B%22GITHUB_PERSONAL_ACCESS_TOKEN%22%3A%22%24%7Binput%3Agithub_token%7D%22%7D%7D) [](https://insiders.vscode.dev/redirect/mcp/install?name=github&inputs=%5B%7B%22id%22%3A%22github_token%22%2C%22type%22%3A%22promptString%22%2C%22description%22%3A%22GitHub%20Personal%20Access%20Token%22%2C%22password%22%3Atrue%7D%5D&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22-e%22%2C%22GITHUB_PERSONAL_ACCESS_TOKEN%22%2C%22ghcr.io%2Fgithub%2Fgithub-mcp-server%22%5D%2C%22env%22%3A%7B%22GITHUB_PERSONAL_ACCESS_TOKEN%22%3A%22%24%7Binput%3Agithub_token%7D%22%7D%7D&quality=insiders)
8
-
9
-
## Use Cases
7
+
### Use Cases
10
8
11
9
- Automating GitHub workflows and processes.
12
10
- Extracting and analyzing data from GitHub repositories.
13
11
- Building AI powered tools and applications that interact with GitHub's ecosystem.
14
12
13
+
---
14
+
15
+
## Remote GitHub MCP Server
16
+
17
+
[](https://insiders.vscode.dev/redirect/mcp/install?name=github&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2F%22%7D)[](https://insiders.vscode.dev/redirect/mcp/install?name=github&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2F%22%7D&quality=insiders)
18
+
19
+
The remote GitHub MCP Server is hosted by GitHub and provides the easiest method for getting up and running. If your MCP host does not support remote MCP servers, don't worry! You can use the [local version of the GitHub MCP Server](https://github.com/github/github-mcp-server?tab=readme-ov-file#local-github-mcp-server) instead.
20
+
21
+
## Prerequisites
22
+
23
+
1. An MCP host that supports the latest MCP specification and remote servers, such as [VS Code](https://code.visualstudio.com/).
24
+
25
+
## Installation
26
+
27
+
### Usage with VS Code
28
+
29
+
For quick installation, use one of the one-click install buttons above. Once you complete that flow, toggle Agent mode (located by the Copilot Chat text input) and the server will start. Make sure you're using [VS Code 1.101](https://code.visualstudio.com/updates/v1_101) or [later](https://code.visualstudio.com/updates) for remote MCP and OAuth support.
30
+
31
+
32
+
Alternatively, to manually configure VS Code, choose the appropriate JSON block from the examples below and add it to your host configuration:
33
+
34
+
<table>
35
+
<tr><th>Using OAuth</th><th>Using a GitHub PAT</th></tr>
36
+
<tr><thalign=leftcolspan=2>VS Code (version 1.101 or greater)</th></tr>
37
+
<trvalign=top>
38
+
<td>
39
+
40
+
```json
41
+
{
42
+
"servers": {
43
+
"github-remote": {
44
+
"type": "http",
45
+
"url": "https://api.githubcopilot.com/mcp/"
46
+
}
47
+
}
48
+
}
49
+
```
50
+
51
+
</td>
52
+
<td>
53
+
54
+
```json
55
+
{
56
+
"servers": {
57
+
"github-remote": {
58
+
"type": "http",
59
+
"url": "https://api.githubcopilot.com/mcp/",
60
+
"headers": {
61
+
"Authorization": "Bearer ${input:github_mcp_pat}"
62
+
}
63
+
}
64
+
},
65
+
"inputs": [
66
+
{
67
+
"type": "promptString",
68
+
"id": "github_mcp_pat",
69
+
"description": "GitHub Personal Access Token",
70
+
"password": true
71
+
}
72
+
]
73
+
}
74
+
```
75
+
76
+
</td>
77
+
</tr>
78
+
</table>
79
+
80
+
### Usage in other MCP Hosts
81
+
82
+
For MCP Hosts that are [Remote MCP-compatible](docs/host-integration.md), choose the appropriate JSON block from the examples below and add it to your host configuration:
83
+
84
+
<table>
85
+
<tr><th>Using OAuth</th><th>Using a GitHub PAT</th></tr>
86
+
<trvalign=top>
87
+
<td>
88
+
89
+
```json
90
+
{
91
+
"mcpServers": {
92
+
"github-remote": {
93
+
"url": "https://api.githubcopilot.com/mcp/"
94
+
}
95
+
}
96
+
}
97
+
```
98
+
99
+
</td>
100
+
<td>
101
+
102
+
```json
103
+
{
104
+
"mcpServers": {
105
+
"github-remote": {
106
+
"url": "https://api.githubcopilot.com/mcp/",
107
+
"authorization_token": "Bearer <your GitHub PAT>"
108
+
}
109
+
}
110
+
}
111
+
```
112
+
113
+
</td>
114
+
</tr>
115
+
</table>
116
+
117
+
> **Note:** The exact configuration format may vary by host. Refer to your host's documentation for the correct syntax and location for remote MCP server setup.
118
+
119
+
### Configuration
120
+
121
+
See [Remote Server Documentation](docs/remote-server.md) on how to pass additional configuration settings to the remote GitHub MCP Server.
122
+
123
+
---
124
+
125
+
## Local GitHub MCP Server
126
+
127
+
[](https://insiders.vscode.dev/redirect/mcp/install?name=github&inputs=%5B%7B%22id%22%3A%22github_token%22%2C%22type%22%3A%22promptString%22%2C%22description%22%3A%22GitHub%20Personal%20Access%20Token%22%2C%22password%22%3Atrue%7D%5D&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22-e%22%2C%22GITHUB_PERSONAL_ACCESS_TOKEN%22%2C%22ghcr.io%2Fgithub%2Fgithub-mcp-server%22%5D%2C%22env%22%3A%7B%22GITHUB_PERSONAL_ACCESS_TOKEN%22%3A%22%24%7Binput%3Agithub_token%7D%22%7D%7D) [](https://insiders.vscode.dev/redirect/mcp/install?name=github&inputs=%5B%7B%22id%22%3A%22github_token%22%2C%22type%22%3A%22promptString%22%2C%22description%22%3A%22GitHub%20Personal%20Access%20Token%22%2C%22password%22%3Atrue%7D%5D&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22-e%22%2C%22GITHUB_PERSONAL_ACCESS_TOKEN%22%2C%22ghcr.io%2Fgithub%2Fgithub-mcp-server%22%5D%2C%22env%22%3A%7B%22GITHUB_PERSONAL_ACCESS_TOKEN%22%3A%22%24%7Binput%3Agithub_token%7D%22%7D%7D&quality=insiders)
128
+
15
129
## Prerequisites
16
130
17
131
1. To run the server in a container, you will need to have [Docker](https://www.docker.com/) installed.
@@ -23,9 +137,11 @@ The MCP server can use many of the GitHub APIs, so enable the permissions that y
23
137
24
138
### Usage with VS Code
25
139
26
-
For quick installation, use one of the one-click install buttons at the top of this README. Once you complete that flow, toggle Agent mode (located by the Copilot Chat text input) and the server will start.
140
+
For quick installation, use one of the one-click install buttons. Once you complete that flow, toggle Agent mode (located by the Copilot Chat text input) and the server will start.
141
+
142
+
### Usage in other MCP Hosts
27
143
28
-
For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing `Ctrl + Shift + P` and typing `Preferences: Open User Settings (JSON)`.
144
+
Add the following JSON block to your IDE MCP settings.
29
145
30
146
```json
31
147
{
@@ -141,19 +257,25 @@ If you don't have Docker, you can use `go build` to build the binary in the
141
257
142
258
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. Enabling only the toolsets that you need can help the LLM with tool choice and reduce the context size.
143
259
260
+
_Toolsets are not limited to Tools. Relevant MCP Resources and Prompts are also included where applicable._
261
+
144
262
### Available Toolsets
145
263
146
264
The following sets of tools are available (all are on by default):
|`secret_protection`| Secret protection related tools, such as GitHub Secret Scanning |
275
+
|`users`| Anything relating to GitHub Users |
155
276
|`experiments`| Experimental features (not considered stable) |
156
277
278
+
157
279
#### Specifying Toolsets
158
280
159
281
To specify toolsets you want available to the LLM, you can pass an allow-list in two ways:
@@ -369,6 +491,14 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
369
491
-`page`: Page number (number, optional)
370
492
-`perPage`: Results per page (number, optional)
371
493
494
+
-**assign_copilot_to_issue** - Assign Copilot to a specific issue in a GitHub repository
495
+
496
+
-`owner`: Repository owner (string, required)
497
+
-`repo`: Repository name (string, required)
498
+
-`issueNumber`: Issue number (number, required)
499
+
-_Note_: This tool can help with creating a Pull Request with source code changes to resolve the issue. More information can be found at [GitHub Copilot documentation](https://docs.github.com/en/copilot/using-github-copilot/using-copilot-coding-agent-to-work-on-tasks/about-assigning-tasks-to-copilot)
500
+
501
+
372
502
### Pull Requests
373
503
374
504
-**get_pull_request** - Get details of a specific pull request
@@ -427,6 +557,12 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
427
557
-`repo`: Repository name (string, required)
428
558
-`pullNumber`: Pull request number (number, required)
429
559
560
+
-**get_pull_request_diff** - Get the diff of a pull request
561
+
562
+
-`owner`: Repository owner (string, required)
563
+
-`repo`: Repository name (string, required)
564
+
-`pullNumber`: Pull request number (number, required)
565
+
430
566
-**create_pull_request_review** - Create a review on a pull request review
431
567
432
568
-`owner`: Repository owner (string, required)
@@ -439,6 +575,53 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
439
575
- For inline comments: provide `path`, `position` (or `line`), and `body`
440
576
- For multi-line comments: provide `path`, `start_line`, `line`, optional `side`/`start_side`, and `body`
441
577
578
+
-**create_pending_pull_request_review** - Create a pending review for a pull request that can be submitted later
579
+
580
+
-`owner`: Repository owner (string, required)
581
+
-`repo`: Repository name (string, required)
582
+
-`pullNumber`: Pull request number (number, required)
583
+
-`commitID`: SHA of commit to review (string, optional)
584
+
585
+
-**add_pull_request_review_comment_to_pending_review** - Add a comment to the requester's latest pending pull request review
586
+
587
+
-`owner`: Repository owner (string, required)
588
+
-`repo`: Repository name (string, required)
589
+
-`pullNumber`: Pull request number (number, required)
590
+
-`path`: The relative path to the file that necessitates a comment (string, required)
591
+
-`body`: The text of the review comment (string, required)
592
+
-`subjectType`: The level at which the comment is targeted (string, required)
593
+
- Enum: "FILE", "LINE"
594
+
-`line`: The line of the blob in the pull request diff that the comment applies to (number, optional)
595
+
-`side`: The side of the diff to comment on (string, optional)
596
+
- Enum: "LEFT", "RIGHT"
597
+
-`startLine`: For multi-line comments, the first line of the range (number, optional)
598
+
-`startSide`: For multi-line comments, the starting side of the diff (string, optional)
599
+
- Enum: "LEFT", "RIGHT"
600
+
601
+
-**submit_pending_pull_request_review** - Submit the requester's latest pending pull request review
602
+
603
+
-`owner`: Repository owner (string, required)
604
+
-`repo`: Repository name (string, required)
605
+
-`pullNumber`: Pull request number (number, required)
606
+
-`event`: The event to perform (string, required)
607
+
- Enum: "APPROVE", "REQUEST_CHANGES", "COMMENT"
608
+
-`body`: The text of the review comment (string, optional)
609
+
610
+
-**delete_pending_pull_request_review** - Delete the requester's latest pending pull request review
611
+
612
+
-`owner`: Repository owner (string, required)
613
+
-`repo`: Repository name (string, required)
614
+
-`pullNumber`: Pull request number (number, required)
615
+
616
+
-**create_and_submit_pull_request_review** - Create and submit a review for a pull request without review comments
617
+
618
+
-`owner`: Repository owner (string, required)
619
+
-`repo`: Repository name (string, required)
620
+
-`pullNumber`: Pull request number (number, required)
0 commit comments