Skip to content

Commit bcbb80f

Browse files
committed
Merge branch 'main' into tommy/tool-specific-config-support
2 parents dd11e3e + b466148 commit bcbb80f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+912
-249
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ jobs:
1818
with:
1919
go-version: stable
2020
- name: golangci-lint
21-
uses: golangci/golangci-lint-action@v8
21+
uses: golangci/golangci-lint-action@v9
2222
with:
2323
version: v2.5

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.25.3-alpine AS build
1+
FROM golang:1.25.4-alpine AS build
22
ARG VERSION="dev"
33

44
# Set the working directory

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ The following sets of tools are available:
433433
| `discussions` | GitHub Discussions related tools |
434434
| `experiments` | Experimental features that are not considered stable yet |
435435
| `gists` | GitHub Gist related tools |
436+
| `git` | GitHub Git API related tools for low-level Git operations |
436437
| `issues` | GitHub Issues related tools |
437438
| `labels` | GitHub Labels related tools |
438439
| `notifications` | GitHub Notifications related tools |
@@ -663,6 +664,19 @@ The following sets of tools are available:
663664

664665
<details>
665666

667+
<summary>Git</summary>
668+
669+
- **get_repository_tree** - Get repository tree
670+
- `owner`: Repository owner (username or organization) (string, required)
671+
- `path_filter`: Optional path prefix to filter the tree results (e.g., 'src/' to only show files in the src directory) (string, optional)
672+
- `recursive`: Setting this parameter to true returns the objects or subtrees referenced by the tree. Default is false (boolean, optional)
673+
- `repo`: Repository name (string, required)
674+
- `tree_sha`: The SHA1 value or ref (branch or tag) name of the tree. Defaults to the repository's default branch (string, optional)
675+
676+
</details>
677+
678+
<details>
679+
666680
<summary>Issues</summary>
667681

668682
- **add_issue_comment** - Add comment to issue
@@ -1275,6 +1289,25 @@ docker run -i --rm \
12751289
ghcr.io/github/github-mcp-server
12761290
```
12771291

1292+
## Lockdown Mode
1293+
1294+
Lockdown mode limits the content that the server will surface from public repositories. When enabled, requests that fetch issue details will return an error if the issue was created by someone who does not have push access to the repository. Private repositories are unaffected, and collaborators can still access their own issues.
1295+
1296+
```bash
1297+
./github-mcp-server --lockdown-mode
1298+
```
1299+
1300+
When running with Docker, set the corresponding environment variable:
1301+
1302+
```bash
1303+
docker run -i --rm \
1304+
-e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
1305+
-e GITHUB_LOCKDOWN_MODE=1 \
1306+
ghcr.io/github/github-mcp-server
1307+
```
1308+
1309+
At the moment lockdown mode applies to the issue read toolset, but it is designed to extend to additional data surfaces over time.
1310+
12781311
## i18n / Overriding Descriptions
12791312

12801313
The descriptions of the tools can be overridden by creating a

cmd/github-mcp-server/generate_docs.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"github.com/github/github-mcp-server/pkg/raw"
1414
"github.com/github/github-mcp-server/pkg/toolsets"
1515
"github.com/github/github-mcp-server/pkg/translations"
16-
gogithub "github.com/google/go-github/v76/github"
16+
gogithub "github.com/google/go-github/v77/github"
1717
"github.com/mark3labs/mcp-go/mcp"
1818
"github.com/shurcooL/githubv4"
1919
"github.com/spf13/cobra"
@@ -64,7 +64,7 @@ func generateReadmeDocs(readmePath string) error {
6464
t, _ := translations.TranslationHelper()
6565

6666
// Create toolset group with mock clients
67-
tsg := github.DefaultToolsetGroup(false, mockGetClient, mockGetGQLClient, mockGetRawClient, t, 5000)
67+
tsg := github.DefaultToolsetGroup(false, mockGetClient, mockGetGQLClient, mockGetRawClient, t, 5000, github.FeatureFlags{})
6868

6969
// Generate toolsets documentation
7070
toolsetsDoc := generateToolsetsDoc(tsg)
@@ -302,7 +302,7 @@ func generateRemoteToolsetsDoc() string {
302302
t, _ := translations.TranslationHelper()
303303

304304
// Create toolset group with mock clients
305-
tsg := github.DefaultToolsetGroup(false, mockGetClient, mockGetGQLClient, mockGetRawClient, t, 5000)
305+
tsg := github.DefaultToolsetGroup(false, mockGetClient, mockGetGQLClient, mockGetRawClient, t, 5000, github.FeatureFlags{})
306306

307307
// Generate table header
308308
buf.WriteString("| Name | Description | API URL | 1-Click Install (VS Code) | Read-only Link | 1-Click Read-only Install (VS Code) |\n")

cmd/github-mcp-server/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ var (
6868
EnableCommandLogging: viper.GetBool("enable-command-logging"),
6969
LogFilePath: viper.GetString("log-file"),
7070
ContentWindowSize: viper.GetInt("content-window-size"),
71+
LockdownMode: viper.GetBool("lockdown-mode"),
7172
}
7273
return ghmcp.RunStdioServer(stdioServerConfig)
7374
},
@@ -90,6 +91,7 @@ func init() {
9091
rootCmd.PersistentFlags().Bool("export-translations", false, "Save translations to a JSON file")
9192
rootCmd.PersistentFlags().String("gh-host", "", "Specify the GitHub hostname (for GitHub Enterprise etc.)")
9293
rootCmd.PersistentFlags().Int("content-window-size", 5000, "Specify the content window size")
94+
rootCmd.PersistentFlags().Bool("lockdown-mode", false, "Enable lockdown mode")
9395

9496
// Bind flag to viper
9597
_ = viper.BindPFlag("toolsets", rootCmd.PersistentFlags().Lookup("toolsets"))
@@ -101,6 +103,7 @@ func init() {
101103
_ = viper.BindPFlag("export-translations", rootCmd.PersistentFlags().Lookup("export-translations"))
102104
_ = viper.BindPFlag("host", rootCmd.PersistentFlags().Lookup("gh-host"))
103105
_ = viper.BindPFlag("content-window-size", rootCmd.PersistentFlags().Lookup("content-window-size"))
106+
_ = viper.BindPFlag("lockdown-mode", rootCmd.PersistentFlags().Lookup("lockdown-mode"))
104107

105108
// Add subcommands
106109
rootCmd.AddCommand(stdioCmd)

cmd/mcpcurl/mcpcurl

6.41 MB
Binary file not shown.

docs/installation-guides/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,5 @@ After installation, you may want to explore:
9494
- **Toolsets**: Enable/disable specific GitHub API capabilities
9595
- **Read-Only Mode**: Restrict to read-only operations
9696
- **Dynamic Tool Discovery**: Enable tools on-demand
97+
- **Lockdown Mode**: Hide public issue details created by users without push access
9798

docs/remote-server.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Below is a table of available toolsets for the remote GitHub MCP Server. Each to
2626
| Discussions | GitHub Discussions related tools | https://api.githubcopilot.com/mcp/x/discussions | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-discussions&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fdiscussions%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/discussions/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-discussions&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fdiscussions%2Freadonly%22%7D) |
2727
| Experiments | Experimental features that are not considered stable yet | https://api.githubcopilot.com/mcp/x/experiments | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-experiments&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fexperiments%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/experiments/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-experiments&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fexperiments%2Freadonly%22%7D) |
2828
| Gists | GitHub Gist related tools | https://api.githubcopilot.com/mcp/x/gists | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-gists&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fgists%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/gists/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-gists&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fgists%2Freadonly%22%7D) |
29+
| Git | GitHub Git API related tools for low-level Git operations | https://api.githubcopilot.com/mcp/x/git | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-git&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fgit%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/git/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-git&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fgit%2Freadonly%22%7D) |
2930
| Issues | GitHub Issues related tools | https://api.githubcopilot.com/mcp/x/issues | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-issues&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fissues%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/issues/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-issues&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fissues%2Freadonly%22%7D) |
3031
| Labels | GitHub Labels related tools | https://api.githubcopilot.com/mcp/x/labels | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-labels&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Flabels%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/labels/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-labels&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Flabels%2Freadonly%22%7D) |
3132
| Notifications | GitHub Notifications related tools | https://api.githubcopilot.com/mcp/x/notifications | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-notifications&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fnotifications%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/notifications/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-notifications&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fnotifications%2Freadonly%22%7D) |

e2e/e2e_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"github.com/github/github-mcp-server/internal/ghmcp"
1919
"github.com/github/github-mcp-server/pkg/github"
2020
"github.com/github/github-mcp-server/pkg/translations"
21-
gogithub "github.com/google/go-github/v76/github"
21+
gogithub "github.com/google/go-github/v77/github"
2222
mcpClient "github.com/mark3labs/mcp-go/client"
2323
"github.com/mark3labs/mcp-go/mcp"
2424
"github.com/stretchr/testify/require"

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/github/github-mcp-server
33
go 1.24.0
44

55
require (
6-
github.com/google/go-github/v76 v76.0.0
6+
github.com/google/go-github/v77 v77.0.0
77
github.com/josephburnett/jd v1.9.2
88
github.com/mark3labs/mcp-go v0.36.0
99
github.com/microcosm-cc/bluemonday v1.0.27

0 commit comments

Comments
 (0)