Copilot CLI Integration
Overview
Copilot CLI is a command-line interface for GitHub Copilot that allows developers to interact with Copilot directly from the terminal. The MCP Gearbox CLI provides seamless integration with Copilot CLI, enabling you to easily configure and manage Model Context Protocol (MCP) servers for use with Copilot CLI.
Key Features
- Direct Integration: Configure MCP servers specifically for Copilot CLI
- Global Configuration: Set up MCP servers for Copilot CLI across your entire system
- Project-Specific Setup: Configure MCP servers for individual projects using Copilot CLI
- Cross-Platform Support: Works on Windows, macOS, and Linux
Prerequisites
Before configuring MCP servers for Copilot CLI, ensure you have:
- Installed Copilot CLI on your system
- Authenticated with GitHub Copilot
- Installed the MCP Gearbox CLI
Configuration
Global Configuration
To configure MCP servers for Copilot CLI globally:
mcp init -a copilot-cli
This command will:
- Detect your Copilot CLI installation
- Present an interactive menu of available MCP servers
- Generate the appropriate configuration files for Copilot CLI
Project-Specific Configuration
To configure MCP servers for Copilot CLI in a specific project:
mcp init . -a copilot-cli
Or for a new project directory:
mcp init my-project -a copilot-cli
Direct Server Configuration
To directly configure specific MCP servers for Copilot CLI without interactive selection:
# Using space-separated server names
mcp init -a copilot-cli --servers "git filesystem"
# Using multiple option flags
mcp init -a copilot-cli -s git -s filesystem
Managing Configurations
Listing Configured Servers
To list MCP servers configured for Copilot CLI:
# List global configuration
mcp list -a copilot-cli
# List project-specific configuration
mcp list -a copilot-cli -p .
# List with JSON output
mcp list -a copilot-cli --json
Removing Configurations
To remove MCP servers configured for Copilot CLI:
# Interactive removal
mcp rm -a copilot-cli
# Remove specific servers
mcp rm git filesystem -a copilot-cli
# Remove all servers
mcp rm --all -a copilot-cli
# Force removal without confirmation
mcp rm git filesystem -a copilot-cli --force
Usage Notes
- Configuration Location: MCP configurations for Copilot CLI are stored in the standard Copilot CLI configuration directory
- No Project-Level Support: Unlike some other AI agents, Copilot CLI does not support project-level MCP configuration in the traditional sense
- Server Compatibility: Not all MCP servers may be compatible with Copilot CLI; check individual server documentation for compatibility information
Troubleshooting
Common Issues
-
Agent Not Detected: If the CLI reports that Copilot CLI is not installed, ensure you have:
- Installed Copilot CLI using the official installation method
- Added Copilot CLI to your system PATH
- Authenticated with GitHub Copilot
-
Configuration Not Applied: If your MCP configuration doesn't seem to be working:
- Verify the configuration was created successfully with
mcp list -a copilot-cli - Restart Copilot CLI to ensure it picks up the new configuration
- Check that the MCP servers you've configured are compatible with Copilot CLI
- Verify the configuration was created successfully with
Checking Installation
To verify that Copilot CLI is properly detected by MCP Gearbox:
mcp check -a copilot-cli
This command will show whether Copilot CLI is installed and accessible to the MCP Gearbox CLI.