MCP Setup Guide
How to Set Up GitHub MCP with ClawdBot
Connect ClawdBot to your GitHub repos: read code, search issues, and even open PRs—all via natural language.
Overview
The GitHub MCP lets ClawdBot:
- Read repository contents and file trees
- Search issues and pull requests
- Create issues and PRs (with write scopes)
- List commits and branches
Prerequisites
- ClawdBot installed and running
- GitHub account
- Personal Access Token (PAT) with correct scopes
- Docker (for CLI method) or internet access (for SSE method)
Step 1 — Create a Personal Access Token
- Go to GitHub Settings → Developer settings → Personal access tokens
- Click "Generate new token (classic)"
- Select scopes:
repo— full repository accessread:org— read org membership (if using org repos)
- Copy the token immediately (you won't see it again)
Step 2 — Choose Your Config Method
Option A: CLI Server (Docker)
Best for local development. Runs in a container, auto-stops when ClawdBot exits.
GitHub CLI Config json
{
"GitHub": {
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}"
}
}
} Important: Store GITHUB_TOKEN as an environment variable, not plaintext.
Option B: SSE Server (URL)
Simpler setup, uses GitHub Copilot's hosted MCP endpoint.
GitHub SSE Config json
{
"GitHub": {
"url": "https://api.githubcopilot.com/mcp/"
}
} This method requires GitHub Copilot subscription for full functionality.
Step 3 — Verify
- Run
clawdbot status— GitHub MCP should show as "running" - Test: "List my recent repositories"
- Test: "Search issues in owner/repo with label bug"
Common Errors
| Error | Cause | Fix |
|---|---|---|
401 Unauthorized | Invalid or expired PAT | Regenerate token, check expiration |
403 Forbidden | Missing scopes | Add repo and read:org scopes |
Docker not found | Docker not installed or not running | Install Docker Desktop, start daemon |
Rate limit exceeded | Too many API calls | Wait 1 hour or use authenticated requests |
Security Notes
- Use fine-grained PATs when possible (limit to specific repos)
- Never commit tokens to version control
- Rotate tokens regularly (every 90 days recommended)
- For org repos, consider a dedicated bot account
Example Prompts
- "Show the README of owner/repo"
- "List open issues in owner/repo labeled 'enhancement'"
- "Create an issue titled 'Fix login bug' in owner/repo"
- "Show recent commits on main branch of owner/repo"
Related MCPs
- Filesystem — for local code access
- PostgreSQL — for database queries
- Top 10 MCPs — full curated list