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β
AI 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, orlistshow_unavailable(optional): Include unavailable adapters (default: false)
Environment Management Toolsβ
#list_environmentsβ
List all your cloud environments (user access).
Parameters:
format(optional): Output format -table(default),json, orlist
Example:
#list_environments format:table
#get_environmentβ
Get detailed information about a specific environment (user access).
Parameters:
id(required): ID of the environment to retrieveformat(optional): Output format -json(default),table, orlist
Example:
#get_environment id:15 format:json
Admin Environment Tools (Requires Admin Privileges)β
#admin_list_environmentsβ
List environments with admin privileges and enhanced details.
Parameters:
format(optional): Output format -table(default),json, orlistinclude_stats(optional): Include usage statistics (default: false)
#admin_create_environmentβ
Create new cloud environments with admin privileges.
Parameters:
name(required): Environment namedescription(optional): Environment descriptionpath(required): Environment pathis_private(optional): Private environment (default: false)
Project Management Toolsβ
#list_projectsβ
List all your projects.
Parameters:
format(optional): Output format -table(default),json, orlist
#get_projectβ
Get detailed information about a specific project.
Parameters:
project_id(required): ID of the project to retrieve
Instance Management Toolsβ
#list_instancesβ
List all your VM instances.
Parameters:
format(optional): Output format -table(default),json, orlist
#create_instanceβ
Create new VM instances.
Parameters:
name(required): Instance nametype(optional): Instance typeregion(optional): Cloud region
Storage Management Toolsβ
#list_bucketsβ
List all your storage buckets.
Parameters:
format(optional): Output format -table(default),json, orlist
#create_bucketβ
Create new storage buckets.
Parameters:
name(required): Bucket nameregion(optional): Storage region
Function Management Toolsβ
#list_functionsβ
List all your serverless functions.
Parameters:
format(optional): Output format -table(default),json, orlist
#invoke_functionβ
Execute serverless functions.
Parameters:
function_id(required): Function ID to invokepayload(optional): Function payload
User Management Toolsβ
#list_usersβ
List all system users.
Parameters:
format(optional): Output format -table(default),json, orlist
#create_userβ
Create new system users.
Parameters:
username(required): Usernameemail(required): Email addresspassword(required): User password
DNS Management Toolsβ
#list_dns_recordsβ
List all your DNS records.
Parameters:
format(optional): Output format -table(default),json, orlist
#create_dns_recordβ
Create new DNS records.
Parameters:
name(required): Record nametype(required): Record type (A, AAAA, CNAME, MX, etc.)content(required): Record contentzone(required): DNS zone
Example:
#create_dns_record name:api.example.com type:A content:192.168.1.100 zone:example.com
Complete Tool List (119 Total)β
The CWCloud MCP Server provides 119 comprehensive tools across 10 categories:
- AI Tools (3): AI generation, conversations, adapters
- Environment Management (11): Full CRUD + admin operations
- Project Management (7): Complete project lifecycle
- Instance Management (10): VM operations with admin controls
- Storage Management (10): Bucket operations with admin controls
- Registry Management (10): Container registry operations
- Function Management (12): Serverless with invocation
- Monitoring Management (10): Endpoint monitoring
- User Management (10): Complete user lifecycle
- DNS Management (10): DNS record management
Each category includes both user-level and admin-level tools for comprehensive cloud management.
format(optional): Output format -json(default),detailed, orsummary
Example:
#get_environment id:123 format:detailed
Admin Environment Tools (Requires Admin Privileges)β
#admin_list_environmentsβ
List environments with enhanced admin details and statistics.
Parameters:
format(optional): Output format -table(default),json, orlistinclude_stats(optional): Include additional statistics (default: false)
Example:
#admin_list_environments format:table include_stats:true
#admin_get_environmentβ
Get environment details with admin metadata and additional information.
Parameters:
id(required): ID of the environment to retrieveinclude_metadata(optional): Include admin metadata (default: false)
Example:
#admin_get_environment id:123 include_metadata:true
#admin_create_environmentβ
Create a new cloud environment (admin only).
Parameters:
name(required): Name for the environmentdescription(required): Description of the environmentpath(required): Path/identifier for the environmentis_private(required): Whether the environment is private (true/false)roles(required): Array of user roles/permissions (can be empty array)logo_url(optional): Logo URL for the environmentprovider(optional): Cloud providerregion(optional): Deployment region
Example:
#admin_create_environment name:"Production API" description:"Main production API environment" path:"prod-api" is_private:true roles:["admin","developer"] provider:"aws" region:"us-east-1"
#admin_update_environmentβ
Update an existing environment's properties (admin only).
Parameters:
id(required): ID of the environment to updatename(optional): New name for the environmentdescription(optional): New descriptionpath(optional): New path/identifieris_private(optional): Update privacy settingroles(optional): Update user roles arraylogo_url(optional): New logo URLprovider(optional): Update cloud providerregion(optional): Update region
Example:
#admin_update_environment id:123 name:"Updated API Name" description:"Updated description"
#admin_delete_environmentβ
Delete an environment with safety confirmation (admin only).
Parameters:
id(required): ID of the environment to deleteconfirm(required): Must betrueto confirm deletionreason(optional): Reason for deletion (recommended for audit trail)
Example:
#admin_delete_environment id:123 confirm:true reason:"Environment no longer needed"
Example Usageβ
In GitHub Copilot Chat:
AI Tools:
#generate_ai_prompt adapter:gpt4o message:"Explain quantum computing" max_tokens:200
#list_conversations
#list_adapters
#list_adapters format:table show_unavailable:true
Environment Management:
#list_environments format:table
#get_environment id:123 format:detailed
Admin Environment Management (requires admin privileges):
#admin_list_environments format:table include_stats:true
#admin_get_environment id:123 include_metadata:true
#admin_create_environment name:"My App" description:"Production app environment" path:"my-app" is_private:false roles:["developer","admin"]
#admin_update_environment id:123 name:"Updated App Name" description:"Updated description"
#admin_delete_environment id:123 confirm:true reason:"No longer needed"
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.jsonis absolute and correct - Verify
.envfile 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