Add explicit opt-in static authentication for single-tenant HTTP deployments.
When enabled, requests without an Authorization header use the process
GITHUB_PERSONAL_ACCESS_TOKEN; per-request credentials remain authoritative.
Why
HTTP mode currently requires every caller to supply an Authorization header,
even when a single-tenant deployment already has a service credential in the
process environment. Gateways and tunnels that cannot inject custom headers
therefore receive a 401 for every request.
Add the HTTP-only --static-auth flag and GITHUB_STATIC_AUTH environment
equivalent, with startup validation for the configured token.
Fall back only when the Authorization header is absent; explicit empty,
malformed, or unsupported headers remain errors.
Preserve existing token-context and PAT-scope processing, and document the
shared-credential security boundary.
Reject browser-origin requests that would implicitly consume the shared
credential, while preserving explicit bearer-token CORS and OAuth metadata.
MCP impact
No tool or API changes
Tool schema or behavior changed
New tool added
HTTP transport authentication behavior changes only when static auth is
explicitly enabled. MCP tool definitions and schemas are unchanged.
Prompts tested (tool changes only)
N/A — this changes HTTP authentication configuration, not an MCP tool.
Security / limits
No security or limits impact
Auth / permissions considered
Data exposure, filtering, or token/size limits considered
Static authentication is disabled by default. When enabled, every caller that
omits the header receives the shared credential's permissions, so the docs
require an authenticating trusted gateway or access boundary and recommend
least privilege and --read-only; loopback alone is not presented as
authentication. Browser-origin requests cannot consume the fallback token.
Explicit request credentials always take precedence, and configuration errors
never include the token value.
Tool renaming
I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
I have added the new tool aliases in deprecated_tool_aliases.go
I am not renaming tools as part of this PR
No tools are renamed.
Lint & tests
Linted locally with ./script/lint
Tested locally with ./script/test
./script/lint reports zero issues. ./script/test and an uncached focused
go test -race -count=1 ./pkg/utils ./pkg/http/... ./cmd/github-mcp-server
both pass.
Docs
Not needed
Updated (README / docs / examples)
Updated docs/streamable-http.md with configuration, precedence, startup
validation, browser-origin behavior, and shared-credential safety guidance.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add explicit opt-in static authentication for single-tenant HTTP deployments.
When enabled, requests without an Authorization header use the process
GITHUB_PERSONAL_ACCESS_TOKEN; per-request credentials remain authoritative.
Why
HTTP mode currently requires every caller to supply an Authorization header,
even when a single-tenant deployment already has a service credential in the
process environment. Gateways and tunnels that cannot inject custom headers
therefore receive a 401 for every request.
Fixes #2946
What changed
equivalent, with startup validation for the configured token.
malformed, or unsupported headers remain errors.
shared-credential security boundary.
credential, while preserving explicit bearer-token CORS and OAuth metadata.
MCP impact
HTTP transport authentication behavior changes only when static auth is
explicitly enabled. MCP tool definitions and schemas are unchanged.
Prompts tested (tool changes only)
Security / limits
Static authentication is disabled by default. When enabled, every caller that
omits the header receives the shared credential's permissions, so the docs
require an authenticating trusted gateway or access boundary and recommend
least privilege and --read-only; loopback alone is not presented as
authentication. Browser-origin requests cannot consume the fallback token.
Explicit request credentials always take precedence, and configuration errors
never include the token value.
Tool renaming
No tools are renamed.
Lint & tests
./script/lint reports zero issues. ./script/test and an uncached focused
go test -race -count=1 ./pkg/utils ./pkg/http/... ./cmd/github-mcp-server
both pass.
Docs
Updated docs/streamable-http.md with configuration, precedence, startup
validation, browser-origin behavior, and shared-credential safety guidance.