8000 Merge branch 'main' into dependabot/docker/golang-1.24.4-alpine · github/github-mcp-server@8227cad · GitHub
[go: up one dir, main page]

Skip to content

Commit 8227cad

Browse files
authored
Merge branch 'main' into dependabot/docker/golang-1.24.4-alpine
2 parents b5002dd + 5502afa commit 8227cad

File tree

23 files changed

+1291
-321
lines changed

23 files changed

+1291
-321
lines changed

README.md

Lines changed: 209 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,128 @@ The GitHub MCP Server is a [Model Context Protocol (MCP)](https://modelcontextpr
44
server that provides seamless integration with GitHub APIs, enabling advanced
55
automation and interaction capabilities for developers and tools.
66

7-
[![Install with Docker in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](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) [![Install with Docker in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install_Server-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](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
108

119
- Automating GitHub workflows and processes.
1210
- Extracting and analyzing data from GitHub repositories.
1311
- Building AI powered tools and applications that interact with GitHub's ecosystem.
1412

13+
---
14+
15+
## Remote GitHub MCP Server
16+
17+
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](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) [![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install_Server-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](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><th align=left colspan=2>VS Code (version 1.101 or greater)</th></tr>
37+
<tr valign=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+
<tr valign=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+
[![Install with Docker in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](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) [![Install with Docker in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install_Server-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](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+
15129
## Prerequisites
16130

17131
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
23137

24138
### Usage with VS Code
25139

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
27143

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.
29145

30146
```json
31147
{
@@ -141,19 +257,25 @@ If you don't have Docker, you can use `go build` to build the binary in the
141257

142258
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.
143259

260+
_Toolsets are not limited to Tools. Relevant MCP Resources and Prompts are also included where applicable._
261+
144262
### Available Toolsets
145263

146264
The following sets of tools are available (all are on by default):
147265

148266
| Toolset | Description |
149267
| ----------------------- | ------------------------------------------------------------- |
150-
| `repos` | Repository-related tools (file operations, branches, commits) |
268+
| `context` | **Strongly recommended**: Tools that provide context about the current user and GitHub context you are operating in |
269+
| `code_security` | Code scanning alerts and security features |
151270
| `issues` | Issue-related tools (create, read, update, comment) |
152-
| `users` | Anything relating to GitHub Users |
271+
| `notifications` | GitHub Notifications related tools |
153272
| `pull_requests` | Pull request operations (create, merge, review) |
154-
| `code_security` | Code scanning alerts and security features |
273+
| `repos` | Repository-related tools (file operations, branches, commits) |
274+
| `secret_protection` | Secret protection related tools, such as GitHub Secret Scanning |
275+
| `users` | Anything relating to GitHub Users |
155276
| `experiments` | Experimental features (not considered stable) |
156277

278+
157279
#### Specifying Toolsets
158280

159281
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
369491
- `page`: Page number (number, optional)
370492
- `perPage`: Results per page (number, optional)
371493

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+
372502
### Pull Requests
373503

374504
- **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
427557
- `repo`: Repository name (string, required)
428558
- `pullNumber`: Pull request number (number, required)
429559

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+
430566
- **create_pull_request_review** - Create a review on a pull request review
431567

432568
- `owner`: Repository owner (string, required)
@@ -439,6 +575,53 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
439575
- For inline comments: provide `path`, `position` (or `line`), and `body`
440576
- For multi-line comments: provide `path`, `start_line`, `line`, optional `side`/`start_side`, and `body`
441577

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)
621+
- `body`: Review comment text (string, required)
622+
- `event`: Review action ('APPROVE', 'REQUEST_CHANGES', 'COMMENT') (string, required)
623+
- `commitID`: SHA of commit to review (string, optional)
624+
442625
- **create_pull_request** - Create a new pull request
443626

444627
- `owner`: Repository owner (string, required)
@@ -494,6 +677,13 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
494677
- `branch`: Branch name (string, optional)
495678
- `sha`: File SHA if updating (string, optional)
496679

680+
- **delete_file** - Delete a file from a GitHub repository
681+
- `owner`: Repository owner (string, required)
682+
- `repo`: Repository name (string, required)
683+
- `path`: Path to the file to delete (string, required)
684+
- `message`: Commit message (string, required)
685+
- `branch`: Branch to delete the file from (string, required)
686+
497687
- **list_branches** - List branches in a GitHub repository
498688
- `owner`: Repository owner (string, required)
499689
- `repo`: Repository name (string, required)
@@ -552,6 +742,17 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
552742
- `page`: Page number, for files in the commit (number, optional)
553743
- `perPage`: Results per page, for files in the commit (number, optional)
554744

745+
- **get_tag** - Get details about a specific git tag in a GitHub repository
746+
- `owner`: Repository owner (string, required)
747+
- `repo`: Repository name (string, required)
748+
- `tag`: Tag name (string, required)
749+
750+
- **list_tags** - List git tags in a GitHub repository
751+
- `owner`: Repository owner (string, required)
752+
- `repo`: Repository name (string, required)
753+
- `page`: Page number (number, optional)
754+
- `perPage`: Results per page (number, optional)
755+
555756
- **search_code** - Search for code across GitHub repositories
556757
- `query`: Search query (string, required)
557758
- `sort`: Sort field (string, optional)
@@ -610,7 +811,6 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
610811
- `page`: Page number (number, optional)
611812
- `perPage`: Results per page (number, optional)
612813

613-
614814
- **get_notification_details** – Get detailed information for a specific GitHub notification
615815
- `notificationID`: The ID of the notification (string, required)
616816

0 commit comments

Comments
 (0)
0