Skip to content

Commit a57a03b

Browse files
authored
Merge branch 'main' into feat/go-github-v73
2 parents b53cb1d + d15026b commit a57a03b

16 files changed

+403
-126
lines changed

CONTRIBUTING.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,21 @@ Please note that this project is released with a [Contributor Code of Conduct](C
1414

1515
These are one time installations required to be able to test your changes locally as part of the pull request (PR) submission process.
1616

17-
1. install Go [through download](https://go.dev/doc/install) | [through Homebrew](https://formulae.brew.sh/formula/go)
18-
1. [install golangci-lint v2](https://golangci-lint.run/welcome/install/#local-installation)
17+
1. Install Go [through download](https://go.dev/doc/install) | [through Homebrew](https://formulae.brew.sh/formula/go)
18+
2. [Install golangci-lint v2](https://golangci-lint.run/welcome/install/#local-installation)
1919

2020
## Submitting a pull request
2121

2222
1. [Fork][fork] and clone the repository
23-
1. Make sure the tests pass on your machine: `go test -v ./...`
24-
1. Make sure linter passes on your machine: `golangci-lint run`
25-
1. Create a new branch: `git checkout -b my-branch-name`
26-
1. Make your change, add tests, and make sure the tests and linter still pass
27-
1. Push to your fork and [submit a pull request][pr] targeting the `main` branch
28-
1. Pat yourself on the back and wait for your pull request to be reviewed and merged.
23+
2. Make sure the tests pass on your machine: `go test -v ./...`
24+
3. Make sure linter passes on your machine: `golangci-lint run`
25+
4. Create a new branch: `git checkout -b my-branch-name`
26+
5. Add your changes and tests, and make sure the Action workflows still pass
27+
- Run linter: `script/lint`
28+
- Update snapshots and run tests: `UPDATE_TOOLSNAPS=true go test ./...`
29+
- Update readme documentation: `script/generate-docs`
30+
6. Push to your fork and [submit a pull request][pr] targeting the `main` branch
31+
7. Pat yourself on the back and wait for your pull request to be reviewed and merged.
2932

3033
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
3134

README.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
550550
<summary>Context</summary>
551551

552552
- **get_me** - Get my user profile
553-
- `reason`: Optional: the reason for requesting the user information (string, optional)
553+
- No parameters required
554554

555555
</details>
556556

@@ -870,7 +870,7 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
870870
- `owner`: Repository owner (username or organization) (string, required)
871871
- `path`: Path where to create/update the file (string, required)
872872
- `repo`: Repository name (string, required)
873-
- `sha`: SHA of file being replaced (for updates) (string, optional)
873+
- `sha`: Required if updating an existing file. The blob SHA of the file being replaced. (string, optional)
874874

875875
- **create_repository** - Create repository
876876
- `autoInit`: Initialize with README (boolean, optional)
@@ -899,10 +899,10 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
899899

900900
- **get_file_contents** - Get file or directory contents
901901
- `owner`: Repository owner (username or organization) (string, required)
902-
- `path`: Path to file/directory (directories must end with a slash '/') (string, required)
902+
- `path`: Path to file/directory (directories must end with a slash '/') (string, optional)
903903
- `ref`: Accepts optional git refs such as `refs/tags/{tag}`, `refs/heads/{branch}` or `refs/pull/{pr_number}/head` (string, optional)
904904
- `repo`: Repository name (string, required)
905-
- `sha`: Accepts optional git sha, if sha is specified it will be used instead of ref (string, optional)
905+
- `sha`: Accepts optional commit SHA. If specified, it will be used instead of ref (string, optional)
906906

907907
- **get_tag** - Get tag details
908908
- `owner`: Repository owner (string, required)
@@ -916,12 +916,12 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
916916
- `repo`: Repository name (string, required)
917917

918918
- **list_commits** - List commits
919-
- `author`: Author username or email address (string, optional)
919+
- `author`: Author username or email address to filter commits by (string, optional)
920920
- `owner`: Repository owner (string, required)
921921
- `page`: Page number for pagination (min 1) (number, optional)
922922
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
923923
- `repo`: Repository name (string, required)
924-
- `sha`: The commit SHA, branch name, or tag name to list commits from. If not specified, defaults to the repository's default branch. (string, optional)
924+
- `sha`: Commit SHA, branch or tag name to list commits of. If not provided, uses the default branch of the repository. If a commit SHA is provided, will list commits up to that SHA. (string, optional)
925925

926926
- **list_tags** - List tags
927927
- `owner`: Repository owner (string, required)
@@ -982,6 +982,21 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
982982
</details>
983983
<!-- END AUTOMATED TOOLS -->
984984

985+
### Additional Tools in Remote Github MCP Server
986+
987+
<details>
988+
989+
<summary>Copilot coding agent</summary>
990+
991+
- **create_pull_request_with_copilot** - Perform task with GitHub Copilot coding agent
992+
- `owner`: Repository owner. You can guess the owner, but confirm it with the user before proceeding. (string, required)
993+
- `repo`: Repository name. You can guess the repository name, but confirm it with the user before proceeding. (string, required)
994+
- `problem_statement`: Detailed description of the task to be performed (e.g., 'Implement a feature that does X', 'Fix bug Y', etc.) (string, required)
995+
- `title`: Title for the pull request that will be created (string, required)
996+
- `base_ref`: Git reference (e.g., branch) that the agent will start its work from. If not specified, defaults to the repository's default branch (string, optional)
997+
998+
</details>
999+
9851000
## Library Usage
9861001

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

docs/host-integration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ flowchart LR
6464
- **Local MCP Server**: An MCP Server running locally, side-by-side with the Application.
6565
- **Remote MCP Server**: An MCP Server running remotely, accessed via the internet. Most Remote MCP Servers require authentication via OAuth.
6666

67-
For more detail, see the [official MCP specification](https://modelcontextprotocol.io/specification/draft).
67+
For more detail, see the [official MCP specification](https://modelcontextprotocol.io/specification/2025-06-18).
6868

6969
> [!NOTE]
7070
> GitHub offers both a Local MCP Server and a Remote MCP Server.
@@ -84,7 +84,7 @@ For the Remote GitHub MCP Server, the recommended way to obtain a valid access t
8484
> The Remote GitHub MCP Server itself does not provide Authentication services.
8585
> Your client application must obtain valid GitHub access tokens through one of the supported methods.
8686
87-
The expected flow for obtaining a valid access token via OAuth is depicted in the [MCP Specification](https://modelcontextprotocol.io/specification/draft/basic/authorization#authorization-flow-steps). For convenience, we've embedded a copy of the authorization flow below. Please study it carefully as the remainder of this document is written with this flow in mind.
87+
The expected flow for obtaining a valid access token via OAuth is depicted in the [MCP Specification](https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization#authorization-flow-steps). For convenience, we've embedded a copy of the authorization flow below. Please study it carefully as the remainder of this document is written with this flow in mind.
8888

8989
```mermaid
9090
sequenceDiagram

docs/remote-server.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Easily connect to the GitHub MCP Server using the hosted version – no local se
1010

1111
The remote GitHub MCP server is built using this repository as a library, and binding it into GitHub server infrastructure with an internal repository. You can open issues and propose changes in this repository, and we regularly update the remote server to include the latest version of this code.
1212

13+
The remote server has [additional tools](#toolsets-only-available-in-the-remote-mcp-server) that are not available in the local MCP server, such as the `create_pull_request_with_copilot` tool for invoking Copilot coding agent.
14+
1315
## Remote MCP Toolsets
1416

1517
Below is a table of available toolsets for the remote GitHub MCP Server. Each toolset is provided as a distinct URL so you can mix and match to create the perfect combination of tools for your use-case. Add `/readonly` to the end of any URL to restrict the tools in the toolset to only those that enable read access. We also provide the option to use [headers](#headers) instead.
@@ -33,6 +35,14 @@ Below is a table of available toolsets for the remote GitHub MCP Server. Each to
3335

3436
<!-- END AUTOMATED TOOLSETS -->
3537

38+
### Additional _Remote_ Server Toolsets
39+
40+
These toolsets are only available in the remote GitHub MCP Server and are not included in the local MCP server.
41+
42+
| Name | Description | API URL | 1-Click Install (VS Code) | Read-only Link | 1-Click Read-only Install (VS Code) |
43+
| -------------------- | --------------------------------------------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
44+
| Copilot coding agent | Perform task with GitHub Copilot coding agent | https://api.githubcopilot.com/mcp/x/copilot | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-copilot&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fcopilot%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/copilot/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-copilot&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fcopilot%2Freadonly%22%7D) |
45+
3646
### Headers
3747

3848
You can configure toolsets and readonly mode by providing HTTP headers in your server configuration.

pkg/github/__toolsnaps__/create_or_update_file.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"type": "string"
3232
},
3333
"sha": {
34-
"description": "SHA of file being replaced (for updates)",
34+
"description": "Required if updating an existing file. The blob SHA of the file being replaced.",
3535
"type": "string"
3636
}
3737
},

pkg/github/__toolsnaps__/get_file_contents.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"type": "string"
1212
},
1313
"path": {
14+
"default": "/",
1415
"description": "Path to file/directory (directories must end with a slash '/')",
1516
"type": "string"
1617
},
@@ -23,14 +24,13 @@
2324
"type": "string"
2425
},
2526
"sha": {
26-
"description": "Accepts optional git sha, if sha is specified it will be used instead of ref",
27+
"description": "Accepts optional commit SHA. If specified, it will be used instead of ref",
2728
"type": "string"
2829
}
2930
},
3031
"required": [
3132
"owner",
32-
"repo",
33-
"path"
33+
"repo"
3434
],
3535
"type": "object"
3636
},

pkg/github/__toolsnaps__/get_me.snap

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,9 @@
33
"title": "Get my user profile",
44
"readOnlyHint": true
55
},
6-
"description": "Get details of the authenticated GitHub user. Use this when a request includes \"me\", \"my\". The output will not change unless the user changes their profile, so only call this once.",
6+
"description": "Get details of the authenticated GitHub user. Use this when a request is about the user's own profile for GitHub. Or when information is missing to build other tool calls.",
77
"inputSchema": {
8-
"properties": {
9-
"reason": {
10-
"description": "Optional: the reason for requesting the user information",
11-
"type": "string"
12-
}
13-
},
8+
"properties": {},
149
"type": "object"
1510
},
1611
"name": "get_me"

pkg/github/__toolsnaps__/list_commits.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"inputSchema": {
88
"properties": {
99
"author": {
10-
"description": "Author username or email address",
10+
"description": "Author username or email address to filter commits by",
1111
"type": "string"
1212
},
1313
"owner": {
@@ -30,7 +30,7 @@
3030
"type": "string"
3131
},
3232
"sha": {
33-
"description": "The commit SHA, branch name, or tag name to list commits from. If not specified, defaults to the repository's default branch.",
33+
"description": "Commit SHA, branch or tag name to list commits of. If not provided, uses the default branch of the repository. If a commit SHA is provided, will list commits up to that SHA.",
3434
"type": "string"
3535
}
3636
},

pkg/github/__toolsnaps__/list_pull_requests.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"title": "List pull requests",
44
"readOnlyHint": true
55
},
6-
"description": "List pull requests in a GitHub repository.",
6+
"description": "List pull requests in a GitHub repository. If the user specifies an author, then DO NOT use this tool and use the search_pull_requests tool instead.",
77
"inputSchema": {
88
"properties": {
99
"base": {

pkg/github/context_tools.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,11 @@ type UserDetails struct {
3535
// GetMe creates a tool to get details of the authenticated user.
3636
func GetMe(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc) {
3737
tool := mcp.NewTool("get_me",
38-
mcp.WithDescription(t("TOOL_GET_ME_DESCRIPTION", "Get details of the authenticated GitHub user. Use this when a request includes \"me\", \"my\". The output will not change unless the user changes their profile, so only call this once.")),
38+
mcp.WithDescription(t("TOOL_GET_ME_DESCRIPTION", "Get details of the authenticated GitHub user. Use this when a request is about the user's own profile for GitHub. Or when information is missing to build other tool calls.")),
3939
mcp.WithToolAnnotation(mcp.ToolAnnotation{
4040
Title: t("TOOL_GET_ME_USER_TITLE", "Get my user profile"),
4141
ReadOnlyHint: ToBoolPtr(true),
4242
}),
43-
mcp.WithString("reason",
44-
mcp.Description("Optional: the reason for requesting the user information"),
45-
),
4643
)
4744

4845
type args struct{}

0 commit comments

Comments
 (0)