Installation and Configuration

bash

`# Install and configure claude mcp add github --env GITHUB_TOKEN=ghp_your_token \ -- npx @modelcontextprotocol/server-github

# Configure permissions in config [mcp.github] allowed_operations = ["read_issues", "create_pr", "update_pr"] rate_limit = 50 # requests per hour`

Capabilities

Advanced GitHub Hook Integration

toml

`[[hooks]] event = "PostToolUse" run_in_background = true

[hooks.matcher] tool_name = "edit_file" file_paths = ["src/**/*"]

command = """ # Auto-create GitHub issue for TODO comments grep -n "TODO\|FIXME\|HACK" $CLAUDE_FILE_PATHS | while read line; do file=$(echo $line | cut -d: -f1) line_num=$(echo $line | cut -d: -f2) comment=$(echo $line | cut -d: -f3-)

# Create GitHub issue if TODO is new gh issue create --title "Code TODO: $comment" \ --body "Found in $file:$line_num\n\n\\\\\\n$comment\\n\\\\\" \ --label "technical-debt" || true done`

GitHub PR Automation

toml

`[[hooks]] event = "Stop"

command = """

Check if we have uncommitted changes

if [ -n "$(git status --porcelain)" ]; then git add -A git commit -m "Claude Code session: $(date '+%Y-%m-%d %H:%M')"

Auto-create PR if on feature branch

BRANCH=$(git branch --show-current) if [[ "$BRANCH" != "main" && "$BRANCH" != "master" ]]; then gh pr create --draft --title "WIP: $BRANCH" \ --body "Auto-generated PR from Claude Code session" || true fi fi """`