GitHub Integration Setup Guide

Repository management and GitHub operations

Package: @smithery-ai/githubView on Smithery

GitHub Integration Setup Guide

The GitHub MCP integration enables Benny Chat to interact directly with GitHub repositories, issues, pull requests, and code management. This comprehensive integration provides full GitHub API access for development workflows.

Prerequisites

Before you begin, make sure you have:

Step 1: Generate a GitHub Personal Access Token

  1. Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
  2. Click "Generate new token" → "Generate new token (classic)"
  3. Give your token a descriptive name (e.g., "Benny Chat GitHub Integration")
  4. Set expiration (90 days recommended, or "No expiration")
  5. Select scopes based on your needs:
    • For public repositories only: Check public_repo
    • For private repositories: Check repo (Full control of private repositories)
    • For user information: Check read:user
    • For organization access: Check read:org (if needed)
  6. Click "Generate token"
  7. Important: Copy the token immediately - you won't see it again!

Step 2: Add GitHub MCP to Your Smithery Profile

  1. Visit the GitHub MCP page on Smithery
  2. Click "Add to Profile"
  3. Select your Benny Chat profile
  4. In the configuration section:
    • GITHUB_TOKEN: Paste your personal access token
  5. Save the configuration

Step 3: Enable GitHub in Benny Chat

  1. Open Benny Chat and go to Settings
  2. Scroll to "MCP Tool Settings"
  3. Find "GitHub MCP" in the list
  4. Toggle the switch to enable it
  5. Click "Test Connection"
  6. You should see a success message with available tools

Available Features

Once configured, you can perform comprehensive GitHub operations:

Repository Operations

  • Search repositories: "Find repositories related to machine learning"
  • Read file contents: "Show me the README file from my project repo"
  • Search code: "Search for 'async function' in all my repositories"

Code Analysis

  • View commit history: "Show me recent commits in the main branch"
  • Get commit details: "Show me what changed in commit abc123"
  • Code exploration: "What files are in the src/ directory of my project?"

Issue Management

  • Search issues: "Find open issues labeled 'bug' in my repositories"
  • View issue details: "Show me issue #42 from my project"
  • Create issues: "Create an issue about the login bug"
  • Add comments: "Add a progress update to issue #15"

Pull Request Analysis & Review

  • Review PRs: "Show me pull request #23 details"
  • List PRs: "What pull requests are open in my repo?"
  • View PR comments: "Show me the review comments on PR #18"
  • Add review comments: "Add a review comment to PR #23 about the error handling"

Usage Examples

Code Analysis & Research

  • "Search my repositories for TODO comments"
  • "What files changed in the latest commit to my main branch?"
  • "Show me all open pull requests that need review"
  • "Find repositories using React hooks patterns"

Issue Tracking & Management

  • "List all open issues in my project repository"
  • "Create an issue for the login bug with appropriate labels"
  • "Add a comment to issue #25 with the solution approach"
  • "What's the current status of issue #42?"

Pull Request Review & Collaboration

  • "Show me the review comments on PR #18"
  • "What pull requests are waiting for my review?"
  • "Analyze the changes in pull request #23"
  • "Add a review comment to PR #15 suggesting error handling improvements"
  • "Comment on the authentication logic in PR #42"

Advanced Configuration

Custom Behavior Rules (System Prompt)

You can customize how the AI assistant behaves when using GitHub operations by setting custom behavior rules:

  1. Go to Benny Chat Settings → "MCP Tool Settings"
  2. Find "GitHub MCP" and enable it
  3. Click "Edit Behavior Rules" next to the GitHub integration
  4. Customize the prompt to define specific GitHub workflows, coding standards, or operational preferences

Example Custom Rules:

- Always create feature branches prefixed with "feature/" - Include unit tests when creating or modifying code files - Use conventional commit format: type(scope): description - Request code review for all pull requests - Add appropriate labels to issues based on content - Follow company coding standards for commit messages

The custom prompt is automatically included when GitHub tools are available, allowing you to maintain consistent workflows across all GitHub operations.

Available vs. Filtered Tools

For security and workflow optimization, Benny Chat provides access to a curated subset of GitHub's full API:

✅ Available Tools:

  • search_repositories - Search for repositories
  • get_file_contents - Read file and directory contents
  • search_code - Search code across repositories
  • get_commit - View commit details
  • list_commits - List commit history
  • create_issue - Create new issues
  • list_issues - List repository issues
  • get_issue - View issue details
  • add_issue_comment - Comment on issues
  • list_pull_requests - List pull requests
  • get_pull_request - View PR details
  • get_pull_request_review_comments - View PR review comments
  • create_pull_request_review_comment - Add review comments to PRs

🚫 Filtered Out (Not Available):

  • Repository creation/deletion operations
  • File modification/push operations
  • Pull request creation/merging
  • Branch management operations
  • User management tools
  • Administrative functions

This filtering ensures safe, read-focused workflows with selective collaboration features (issue/PR commenting) while preventing accidental destructive operations. For advanced repository management, use GitHub's web interface or official CLI tools.

Token Scopes Explained

  • public_repo: Access to public repositories only
  • repo: Full access to private repositories (includes public)
  • read:user: Read user profile information
  • read:org: Read organization membership
  • workflow: Access to GitHub Actions (if needed)

Claude Code GitHub Actions Integration

For enhanced automation capabilities, you can integrate Claude Code GitHub Actions with your repositories to create a powerful AI-powered development workflow:

What it enables:

  • Automated task execution: Create issues in Benny Chat that automatically trigger Claude Code to implement solutions
  • Seamless PR workflow: "@claude" commands in issues can generate pull requests with implemented features
  • Task system integration: Benny Chat's background task system can create GitHub issues that Claude Code automatically processes

Setup Requirements:

  1. GitHub App Installation: Install the Claude GitHub App on your repositories
  2. API Configuration: Add Claude API secrets to your repository settings
  3. CLAUDE.md Configuration: Create project-specific guidelines for Claude Code to follow
  4. Workflow Configuration: Set up GitHub Actions workflows for automated responses

Workflow Example:

  1. Benny Chat analyzes your codebase and creates a GitHub issue: "Implement user authentication with OAuth"
  2. Claude Code GitHub Action automatically detects the issue
  3. Claude Code implements the feature following your project standards
  4. A pull request is created with the implementation for your review
  5. You can comment and iterate using both Benny Chat's GitHub MCP and Claude Code Actions

Best Practices:

  • Use GitHub Secrets for all API keys and sensitive configuration
  • Configure appropriate timeouts and permissions for automated workflows
  • Always review Claude-generated code before merging
  • Set up branch protection rules to require human approval for automated PRs
  • Use the CLAUDE.md file to maintain consistent coding standards across both Benny Chat interactions and automated workflows

This creates a powerful end-to-end AI development assistant that can both analyze your repositories through chat and autonomously implement solutions through GitHub Actions.

Learn more: Claude Code GitHub Actions Documentation

Best Practices

  1. Use minimal scopes: Only grant permissions you need
  2. Regular token rotation: Regenerate tokens every 90 days
  3. Secure storage: Never commit tokens to repositories
  4. Monitor usage: Review token activity in GitHub settings

Troubleshooting

Connection Test Failed

  1. Invalid token: Regenerate your GitHub personal access token
  2. Insufficient permissions: Ensure token has required scopes
  3. Token expired: Check expiration date and regenerate if needed
  4. Rate limiting: Wait a few minutes and try again

Operations Not Working

  1. Repository access: Verify you have appropriate permissions
  2. Private repositories: Ensure token has repo scope
  3. Organization repos: May need read:org scope
  4. API rate limits: GitHub has rate limits; operations may be delayed

Permission Denied

  1. Repository ownership: You can only modify repos you own or have write access to
  2. Branch protection: Some operations may be blocked by branch protection rules
  3. Organization policies: Organization settings may restrict certain operations

Security Considerations

  • Token security: Personal access tokens have the same permissions as your GitHub account
  • Scope limitation: Only grant minimum required scopes
  • Repository access: Only repositories you have access to will be available
  • Audit trail: All operations are logged in GitHub's audit trail
  • No data caching: Operations are performed in real-time via GitHub API

Privacy & Data

  • Direct API access: All operations go directly to GitHub's API
  • No data storage: Benny Chat doesn't store your repository data
  • Session-based: Repository information is only accessed during conversations
  • User-controlled: You control which repositories and operations are accessible

Need Help?

  1. Check the GitHub MCP documentation
  2. Review GitHub's token documentation
  3. Ask Benny Chat for help with specific error messages
  4. Contact GitHub support for API-related issues

Last updated: July 31, 2025 at 1:58 AM