GitHub Copilot CLI Integration
Complete guide for using Bob the Fixer with GitHub Copilot CLI.
Overview
GitHub Copilot CLI is an AI-powered terminal assistant that acts as your terminal's sidekick. It's an agent that understands your GitHub repositories, issues, and pull requests directly within your terminal.
Key Features:
- Codebase exploration and file editing
- Command execution with explicit user approval
- GitHub context integration (issues, PRs)
- MCP server support for custom tools
How it differs from other AI CLIs:
- Uses GitHub authentication (not separate API keys)
- Agent-based architecture with approval workflows
- Included with Copilot Pro, Pro+, Business, and Enterprise plans
Prerequisites
- Node.js 18+ and npm
- GitHub account with Copilot subscription (Pro, Pro+, Business, or Enterprise)
- Bob the Fixer installed
- SonarQube running
Installation
Step 1: Install GitHub Copilot CLI
npm install -g @github/copilot
Step 2: Create Configuration Directory
mkdir -p ~/.copilot
Step 3: Configure Bob the Fixer
Option A: Run Bob the Fixer Installer
If GitHub Copilot is detected, the installer configures it automatically:
cd /path/to/bob-the-fixer
./install.sh
Option B: Manual Configuration
Create or edit ~/.copilot/mcp-config.json:
{
"mcpServers": {
"bob-the-fixer": {
"type": "local",
"command": "node",
"tools": ["*"],
"args": [
"/path/to/bob-the-fixer/packages/core/dist/universal-mcp-server.js"
],
"env": {
"SONAR_URL": "http://localhost:9000",
"SONAR_TOKEN": "your-token-here",
"LOG_LEVEL": "info",
"LOG_FILE_PATH": "./logs/mcp-server.log"
}
}
}
}
Replace /path/to/bob-the-fixer with your actual installation path.
Authentication
GitHub Copilot CLI uses your GitHub credentials automatically. Unlike Claude or Gemini, you don't need to configure separate API keys.
Requirements:
- Active GitHub account
- Copilot subscription (Pro, Pro+, Business, or Enterprise)
- GitHub CLI authenticated (
gh auth login) or browser-based login
Configuration File
Location
~/.copilot/mcp-config.json
Structure
| Field | Type | Description |
|---|---|---|
type | string | Must be "local" for local MCP servers |
command | string | The command to run (node) |
tools | array | Tool permissions (["*"] for all) |
args | array | Arguments (path to MCP server) |
env | object | Environment variables |
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
SONAR_URL | Yes | - | SonarQube server URL |
SONAR_TOKEN | Yes | - | SonarQube authentication token |
LOG_LEVEL | No | info | Logging verbosity |
LOG_FILE_PATH | No | - | Log file location |
ENCRYPTION_KEY | No | - | Token encryption key |
Adding to Existing Config
If you already have other MCP servers configured, use jq to merge:
MCP_SERVER_PATH="/path/to/bob-the-fixer/packages/core/dist/universal-mcp-server.js"
SONAR_TOKEN="your-token"
jq --arg path "$MCP_SERVER_PATH" \
--arg token "$SONAR_TOKEN" \
'.mcpServers["bob-the-fixer"] = {
"type": "local",
"command": "node",
"tools": ["*"],
"args": [$path],
"env": {
"SONAR_URL": "http://localhost:9000",
"SONAR_TOKEN": $token,
"LOG_LEVEL": "info"
}
}' ~/.copilot/mcp-config.json > /tmp/mcp-config.json
mv /tmp/mcp-config.json ~/.copilot/mcp-config.json
Verify Installation
Check the configuration exists:
cat ~/.copilot/mcp-config.json | jq '.mcpServers["bob-the-fixer"]'
Expected output:
{
"type": "local",
"command": "node",
"tools": ["*"],
"args": ["/path/to/bob-the-fixer/packages/core/dist/universal-mcp-server.js"],
"env": {
"SONAR_URL": "http://localhost:9000",
"SONAR_TOKEN": "squ_...",
"LOG_LEVEL": "info"
}
}
Usage
Starting Copilot CLI
GitHub Copilot CLI runs as an agent in your terminal. Refer to the official documentation for the latest invocation method.
Example Prompts
Once running, interact with code quality tools using natural language:
Scan this project for code issues
What security vulnerabilities exist in this codebase?
Fix the critical bugs found by SonarQube
Available Commands
| Task | Example Prompt |
|---|---|
| First scan | "Set up SonarQube and analyze this project" |
| View issues | "Show me all critical issues" |
| Get details | "Explain the SQL injection issue" |
| Fix issue | "Fix the null pointer bug in user.ts" |
| Check quality | "Did we pass the quality gate?" |
| Generate report | "Create a quality summary report" |
Approval Workflow
GitHub Copilot CLI requires explicit approval before:
- Editing files
- Executing commands
- Making changes to your system
This provides an extra layer of safety when fixing code issues.
Available Tools
All 20 Bob the Fixer MCP tools are available:
- Scanning:
sonar_scan_project,sonar_auto_setup - Analysis:
sonar_get_issue_details,sonar_analyze_patterns,sonar_get_security_hotspots,sonar_get_security_hotspot_details - Metrics:
sonar_get_project_metrics,sonar_get_quality_gate,sonar_get_technical_debt,sonar_get_coverage_gaps - Duplication:
sonar_get_duplication_summary,sonar_get_duplication_details - Reporting:
sonar_generate_report - Management:
sonar_project_discovery,sonar_config_manager, and more
Troubleshooting
"MCP server not responding"
-
Check the config file exists:
ls -la ~/.copilot/mcp-config.json -
Verify JSON is valid:
cat ~/.copilot/mcp-config.json | jq . -
Check the MCP server file exists:
ls -la /path/to/bob-the-fixer/packages/core/dist/universal-mcp-server.js -
If missing, rebuild:
cd /path/to/bob-the-fixer
npm run build
"SonarQube connection failed"
-
Verify SonarQube is running:
curl http://localhost:9000/api/system/status -
Check token is valid:
curl -u "your-token:" http://localhost:9000/api/authentication/validate
"Config file not found"
Create the directory and initialize the file:
mkdir -p ~/.copilot
echo '{"mcpServers":{}}' > ~/.copilot/mcp-config.json
Then add the Bob the Fixer configuration.
"Invalid JSON syntax"
Validate and fix JSON:
# Check for errors
cat ~/.copilot/mcp-config.json | jq .
# Common issues:
# - Missing commas between entries
# - Trailing commas after last entry
# - Unescaped quotes in strings
Check Bob the Fixer Status
Use the built-in diagnostic:
Check if Bob the Fixer is properly configured
This runs sonar_diagnose_permissions to verify connectivity and permissions.
Removing Bob the Fixer
Using jq
jq 'del(.mcpServers["bob-the-fixer"])' ~/.copilot/mcp-config.json > /tmp/mcp-config.json
mv /tmp/mcp-config.json ~/.copilot/mcp-config.json
Manual
Edit ~/.copilot/mcp-config.json and remove the bob-the-fixer entry.
Using Uninstaller
cd /path/to/bob-the-fixer
./uninstall.sh
This automatically removes Bob the Fixer from all configured AI CLIs.
Supported Platforms
GitHub Copilot CLI supports:
- macOS
- Linux
- Windows (via WSL)
Pricing
GitHub Copilot CLI is included with:
- Copilot Pro
- Copilot Pro+
- Copilot Business
- Copilot Enterprise
Each interaction uses your plan's request quota.
Next Steps
- Quick Start Guide - First scan tutorial
- MCP Tools Reference - All available tools
- Configuration Guide - Advanced settings
- Troubleshooting - Common issues