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
feat: add build-time OAuth credentials for seamless authentication
- Add internal/buildinfo package for build-injected OAuth credentials
- Update goreleaser and Dockerfile to inject credentials via ldflags
- Update main.go to use baked-in credentials as fallback (PAT > explicit OAuth > baked-in)
- Update GitHub Actions workflows to pass secrets to builds
- Update documentation with new authentication flow
Copy file name to clipboardExpand all lines: docs/oauth-authentication.md
+76-13Lines changed: 76 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,26 +6,80 @@ The GitHub MCP Server supports OAuth authentication for stdio mode, enabling int
6
6
7
7
OAuth authentication allows users to authenticate with GitHub through their browser without pre-configuring a token. This is useful for:
8
8
9
+
-**End users** who want authentication to "just work" without configuration
9
10
-**Interactive sessions** where users want to authenticate on-demand
10
11
-**Docker deployments** where tokens shouldn't be baked into images
11
12
-**Multi-user scenarios** where each user authenticates individually
12
13
13
-
## Configuration
14
+
## How It Works
14
15
15
-
### Required Environment Variables
16
+
Official releases of the GitHub MCP Server include built-in OAuth credentials, providing a seamless authentication experience. When you run the server without a PAT configured, it will automatically prompt for OAuth authentication when a tool requires it.
17
+
18
+
### Authentication Priority
19
+
20
+
The server uses the following priority for authentication:
21
+
22
+
1.**Personal Access Token** (GITHUB_PERSONAL_ACCESS_TOKEN) - Highest priority, explicit user choice
23
+
2.**Explicit OAuth configuration** (--oauth-client-id flag/env) - Developer/power user override
24
+
3.**Built-in OAuth credentials** - Default for official releases, "just works"
25
+
4.**No authentication** - Warning displayed, tools will fail when called
26
+
27
+
## Quick Start
28
+
29
+
For most users, simply run the server without any configuration:
30
+
31
+
```bash
32
+
# Official releases include built-in OAuth - just run and authenticate when prompted
33
+
./github-mcp-server stdio
34
+
```
35
+
36
+
The server will prompt for browser-based authentication when you first call a tool that requires GitHub access.
37
+
38
+
## Developer Configuration
39
+
40
+
Developers building from source or wanting to use their own OAuth app can provide credentials explicitly.
41
+
42
+
### Environment Variables
16
43
17
44
| Variable | Description | Required |
18
45
|----------|-------------|----------|
19
-
|`GITHUB_OAUTH_CLIENT_ID`| OAuth app client ID |Yes|
46
+
|`GITHUB_OAUTH_CLIENT_ID`| OAuth app client ID |For custom OAuth apps|
0 commit comments