- Go to GitHub Personal Access Tokens
- Click "Generate new token" → "Generate new token (classic)"
- Give it a descriptive name, e.g., "OwlBan MCP Server"
- Set expiration (recommend 90 days or never for organizational use)
- Select the following scopes:
-
repo- Full control of private repositories -
read:org- Read org and team membership -
read:user- Read ALL user profile data -
notifications- Access notifications
-
read:packages- Download packages from GitHub Package Registry -
read:project- Read project boards -
read:discussion- Read team discussions
-
write:repo_hook- Write repository hooks -
admin:repo_hook- Full control of repository hooks -
project- Full control of projects -
write:org- Read and write org and team membership -
admin:org- Full control of orgs and teams
- Click "Generate token"
- IMPORTANT: Copy the token immediately - you won't see it again!
# Add to your shell profile (.bashrc, .zshrc, etc.)
export OWLBAN_GITHUB_PAT=your_token_here
# Or create a .env file (add to .gitignore!)
echo "OWLBAN_GITHUB_PAT=your_token_here" > .envStore the token in a secure password manager like:
- 1Password
- LastPass
- Bitwarden
- KeePass
VS Code can store secrets securely using the MCP configuration.
Run this command to verify your token works:
curl -H "Authorization: token YOUR_TOKEN_HERE" https://api.github.com/userYou should see your GitHub user information in JSON format.
- Never commit tokens to version control
- Use the minimum required scopes
- Rotate tokens regularly (every 90 days)
- Use different tokens for different purposes
- Monitor token usage in GitHub settings
- Revoke tokens immediately if compromised
| Scope | Description | Use Case |
|---|---|---|
repo |
Full private repo access | Read/write code, issues, PRs |
read:org |
Read organization data | Access org repos, teams |
read:user |
Read user profile | Get user info, repos |
notifications |
Access notifications | Read GitHub notifications |
read:packages |
Download packages | Access GitHub Package Registry |
read:project |
Read projects | Access project boards |
read:discussion |
Read discussions | Access team discussions |
- Check token hasn't expired
- Verify correct scopes are selected
- Ensure token wasn't accidentally revoked
- Try regenerating the token
- Organization may require SSO authorization
- Check if token has required scopes
- Verify you're a member of the organization
- Authenticated requests have higher limits (5,000 vs 60/hour)
- Check GitHub API status: https://www.githubstatus.com/