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
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -186,6 +186,42 @@ To keep your GitHub PAT secure and reusable across different MCP hosts:
186
186
187
187
</details>
188
188
189
+
### OAuth Authentication (stdio mode)
190
+
191
+
For stdio mode (local binary execution), you can use OAuth 2.1 with PKCE instead of a Personal Access Token. This provides an interactive browser-based login flow.
192
+
193
+
#### Prerequisites for OAuth
194
+
195
+
1. Create a GitHub OAuth App at [https://github.com/settings/developers](https://github.com/settings/developers)
196
+
- Set the callback URL to `http://localhost` (the actual port will be dynamically assigned)
197
+
- For public clients, you can use PKCE without a client secret
198
+
199
+
2. Set your OAuth app credentials:
200
+
```bash
201
+
export GITHUB_OAUTH_CLIENT_ID=your_client_id
202
+
export GITHUB_OAUTH_CLIENT_SECRET=your_client_secret # Optional for public clients with PKCE
203
+
```
204
+
205
+
3. Run the server without a PAT:
206
+
```bash
207
+
./github-mcp-server stdio
208
+
```
209
+
210
+
The server will automatically detect the OAuth configuration and launch your browser for authorization. After you approve, the server will receive the token and start normally.
211
+
212
+
#### OAuth Configuration Options
213
+
214
+
-`--oauth-client-id` / `GITHUB_OAUTH_CLIENT_ID` - Your GitHub OAuth app client ID (required for OAuth flow)
215
+
-`--oauth-client-secret` / `GITHUB_OAUTH_CLIENT_SECRET` - Your client secret (optional, PKCE is used)
216
+
-`--oauth-scopes` / `GITHUB_OAUTH_SCOPES` - Comma-separated list of scopes (defaults: `repo,user,gist,notifications,read:org,project`)
0 commit comments