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
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1502,6 +1502,18 @@ Following tools will filter out content from users lacking the push access:
1502
1502
-`pull_request_read:get_review_comments`
1503
1503
-`pull_request_read:get_reviews`
1504
1504
1505
+
## Pull Request Author Allowlist
1506
+
1507
+
To restrict mutating pull request tools to bot-authored PRs, use `--allowed-pr-authors` or `GITHUB_ALLOWED_PR_AUTHORS` with a comma-separated list of GitHub logins:
When set, tools such as `merge_pull_request`, `update_pull_request`, review-write tools, and PR branch updates fetch the target PR and reject the call unless `pr.User.Login` is in the allowlist. Read-only PR tools and `create_pull_request` are not restricted. `actions_run_trigger` is not gated by this setting because it targets a ref rather than a PR number.
1514
+
1515
+
In HTTP mode, `GITHUB_PERSONAL_ACCESS_TOKEN` can also be used as a server-side default token for trusted local deployments. Requests with an `Authorization` header still use the request token; requests without one fall back to the configured server token. This means the server's GitHub identity is used for any unauthenticated HTTP request, so only enable this when the HTTP endpoint is on a trusted network.
1516
+
1505
1517
## i18n / Overriding Descriptions
1506
1518
1507
1519
The descriptions of the tools can be overridden by creating a
rootCmd.PersistentFlags().StringSlice("allowed-pr-authors", nil, "Comma-separated list of pull request author logins allowed for mutating pull request tools")
Copy file name to clipboardExpand all lines: docs/server-configuration.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ We currently support the following ways in which the GitHub MCP Server can be co
13
13
| Read-Only Mode |`X-MCP-Readonly` header or `/readonly` URL |`--read-only` flag or `GITHUB_READ_ONLY` env var |
14
14
| Dynamic Mode | Not available |`--dynamic-toolsets` flag or `GITHUB_DYNAMIC_TOOLSETS` env var |
15
15
| Lockdown Mode |`X-MCP-Lockdown` header |`--lockdown-mode` flag or `GITHUB_LOCKDOWN_MODE` env var |
16
+
| PR Author Allowlist | Server `--allowed-pr-authors` flag or `GITHUB_ALLOWED_PR_AUTHORS` env var |`--allowed-pr-authors` flag or `GITHUB_ALLOWED_PR_AUTHORS` env var |
16
17
| Insiders Mode |`X-MCP-Insiders` header or `/insiders` URL |`--insiders` flag or `GITHUB_INSIDERS` env var |
17
18
| Feature Flags |`X-MCP-Features` header |`--features` flag |
@@ -30,6 +31,8 @@ Note: **read-only** mode acts as a strict security filter that takes precedence
30
31
31
32
Note: **excluded tools** takes precedence over toolsets and individual tools — listed tools are always excluded, even if their toolset is enabled or they are explicitly added via `--tools` / `X-MCP-Tools`.
32
33
34
+
Note: **PR author allowlist** restricts mutating pull request tools to existing pull requests authored by the configured GitHub logins. Read-only PR tools and `create_pull_request` are not restricted. `actions_run_trigger` is not restricted by this setting because it targets a ref rather than a pull request number.
35
+
33
36
---
34
37
35
38
## Configuration Examples
@@ -387,6 +390,33 @@ Lockdown mode ensures the server only surfaces content in public repositories fr
387
390
388
391
---
389
392
393
+
### PR Author Allowlist
394
+
395
+
**Best for:** Automation workflows that may mutate bot-authored pull requests but should never mutate human-authored pull requests.
396
+
397
+
When set, mutating pull request tools first fetch the target pull request and check `pr.User.Login`. If the author is not in the allowlist, the tool returns an error before making the mutation. Empty or unset means unrestricted behavior.
Known limitations: `actions_run_trigger` operates on refs, not pull request numbers, so it is not gated by this setting. Review-thread resolve and unresolve tools take only opaque thread IDs and are not gated by the PR author allowlist. The allowlist checks `pr.User.Login`; PRs from forks authored by allowed bots still pass. Enabling the allowlist adds one API call before a mutating PR operation when the handler does not already have the pull request.
417
+
418
+
---
419
+
390
420
### Insiders Mode
391
421
392
422
**Best for:** Users who want early access to experimental features and new tools before they reach general availability.
Copy file name to clipboardExpand all lines: docs/streamable-http.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,3 +91,15 @@ To provide PAT credentials, or to customize server behavior preferences, you can
91
91
```
92
92
93
93
See [Remote Server](./remote-server.md) documentation for more details on client configuration options.
94
+
95
+
### Using a Server-Side Default Token
96
+
97
+
For trusted local deployments, HTTP mode can use `GITHUB_PERSONAL_ACCESS_TOKEN` as a fallback when a request does not include an `Authorization` header:
If a request includes `Authorization: Bearer ...`, that request token takes precedence. If no request token is provided and no server-side token is configured, the server returns `401 Unauthorized`.
104
+
105
+
When this fallback is enabled, the server's GitHub identity is used for every HTTP request without an `Authorization` header. Only expose the endpoint on a trusted network.
0 commit comments