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:
- Completed the Smithery Setup Guide
- A GitHub account
- Access to repositories you want to manage
Step 1: Generate a GitHub Fine-Grained Personal Access Token
- Go to GitHub Settings → Developer settings → Personal access tokens → Fine-grained tokens
- Click "Generate new token"
- Configure basic settings:
- Token name: "Benny Chat GitHub Integration"
- Expiration: 90 days (recommended) or custom date
- Description (optional): "Full GitHub API access for Benny Chat"
- Configure Repository access:
- Select "All repositories" for full functionality
- Or select specific repositories you want to manage
- Configure Permissions (click "Add permissions" if needed):
- Repository permissions:
- Issues: Read and write
- Pull requests: Read and write
- Contents: Read
- Metadata: Read (automatically selected)
- Commit statuses: Read (if using CI/CD features)
- Account permissions:
- Email addresses: Read (optional, for user info)
- Repository permissions:
- Click "Generate token"
- Important: Copy the token immediately - you won't see it again!
Step 2: Add GitHub MCP to Your Smithery Profile
- Visit the GitHub MCP page on Smithery
- Click "Configure" to add it to your profile
- Enter the configuration settings:
githubPersonalAccessToken
: Paste your personal access token from Step 1
- Save the configuration
- Test your setup: Click "Connect" on the GitHub MCP page, then use "Explore capabilities" to verify access
Step 3: Enable GitHub in Benny Chat
- Open Benny Chat and go to Settings
- Scroll to "MCP Tool Settings"
- Find "GitHub MCP" in the list
- Toggle the switch to enable it
- Click "Test Connection"
- 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:
- Go to Benny Chat Settings → "MCP Tool Settings"
- Find "GitHub MCP" and enable it
- Click "Edit Behavior Rules" next to the GitHub integration
- 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 repositoriesget_file_contents
- Read file and directory contentssearch_code
- Search code across repositoriesget_commit
- View commit detailslist_commits
- List commit historycreate_issue
- Create new issueslist_issues
- List repository issuesget_issue
- View issue detailsadd_issue_comment
- Comment on issueslist_pull_requests
- List pull requestsget_pull_request
- View PR detailsget_pull_request_review_comments
- View PR review commentscreate_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 Permissions Explained
Repository Permissions:
- Contents (Read): View repository files and code
- Issues (Read/Write): Create, view, and comment on issues
- Pull requests (Read/Write): View PRs and add review comments
- Metadata (Read): Basic repository information
- Commit statuses (Read): View CI/CD status information
Account Permissions:
- Email addresses (Read): Access user email information (optional)
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:
- GitHub App Installation: Install the Claude GitHub App on your repositories
- API Configuration: Add Claude API secrets to your repository settings
- CLAUDE.md Configuration: Create project-specific guidelines for Claude Code to follow
- Workflow Configuration: Set up GitHub Actions workflows for automated responses
Workflow Example:
- Benny Chat analyzes your codebase and creates a GitHub issue: "Implement user authentication with OAuth"
- Claude Code GitHub Action automatically detects the issue
- Claude Code implements the feature following your project standards
- A pull request is created with the implementation for your review
- 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
- Use minimal scopes: Only grant permissions you need
- Regular token rotation: Regenerate tokens every 90 days
- Secure storage: Never commit tokens to repositories
- Monitor usage: Review token activity in GitHub settings
Troubleshooting
General Debugging Steps
When debugging GitHub MCP setup:
- Test in Smithery first: Use the "Connect" and "Explore capabilities" feature on the GitHub MCP page to verify your configuration
- Test any other MCP tool in Benny Chat - if another tool connects, your Smithery API key and Profile ID are correct
- If only GitHub MCP fails: The issue is with the GitHub token configuration
Connection Test Failed
- Invalid token:
- Ensure
githubPersonalAccessToken
has no extra spaces or quotes - Regenerate token if unsure
- Ensure
- Insufficient permissions:
- Required: Issues (Read/Write), Pull requests (Read/Write), Contents (Read)
- Check in GitHub Settings → Personal access tokens → Fine-grained tokens
- Token expired:
- Check expiration date in GitHub Settings
- Fine-grained tokens show exact expiry date
- Rate limiting:
- GitHub allows 5000 requests/hour for authenticated users
- Wait a few minutes and try again
- Repository access:
- For "All repositories": Token has access to all current and future repos
- For "Selected repositories": Verify specific repos are still selected in token settings
Operations Not Working
- Repository access:
- Verify you have appropriate permissions on the repository itself
- Check repository settings if you're a collaborator
- Private repositories:
- Ensure token has the specific repository selected (for fine-grained tokens)
- Token must be created/edited after repository is made private
- Organization repos:
- Organization must approve fine-grained token access
- Check organization settings → Personal access tokens
- API rate limits:
- Authenticated: 5000 requests/hour
- Check rate limit: Ask "What's my GitHub API rate limit status?"
Permission Denied
- Repository ownership:
- You can only modify repos you own or have write access to
- Check your access level: Settings → Manage access
- Branch protection:
- Some operations blocked by branch protection rules
- Check: Settings → Branches → Protection rules
- Organization policies:
- Organizations can restrict token access
- Fine-grained tokens need org approval for org repos
- Check: Organization settings → Third-party access
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?
- Check the GitHub MCP documentation
- Review GitHub's token documentation
- Ask Benny Chat for help with specific error messages
- Contact GitHub support for API-related issues