GitHub Copilot Integration Guide
This guide will help you integrate CWCloud MCP Server with GitHub Copilot in VS Code, enabling you to access powerful AI models (GPT-4, Claude, Gemini) directly through Copilot Chat.
Quick Setupβ
Automated Setup (Recommended)β
Run the setup script from the project root:
./setup-github-copilot.sh
# Or
make setup-copilot
This script will:
- Build the MCP server
- Collect your CWCloud API credentials
- Test the server connection
- Create VS Code MCP configuration
- Optionally set up global configuration
Manual Setupβ
If you prefer manual setup, follow these steps:
1. Build the Serverβ
go build -o bin/cwcloud-mcp ./cmd/server
# Or
make build
2. Configure Environmentβ
Create a .env
file with your CWCloud credentials:
COMWORK_API_URL=https://api.cwcloud.tech
COMWORK_ACCESS_KEY=your_access_key_here
COMWORK_SECRET_KEY=your_secret_key_here
LOG_LEVEL=info
Get your API keys from CWCloud Console.
3. Create MCP Configurationβ
Create .vscode/mcp.json
in your project:
{
"servers": {
"cwcloud-mcp": {
"type": "stdio",
"command": "/absolute/path/to/your/bin/cwcloud-mcp",
"args": [],
"env": {
"COMWORK_API_URL": "https://api.cwcloud.tech",
"COMWORK_ACCESS_KEY": "your_access_key_here",
"COMWORK_SECRET_KEY": "your_secret_key_here",
"LOG_LEVEL": "info"
}
}
}
}
Note: Use absolute paths in the command
field.
4. Global Configuration (Optional)β
To make the server available across all workspaces, copy the configuration to your VS Code user directory:
Linux/WSL:
mkdir -p ~/.config/Code/User
cp .vscode/mcp.json ~/.config/Code/User/
macOS:
mkdir -p ~/Library/Application\ Support/Code/User
cp .vscode/mcp.json ~/Library/Application\ Support/Code/User/
Windows:
mkdir "%APPDATA%\Code\User"
copy .vscode\mcp.json "%APPDATA%\Code\User\"
Using CWCloud Tools in GitHub Copilotβ
After setup, restart VS Code and you'll have access to these tools in Copilot Chat:
Available Toolsβ
#generate_ai_prompt
β
Generate AI responses using various models.
Parameters:
adapter
(required): AI model to usemessage
(required): Your promptconversation_id
(optional): Continue existing conversationmax_tokens
(optional): Token limittemperature
(optional): Creativity (0.0-1.0)
Supported Adapters:
gpt4o
- GPT-4 Optimizedgpt4o-mini
- GPT-4 Mini (faster, cheaper)claude3sonnet
- Claude 3 Sonnetclaude3haiku
- Claude 3 Haikugemini
- Google Geminigemini-pro
- Google Gemini Pro
#list_conversations
β
List your AI conversation history.
Parameters: None
#list_adapters
β
List all available AI adapters and their current status.
Parameters:
format
(optional): Output format -json
(default),table
, orlist
show_unavailable
(optional): Include unavailable adapters (default: false)
Example Usageβ
In GitHub Copilot Chat:
#generate_ai_prompt adapter:gpt4o message:"Explain quantum computing" max_tokens:200
#list_conversations
#list_adapters
#list_adapters format:table show_unavailable:true
Verificationβ
Check Server Statusβ
- Open Command Palette (
Ctrl/Cmd+Shift+P
) - Run
MCP: List Servers
- Look for
cwcloud-mcp (running)
Test Toolsβ
- Open GitHub Copilot Chat
- Type
#
and see if tools appear in autocomplete - Try a simple generation:
#generate_ai_prompt adapter:gpt4o message:"Hello world"
Manual Testingβ
Test the server directly:
./test-interactive.sh # Full API integration test
Troubleshootingβ
Server Not Appearingβ
- Restart VS Code completely (not just reload window)
- Check that binary path in
mcp.json
is absolute and correct - Verify
.env
file has valid credentials - Check VS Code output panel for MCP-related errors
Authentication Errorsβ
- Verify API keys at CWCloud Console
- Check API URL is correct (default:
https://api.cwcloud.tech
) - Ensure credentials don't have extra spaces or characters
Tools Not Available in Chatβ
- Confirm server shows as "running" in
MCP: List Servers
- Try typing
#
to see if autocomplete works - Check that GitHub Copilot extension is updated to latest version
Debug Modeβ
Enable debug logging in your mcp.json
:
{
"servers": {
"cwcloud-mcp": {
"env": {
"LOG_LEVEL": "debug"
}
}
}
}
Updatesβ
To update the server:
- Pull latest code:
git pull
- Rebuild:
go build -o bin/cwcloud-mcp ./cmd/server
- Restart VS Code
Usage Analyticsβ
Your CWCloud MCP server automatically tracks:
- Token usage per model
- Cost estimation
- Conversation history
- Request statistics
Use #list_conversations
to see your conversation history.
Advanced Configurationβ
Custom API Endpointβ
For enterprise or staging environments:
{
"env": {
"COMWORK_API_URL": "https://api.your-domain.com"
}
}
Multiple Configurationsβ
You can run multiple MCP servers with different configurations:
{
"servers": {
"cwcloud-production": {
"command": "/path/to/bin/cwcloud-mcp",
"env": {
"COMWORK_API_URL": "https://api.cwcloud.tech"
}
},
"cwcloud-staging": {
"command": "/path/to/bin/cwcloud-mcp",
"env": {
"COMWORK_API_URL": "https://api.staging.cwcloud.tech"
}
}
}
}
Supportβ
- Issues: GitHub Issues
- Community: Discord