GitHub Token Setup
August 13, 2025 ยท View on GitHub
Setting up a GitHub Personal Access Token will significantly improve your experience with the shadcn/ui MCP Server.
๐ฏ Why You Need a Token
| Without Token | With Token |
|---|---|
| 60 requests/hour | 5,000 requests/hour |
| Rate limit errors | Reliable performance |
| Slower responses | Faster responses |
| Limited reliability | Better caching |
๐ Getting Your Token (2 minutes)
Step 1: Go to GitHub Settings
- Visit GitHub Settings โ Developer settings โ Personal access tokens โ Tokens (classic)
- Or navigate: GitHub Profile โ Settings โ Developer settings โ Personal access tokens
Step 2: Generate New Token
- Click "Generate new token (classic)"
- Add a note:
"shadcn-ui MCP server" - Expiration: Choose your preference (90 days recommended)
- Scopes: โ No scopes needed! (public repository access is sufficient)
Step 3: Copy Your Token
- Copy the generated token (starts with
ghp_) - โ ๏ธ Save it securely - you won't see it again!
๐ Using Your Token
Method 1: Command Line (Quick testing)
npx @jpisnice/shadcn-ui-mcp-server --github-api-key ghp_your_token_here
Method 2: Environment Variable (Recommended)
# Add to your shell profile (~/.bashrc, ~/.zshrc, etc.)
export GITHUB_PERSONAL_ACCESS_TOKEN=ghp_your_token_here
# Then simply run:
npx @jpisnice/shadcn-ui-mcp-server
Method 3: Single Command
GITHUB_PERSONAL_ACCESS_TOKEN=ghp_your_token_here npx @jpisnice/shadcn-ui-mcp-server
๐ง Framework-Specific Usage
React (Default)
npx @jpisnice/shadcn-ui-mcp-server --github-api-key ghp_your_token_here
Svelte
npx @jpisnice/shadcn-ui-mcp-server --framework svelte --github-api-key ghp_your_token_here
Vue
npx @jpisnice/shadcn-ui-mcp-server --framework vue --github-api-key ghp_your_token_here
๐ Security Best Practices
- Never commit tokens to version control
- Use environment variables in production
- Set appropriate expiration dates
- Rotate tokens regularly
- Use minimal required scopes (none needed for this server)
๐ Troubleshooting
Token Not Working
# Check if token is valid
curl -H "Authorization: token ghp_your_token_here" https://api.github.com/user
# Should return your GitHub user info
Rate Limit Still Exceeded
# Check your current rate limit
curl -H "Authorization: token ghp_your_token_here" https://api.github.com/rate_limit
# Look for "remaining" field in the response
Environment Variable Not Recognized
# Verify the variable is set
echo $GITHUB_PERSONAL_ACCESS_TOKEN
# Should show your token (starts with ghp_)
๐ Next Steps
- Installation - Complete installation guide
- Framework Selection - Choose your framework
- First Steps - Make your first component request
- Integration - Connect to your editor or tool