Skip to content

Commit 7628052

Browse files
authored
Merge branch 'main' into feat/lint-readonly-hint-annotation-2483
2 parents 3356343 + 7d46f8d commit 7628052

45 files changed

Lines changed: 2679 additions & 211 deletions

Some content is hidden

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

.github/workflows/docker-publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ jobs:
5454
# multi-platform images and export cache
5555
# https://github.com/docker/setup-buildx-action
5656
- name: Set up Docker Buildx
57-
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
57+
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
5858

5959
# Login against a Docker registry except on PR
6060
# https://github.com/docker/login-action
6161
- name: Log into registry ${{ env.REGISTRY }}
6262
if: github.event_name != 'pull_request'
63-
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
63+
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
6464
with:
6565
registry: ${{ env.REGISTRY }}
6666
username: ${{ github.actor }}
@@ -70,7 +70,7 @@ jobs:
7070
# https://github.com/docker/metadata-action
7171
- name: Extract Docker metadata
7272
id: meta
73-
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
73+
uses: docker/metadata-action@80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9 # v6.1.0
7474
with:
7575
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
7676
tags: |
@@ -106,7 +106,7 @@ jobs:
106106
# https://github.com/docker/build-push-action
107107
- name: Build and push Docker image
108108
id: build-and-push
109-
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
109+
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
110110
with:
111111
context: .
112112
push: ${{ github.event_name != 'pull_request' }}

.github/workflows/mcp-diff.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
fetch-depth: 0
2121

2222
- name: Set up Go
23-
uses: actions/setup-go@v5
23+
uses: actions/setup-go@v6
2424
with:
2525
go-version-file: go.mod
2626

@@ -85,7 +85,7 @@ jobs:
8585
fetch-depth: 0
8686

8787
- name: Set up Go
88-
uses: actions/setup-go@v5
88+
uses: actions/setup-go@v6
8989
with:
9090
go-version-file: go.mod
9191

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:26-alpine@sha256:e71ac5e964b9201072425d59d2e876359efa25dc96bb1768cb73295728d6e4ea AS ui-build
1+
FROM node:26-alpine@sha256:7c6af15abe4e3de859690e7db171d0d711bf37d27528eddfe625b2fe89e097f8 AS ui-build
22
WORKDIR /app
33
COPY ui/package*.json ./ui/
44
RUN cd ui && npm ci

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ To keep your GitHub PAT secure and reusable across different MCP hosts:
212212

213213
```bash
214214
# CLI usage
215-
claude mcp update github -e GITHUB_PERSONAL_ACCESS_TOKEN=$GITHUB_PAT
215+
claude mcp add github -e GITHUB_PERSONAL_ACCESS_TOKEN=$GITHUB_PAT -- docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server
216216

217217
# In config files (where supported)
218218
"env": {

cmd/github-mcp-server/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ var (
153153
ExcludeTools: excludeTools,
154154
EnabledFeatures: enabledFeatures,
155155
InsidersMode: viper.GetBool("insiders"),
156+
TrustProxyHeaders: viper.GetBool("trust-proxy-headers"),
156157
}
157158

158159
return ghhttp.RunHTTPServer(httpConfig)
@@ -186,6 +187,7 @@ func init() {
186187
httpCmd.Flags().String("base-url", "", "Base URL where this server is publicly accessible (for OAuth resource metadata)")
187188
httpCmd.Flags().String("base-path", "", "Externally visible base path for the HTTP server (for OAuth resource metadata)")
188189
httpCmd.Flags().Bool("scope-challenge", false, "Enable OAuth scope challenge responses")
190+
httpCmd.Flags().Bool("trust-proxy-headers", false, "Honor X-Forwarded-Host and X-Forwarded-Proto when constructing OAuth resource metadata URLs. Only enable when the server is deployed behind a trusted proxy that sets these headers. Ignored when --base-url is set.")
189191

190192
// Bind flag to viper
191193
_ = viper.BindPFlag("toolsets", rootCmd.PersistentFlags().Lookup("toolsets"))
@@ -205,6 +207,7 @@ func init() {
205207
_ = viper.BindPFlag("base-url", httpCmd.Flags().Lookup("base-url"))
206208
_ = viper.BindPFlag("base-path", httpCmd.Flags().Lookup("base-path"))
207209
_ = viper.BindPFlag("scope-challenge", httpCmd.Flags().Lookup("scope-challenge"))
210+
_ = viper.BindPFlag("trust-proxy-headers", httpCmd.Flags().Lookup("trust-proxy-headers"))
208211
// Add subcommands
209212
rootCmd.AddCommand(stdioCmd)
210213
rootCmd.AddCommand(httpCmd)

docs/feature-flags.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,27 @@ runtime behavior (such as output formatting) won't appear here.
7373

7474
### `remote_mcp_issue_fields`
7575

76+
- **issue_write** - Create or update issue
77+
- **Required OAuth Scopes**: `repo`
78+
- `assignees`: Usernames to assign to this issue (string[], optional)
79+
- `body`: Issue body content (string, optional)
80+
- `duplicate_of`: Issue number that this issue is a duplicate of. Only used when state_reason is 'duplicate'. (number, optional)
81+
- `issue_fields`: Issue field values to set or clear. Each item requires 'field_name' and exactly one of 'value', 'field_option_name', or 'delete: true'. (object[], optional)
82+
- `issue_number`: Issue number to update (number, optional)
83+
- `labels`: Labels to apply to this issue (string[], optional)
84+
- `method`: Write operation to perform on a single issue.
85+
Options are:
86+
- 'create' - creates a new issue.
87+
- 'update' - updates an existing issue.
88+
(string, required)
89+
- `milestone`: Milestone number (number, optional)
90+
- `owner`: Repository owner (string, required)
91+
- `repo`: Repository name (string, required)
92+
- `state`: New state (string, optional)
93+
- `state_reason`: Reason for the state change. Ignored unless state is changed. (string, optional)
94+
- `title`: Issue title (string, optional)
95+
- `type`: Type of this issue. Only use if the repository has issue types configured. Use list_issue_types tool to get valid type values for the organization. If the repository doesn't support issue types, omit this parameter. (string, optional)
96+
7697
- **list_issue_fields** - List issue fields
7798
- **Required OAuth Scopes**: `repo`, `read:org`
7899
- **Accepted OAuth Scopes**: `admin:org`, `read:org`, `repo`, `write:org`
@@ -177,6 +198,7 @@ runtime behavior (such as output formatting) won't appear here.
177198

178199
- **update_issue_type** - Update Issue Type
179200
- **Required OAuth Scopes**: `repo`
201+
- `is_suggestion`: If true, this issue type change is sent to the API as a suggestion (suggest:true) rather than an applied value. Whether the type is applied or recorded as a proposal is determined by the API. (boolean, optional)
180202
- `issue_number`: The issue number to update (number, required)
181203
- `issue_type`: The issue type to set (string, required)
182204
- `owner`: Repository owner (username or organization) (string, required)

docs/insiders-features.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,27 @@ The list below is generated from the Go source. It covers tool **inventory and s
6767

6868
### `remote_mcp_issue_fields`
6969

70+
- **issue_write** - Create or update issue
71+
- **Required OAuth Scopes**: `repo`
72+
- `assignees`: Usernames to assign to this issue (string[], optional)
73+
- `body`: Issue body content (string, optional)
74+
- `duplicate_of`: Issue number that this issue is a duplicate of. Only used when state_reason is 'duplicate'. (number, optional)
75+
- `issue_fields`: Issue field values to set or clear. Each item requires 'field_name' and exactly one of 'value', 'field_option_name', or 'delete: true'. (object[], optional)
76+
- `issue_number`: Issue number to update (number, optional)
77+
- `labels`: Labels to apply to this issue (string[], optional)
78+
- `method`: Write operation to perform on a single issue.
79+
Options are:
80+
- 'create' - creates a new issue.
81+
- 'update' - updates an existing issue.
82+
(string, required)
83+
- `milestone`: Milestone number (number, optional)
84+
- `owner`: Repository owner (string, required)
85+
- `repo`: Repository name (string, required)
86+
- `state`: New state (string, optional)
87+
- `state_reason`: Reason for the state change. Ignored unless state is changed. (string, optional)
88+
- `title`: Issue title (string, optional)
89+
- `type`: Type of this issue. Only use if the repository has issue types configured. Use list_issue_types tool to get valid type values for the organization. If the repository doesn't support issue types, omit this parameter. (string, optional)
90+
7091
- **list_issue_fields** - List issue fields
7192
- **Required OAuth Scopes**: `repo`, `read:org`
7293
- **Accepted OAuth Scopes**: `admin:org`, `read:org`, `repo`, `write:org`

docs/installation-guides/install-codex.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ bearer_token_env_var = "GITHUB_PAT_TOKEN"
2020

2121
You can also add it via the Codex CLI:
2222

23-
```cli
24-
codex mcp add github --url https://api.githubcopilot.com/mcp/
23+
```bash
24+
codex mcp add github --url https://api.githubcopilot.com/mcp/ --bearer-token-env-var GITHUB_PAT_TOKEN
2525
```
2626

27+
The `--bearer-token-env-var` option is required for PAT-authenticated access to the hosted GitHub MCP server.
28+
2729
<details>
2830
<summary><b>Storing Your PAT Securely</b></summary>
2931
<br>

docs/streamable-http.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ The OAuth protected resource metadata's `resource` attribute will be populated w
5959

6060
This allows OAuth clients to discover authentication requirements and endpoint information automatically.
6161

62+
### Behind a Trusted Proxy (advanced)
63+
64+
By default, the server ignores the `X-Forwarded-Host` and `X-Forwarded-Proto` headers when constructing OAuth resource metadata URLs, so an untrusted client cannot influence the URL advertised to MCP clients. For most deployments, setting `--base-url` to the externally visible URL is the right approach.
65+
66+
If the server sits behind an internal forwarder that you fully control (for example, an in-cluster gateway that needs to preserve the originating hostname per request), you can opt into honoring those headers:
67+
68+
```bash
69+
github-mcp-server http --trust-proxy-headers
70+
```
71+
72+
Equivalent environment variable: `GITHUB_TRUST_PROXY_HEADERS=1`. Only enable this when the upstream proxy is trusted to set or strip these headers; otherwise prefer `--base-url`. When `--base-url` is set, it always takes precedence and `--trust-proxy-headers` has no effect.
73+
6274
## Client Configuration
6375

6476
### Using OAuth Authentication

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ module github.com/github/github-mcp-server
33
go 1.25.0
44

55
require (
6-
github.com/go-chi/chi/v5 v5.2.5
6+
github.com/go-chi/chi/v5 v5.3.0
77
github.com/go-viper/mapstructure/v2 v2.5.0
88
github.com/google/go-github/v87 v87.0.0
99
github.com/google/jsonschema-go v0.4.3
1010
github.com/josephburnett/jd/v2 v2.5.0
1111
github.com/lithammer/fuzzysearch v1.1.8
1212
github.com/microcosm-cc/bluemonday v1.0.27
13-
github.com/modelcontextprotocol/go-sdk v1.6.0
13+
github.com/modelcontextprotocol/go-sdk v1.6.1
1414
github.com/muesli/cache2go v0.0.0-20221011235721-518229cd8021
1515
github.com/shurcooL/githubv4 v0.0.0-20240727222349-48295856cce7
1616
github.com/shurcooL/graphql v0.0.0-20230722043721-ed46e5a46466

0 commit comments

Comments
 (0)