Commit 3a0b171
Switch github MCP to gh auth token, removing need for plaintext PAT in env
The github MCP entry in .mcp.json previously read $GITHUB_TOKEN from the shell environment, requiring developers to keep a plaintext PAT in their shell rc files. That token was readable by every child process spawned from that shell (npm postinstall scripts, MCP servers, ad-hoc CLIs), making accidental exfiltration a real concern.
The new pattern launches the MCP via a bash wrapper that runs `gh auth token` at startup, pulling the credential from the macOS Keychain (or gh's credential store on other platforms). No plaintext token needs to live in the shell environment.
Side benefit: `gh auth login` issues an OAuth token with default scopes `gist, read:org, repo, workflow`, dropping the admin-level scopes that typical PATs carry (admin:org, delete_repo, package admin, etc.). The `repo` scope still covers all everyday dev operations -- opening PRs, commenting, merging, branch/commit work -- so no real functionality is lost.
CLAUDE.md gets a new "MCP Servers" section documenting the github MCP setup with the gh-auth-login flow. This repo previously had no MCP-related docs, so this also brings it into line with the conventions in the sibling Hoist repos.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8e2d7f8 commit 3a0b171
2 files changed
Lines changed: 34 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
16 | 9 | | |
17 | 10 | | |
18 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
0 commit comments