12.2 GitHub Integration
Course: Claude Code - Power User Section: MCP Fundamentals Video Length: 4-5 minutes Presenter: Daniel Treasure
Opening Hook
"GitHub is where code lives. Now your Claude Code workflow can live there too. With the GitHub MCP, you can create PRs, review code, manage issues, and understand your repo structure — all without leaving Claude. Let's see how."
Key Talking Points
1. What the GitHub MCP Does
- Creates, reviews, and updates pull requests
- Views, responds to, and drafts issue comments
- Performs code review with quality and security focus
- Navigates and understands repository structure and layout
- Works directly with the GitHub API via MCP transport
What to say: "Think of GitHub MCP as giving Claude the ability to be your code review partner. Claude can read your PRs, spot issues, suggest improvements, and even create new PRs for you. All powered by the GitHub API."
What to show on screen: GitHub PR view in browser, highlighting sections Claude can interact with (diff, comments, metadata). Then show Claude Code terminal with /mcp status showing GitHub as connected.
2. Setting Up GitHub MCP
- Register the server:
claude mcp add --transport http github https://api.githubcopilot.com/mcp/ - Authentication happens via OAuth on first use
- Scope: Can work at project or user level
- Permissions: Requires GitHub access token scope for PRs, issues
What to say: "Setup is one line. Hit enter, and Claude Code will prompt you to authenticate with GitHub. Give it permission, and you're connected to your repos."
What to show on screen: Terminal running the claude mcp add command, then in Claude Code showing the OAuth prompt and successful connection via /mcp.
3. Working with Pull Requests
- List PRs: Claude can fetch open/closed PRs with filters
- Review PRs: Claude analyzes diffs, spots bugs, security issues, code quality problems
- Create PRs: Claude can create new branches and open PRs from changes
- Update PRs: Add commits, update descriptions, reply to review comments
What to say: "You're in the middle of a coding session with Claude. You've made changes, tested them. Claude can create the PR for you, write the description, and push it to GitHub. Then when it comes back with feedback, Claude reads those comments and responds intelligently."
What to show on screen: Claude Code chat where you ask Claude to review a PR. Show Claude fetching the PR, analyzing the diff in the sidebar, and providing detailed feedback on specific lines. Then show Claude creating a new PR from a branch.
4. Managing Issues
- View issue details and context
- Draft responses to issue comments
- Link code changes to issues in PR descriptions
- Track issue status and update as work progresses
What to say: "Issues are the what. PRs are the how. Claude can read an issue, understand the requirements, and when you've built the solution, link that PR back to the issue. Claude keeps the whole thread connected."
What to show on screen: GitHub issue page with discussion. Then show Claude Code reading that issue context and suggesting a solution. Show how Claude can draft a comment to close the issue.
5. Code Review Workflow
- Claude spots potential bugs, logic errors, security vulnerabilities
- Suggests refactoring for clarity and performance
- Checks best practices and style consistency
- Explains why changes are risky or beneficial
What to say: "Code review is one of the highest-value things Claude can do. When you've written code, Claude can be your first reviewer. Find the issues early, before human review. It's like having a senior engineer on speed dial."
What to show on screen: A PR with code changes. In Claude Code, ask Claude to review it. Show Claude highlighting specific lines with concerns, suggesting improvements, and explaining the reasoning.
Demo Plan
- Start with GitHub open in browser, show a real repository
- In Claude Code, run
claude mcp get githubto verify GitHub MCP is connected - Ask Claude to list recent PRs: "Show me open PRs in this repo"
- Have Claude analyze a PR: "Review this PR and point out any issues"
- Show Claude's detailed analysis with specific line references
- Demonstrate issue linking: Ask Claude to draft a response to a GitHub issue
- Show creating a new PR: Make a code change in Claude, ask Claude to push and open a PR
- Verify the PR appears on GitHub.com
Code Examples & Commands
# Register GitHub MCP
claude mcp add --transport http github https://api.githubcopilot.com/mcp/
# In Claude Code, check GitHub MCP status
/mcp
# Example Claude Code prompts:
# "List open PRs in anthropics/anthropic-sdk-python"
# "Review PR #1234 and highlight any security concerns"
# "Create a PR for the changes I've made to add_feature.py"
# "What does issue #567 need? Propose a solution."
# "Link this change to issue #890 in the PR description"
# Verify connection with:
claude mcp get github
# View GitHub config
claude mcp list | grep github
Gotchas & Tips
- OAuth expires: GitHub tokens can expire. If Claude stops accessing GitHub, re-run
/mcpto re-authenticate. - API rate limits: The GitHub API has rate limits. Heavy usage (lots of PR reviews, issue queries) can hit limits. Claude will handle this gracefully.
- Permissions matter: Make sure your GitHub token has
repo,gist, andread:userscopes. Some actions won't work without them. - Private repos: GitHub MCP respects your permissions. You can only access repos you have access to on GitHub.com.
- Large diffs: Very large PRs (1000+ changed lines) may be slow to review. Claude will still work, but it takes more time.
- Comment history: Claude can read existing PR comments, but can't delete or edit them. It can only add new comments.
Lead-out
"GitHub is just one integration. In the next video, we'll connect Linear to manage project tracking — so your issues and your code changes stay in sync. Then Figma for design specs, and Notion for documentation. Build your complete dev workflow in Claude Code."
Reference URLs
- GitHub MCP server: https://api.githubcopilot.com/mcp/
- GitHub REST API docs: https://docs.github.com/en/rest
- Creating and managing PRs: https://docs.github.com/en/pull-requests
- Issue management: https://docs.github.com/en/issues
- GitHub OAuth scopes: https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps
Prep Reading
- Overview of GitHub MCP capabilities and limitations
- How GitHub authentication and permissions work with MCPs
- Best practices for PR reviews and issue management
- Rate limiting and API usage considerations
Notes for Daniel: This is the first real-world integration. People will be excited to see Claude reviewing their actual code. Keep demos realistic — use a real repo with real PRs, not toy examples.
Demo tip: Have a PR open in GitHub.com on one monitor while Claude Code is on another. Viewers need to see the real GitHub updating as Claude makes changes.
Tone: Emphasis the partnership angle. Claude isn't replacing code review — it's augmenting it. Viewers are other developers who trust their own judgment. Show them Claude as a reliable assistant, not an oracle.
Security note: When demoing with real repos, be careful not to expose API keys or secrets in GitHub diffs. Use sanitized examples if needed.