Skip to content
Module 2Lesson 9 of 15·5:10

GitHub Integration for Automated Workflows

Set up Claude Code's GitHub integration for automated pull request reviews and @claude mentions in issues. Configure MCP servers, custom instructions, and tool permissions for CI/CD.

Claude Code's GitHub integration transforms it from a local development assistant into an automated team member that reviews pull requests, responds to issue mentions, and executes tasks directly within your version control workflow. Setting it up takes minutes and can save your team hours of manual code review.

Getting Started with /install-github-app

Run the /install-github-app command inside Claude Code to begin the setup process. The wizard will:

  1. Install the Claude Code GitHub App on your repository
  2. Guide you through adding your API key
  3. Generate a pull request containing the GitHub Actions workflow files

Once you merge that initial PR, two GitHub Actions are added to your repository's .github/workflows directory.

The Two Default Workflows

Mention Action: @claude in Issues and PRs

Mention @claude in any issue or pull request comment, and Claude will analyze the request, create a plan, execute the task with full codebase access, and post results directly in the thread. This is ideal for bug fixes, feature requests, and code questions.

Pull Request Review Action

Every time you open a pull request, Claude automatically reviews the changes, analyzes the impact of modifications, and posts a detailed review report. This gives you AI-powered code review on every PR without any manual steps.

Customizing the Workflows

After merging the initial setup PR, you can customize the workflow files to fit your project's needs. Common customizations include adding project setup steps and custom instructions:

.github/workflows/claude-mention.yml
1- name: Project Setup
2 run: |
3 npm run setup
4 npm run dev:daemon
Custom Instructions Block
1custom_instructions: |
2 The project is already set up with all dependencies installed.
3 The server is running at localhost:3000.
4 If needed, use the mcp__playwright tools to launch a browser.

Configuring MCP Servers in GitHub Actions

You can give Claude access to MCP servers in GitHub Actions, but unlike local development, you must explicitly list every tool that Claude is allowed to use:

Workflow Configuration
1mcp_config: |
2 {
3 "mcpServers": {
4 "playwright": {
5 "command": "npx",
6 "args": ["@playwright/mcp@latest", "--allowed-origins", "localhost:3000"]
7 }
8 }
9 }
10
11allowed_tools: "Bash(npm:*),mcp__playwright__browser_snapshot,mcp__playwright__browser_click"

Explicit tool permissions in CI

In GitHub Actions, there is no shortcut for permissions. Every tool from every MCP server must be individually listed in the allowed_tools configuration. This is a security requirement for automated environments.

Key Takeaways

  • 01Run /install-github-app to set up automated code review and @claude mentions.
  • 02Two default workflows: PR review (automatic) and mention handling (@claude in issues/PRs).
  • 03Customize workflows with project setup steps, custom instructions, and MCP server configs.
  • 04In GitHub Actions, every MCP tool must be explicitly listed in allowed_tools.
  • 05Start with defaults and customize gradually as you learn what your team needs.