# ARC MCP Server - Workflow Guide
> **π‘ Using with GitHub Copilot Chat**
> This guide is designed for use with **GitHub Copilot Chat** in VS Code. All commands use the `#toolname` syntax to invoke MCP tools directly in your chat conversations. Open Copilot Chat with `Cmd+Shift+I` (Mac) or `Ctrl+Shift+I` (Windows/Linux).
---
## π― Overview
The ARC MCP Server supports **three deployment modes** to fit different team workflows:
| Mode | Description | Use Case | Version Control |
|------|-------------|----------|-----------------|
| **π Hybrid** | Generate configs β Auto-apply β Commit | Fast iteration with audit trail | β
Automatic |
| **π GitOps** | Generate configs β Review β Manual apply | Team review & approval process | β
Manual |
| **β‘ Direct** | Immediate apply without files | Quick fixes & testing | β None |
---
## π’ Workflow 1: DevOps/GitOps (Recommended for Teams)
**Best for**: Production environments, team collaboration, compliance requirements
### Prerequisites
```bash
# Ensure you have:
β
Kubernetes cluster with kubectl configured
β
GitHub PAT with repo and admin:org permissions (GITHUB_TOKEN env var)
β
Git repository initialized
β
GitHub Copilot Chat active in VS Code (Cmd+Shift+I / Ctrl+Shift+I)
```
### Step-by-Step: Hybrid Mode (Default)
> **π Note:** All steps below use GitHub Copilot Chat. Copy the commands and paste them into your Copilot Chat panel.
#### **1οΈβ£ Install ARC Controller**
In GitHub Copilot Chat, prompt:
```
Use #arc_install_controller with namespace arc-systems
```
**What happens:**
- β
Installs ARC via Helm
- π Generates `configs/controller.yaml` with settings
- π Shows you the config before applying
- β
Auto-commits to Git with message: "chore: install ARC controller in arc-systems namespace"
**Expected output:**
```
β
ARC Controller installed successfully
π Status: Running (1/1 pods ready)
π Config saved to: configs/controller.yaml
π Git status: Committed
```
#### **2οΈβ£ Deploy GitHub Actions Runners**
In GitHub Copilot Chat, prompt:
```
Use #arc_deploy_runners_hybrid with organization=tsvi-solutions, minRunners=5, maxRunners=20, mode=hybrid
```
**What happens:**
- π Generates `configs/runner-sets/tsvi-solutions-runners.yaml`
- π Shows you the YAML configuration
- β
Applies to cluster immediately
- π Shows deployment status
- π Auto-commits with message: "feat: deploy runners for tsvi-solutions (5-20 replicas)"
**Expected output:**
```yaml
# Generated config preview:
apiVersion: actions.github.com/v1alpha1
kind: AutoscalingRunnerSet
metadata:
name: tsvi-solutions-runners
namespace: arc-systems
spec:
githubConfigUrl: "https://github.com/tsvi-solutions"
minRunners: 5
maxRunners: 20
runnerScaleSetName: "tsvi-solutions-runners"
...
β
Runners deployed successfully
π Status: 5/5 runners ready
π Config saved to: configs/runner-sets/tsvi-solutions-runners.yaml
π Git status: Changes committed
```
#### **3οΈβ£ Review Your Infrastructure**
In GitHub Copilot Chat, prompt:
```
#arc_list_configs
```
**Expected output:**
```
π ARC Configuration Summary
Controller:
β
configs/controller.yaml
π
Last modified: 2025-10-30 10:30:00
Runner Sets:
β
tsvi-solutions-runners
π configs/runner-sets/tsvi-solutions-runners.yaml
π Scaling: 5-20 replicas
π’ Organization: tsvi-solutions
π
Last modified: 2025-10-30 10:32:00
```
#### **4οΈβ£ Check Cluster Status**
In GitHub Copilot Chat, prompt:
```
#arc_get_status
```
**Expected output:**
```
π― ARC Installation Status
Controller:
β
Healthy (Running)
π¦ Version: 0.13.0
π’ Namespace: arc-systems
Runner Sets:
β
tsvi-solutions-runners
π Active: 5/5 runners
π Scale: 5 (min) β 20 (max)
β
All runners connected to GitHub
```
#### **5οΈβ£ Detect Configuration Drift**
In GitHub Copilot Chat, prompt:
```
#arc_detect_drift
```
**What it checks:**
- Compares `configs/*.yaml` files vs. actual cluster state
- Detects manual changes made directly to cluster
- Warns if repo is out of sync
**Expected output (no drift):**
```
β
No configuration drift detected
All configurations in repository match deployed resources:
β
Controller: In sync
β
tsvi-solutions-runners: In sync
```
**Expected output (drift detected):**
```
β οΈ Configuration drift detected!
Differences found:
β οΈ tsvi-solutions-runners:
Repository: minRunners=5
Cluster: minRunners=3
π‘ To fix: Update configs/runner-sets/tsvi-solutions-runners.yaml and run:
Use #arc_apply_config with configType=runnerSet, name=tsvi-solutions-runners
```
#### **6οΈβ£ Scale Runners (Creates Config Change)**
In GitHub Copilot Chat, prompt:
```
Use #arc_scale_runners with runnerName=tsvi-solutions-runners, minReplicas=10, maxReplicas=50
```
**What happens:**
- π Updates `configs/runner-sets/tsvi-solutions-runners.yaml`
- β
Applies changes to cluster
- π Shows scaling in progress
- π Commits with message: "chore: scale tsvi-solutions-runners (10-50 replicas)"
---
### Step-by-Step: GitOps Mode (Manual Review)
**Best for**: Teams requiring pull request reviews before deployment
> **π Note:** Commands below use GitHub Copilot Chat for generation, then switch to terminal for Git operations, then back to Copilot Chat for applying configurations.
#### **1οΈβ£ Generate Runner Configuration**
In GitHub Copilot Chat, prompt:
```
Use #arc_deploy_runners_hybrid with organization=tsvi-solutions, minRunners=5, maxRunners=20, mode=gitops, apply=false
```
**What happens:**
- π Generates `configs/runner-sets/tsvi-solutions-runners.yaml`
- π Shows you the YAML
- βΈοΈ **STOPS** - Does NOT apply to cluster
- π Waits for your review
**Expected output:**
```yaml
# Generated config:
configs/runner-sets/tsvi-solutions-runners.yaml
β
Configuration generated successfully
βΈοΈ Apply manually when ready
π Next steps:
1. Review the config file
2. Commit to Git: git add configs/ && git commit -m "Add runners"
3. Push for PR review: git push origin feature/add-runners
4. After approval, apply: Use #arc_apply_config with configType=runnerSet, name=tsvi-solutions-runners
```
#### **2οΈβ£ Review & Commit**
**Switch to VS Code terminal** (`Ctrl+`` or View β Terminal):
```bash
git status
git diff configs/runner-sets/tsvi-solutions-runners.yaml
git add configs/
git commit -m "feat: add runners for tsvi-solutions"
git push origin feature/arc-runners
```
#### **3οΈβ£ Create Pull Request**
```
# In GitHub UI:
- Create PR from feature/arc-runners β main
- Request team review
- Discuss configuration parameters
- Get approval
```
#### **4οΈβ£ Apply After Approval**
**Return to GitHub Copilot Chat** (`Cmd+Shift+I` / `Ctrl+Shift+I`), then prompt:
```
Use #arc_apply_config with configType=runnerSet, name=tsvi-solutions-runners
```
**What happens:**
- β
Reads `configs/runner-sets/tsvi-solutions-runners.yaml`
- β
Applies to cluster
- π Validates deployment succeeded
---
## β‘ Workflow 2: Direct Application (No DevOps)
**Best for**: Quick testing, personal projects, temporary deployments
### When to Use Direct Mode
- π§ͺ Testing new configurations
- π§ Troubleshooting production issues quickly
- π€ Personal development clusters
- π Proof-of-concept deployments
### Step-by-Step: Direct Mode
> **π Note:** Direct mode uses GitHub Copilot Chat exclusively - no Git operations needed.
#### **1οΈβ£ Install Controller (Direct)**
In GitHub Copilot Chat, prompt:
```
Use #arc_install_controller with namespace arc-systems
```
**What happens:**
- β
Installs ARC via Helm immediately
- β No config files generated
- β No Git commits
- β
Fast and simple
#### **2οΈβ£ Deploy Runners (Direct - Legacy Tool)**
In GitHub Copilot Chat, prompt:
```
Use #deploy_github_runners with organization=tsvi-solutions, minReplicas=5, maxReplicas=20
```
**What happens:**
- β
Deploys runners immediately to cluster
- β No YAML files created
- β No version control
- β‘ Fastest option
**Expected output:**
```
β
Runners deployed successfully
π Status: 5/5 runners active
π Runner set: tsvi-solutions-runners
```
#### **3οΈβ£ Scale Runners (Direct)**
In GitHub Copilot Chat, prompt:
```
Use #arc_scale_runners with runnerName=tsvi-solutions-runners, minReplicas=10, maxReplicas=50
```
**What happens:**
- β
Scales immediately
- β No config file updates
- β οΈ Changes not tracked in Git
---
## π Mode Comparison Table
| Feature | Hybrid | GitOps | Direct |
|---------|--------|--------|--------|
| **Speed** | β‘β‘ Fast | β±οΈ Slower (manual steps) | β‘β‘β‘ Fastest |
| **Config Files** | β
Auto-generated | β
Generated | β None |
| **Git Commits** | β
Automatic | β
Manual | β None |
| **Code Review** | β οΈ Post-deployment | β
Pre-deployment | β None |
| **Audit Trail** | β
Full history | β
Full history | β None |
| **Drift Detection** | β
Yes | β
Yes | β No baseline |
| **Rollback** | β
Easy (Git revert) | β
Easy (Git revert) | β οΈ Manual recreation |
| **Team Collaboration** | β
Good | β
Excellent | β Poor |
| **Compliance** | β
Yes | β
Yes | β No |
---
## π― Recommended Workflows by Environment
### Production
```
Mode: GitOps
Workflow: Generate β PR Review β Approve β Apply
Why: Requires team approval, full audit trail
```
### Staging
```
Mode: Hybrid
Workflow: Generate β Auto-apply β Auto-commit
Why: Fast iteration with version control
```
### Development/Testing
```
Mode: Direct
Workflow: Apply immediately
Why: Speed matters more than tracking
```
---
## π Migration Path
### From Direct β Hybrid
If you have existing runners deployed directly, you can capture them:
```bash
# 1. Export existing runner configuration
kubectl get autoscalingrunnersets -n arc-systems tsvi-solutions-runners -o yaml > configs/runner-sets/tsvi-solutions-runners.yaml
# 2. Clean up kubectl metadata
# Edit the file to remove: resourceVersion, uid, creationTimestamp, etc.
# 3. Commit to Git
git add configs/
git commit -m "chore: capture existing runner configuration"
# 4. Future changes use hybrid mode (in Copilot Chat)
Use #arc_deploy_runners_hybrid with mode=hybrid
```
---
## οΏ½ Workflow 4: Policy Validation & Compliance
**Best for**: Ensuring security, compliance, and operational best practices across all ARC deployments
### Why Policy Validation Matters
- β
**Security**: Prevent vulnerable configurations
- β
**Compliance**: Meet regulatory requirements
- β
**Cost Optimization**: Reduce unnecessary spending
- β
**Performance**: Avoid resource bottlenecks
- β
**Operational Excellence**: Follow best practices
### Step-by-Step: Policy Validation Workflow
> **π Note:** All steps use GitHub Copilot Chat (`Cmd+Shift+I` / `Ctrl+Shift+I`)
#### **1οΈβ£ Create Custom Policy Configuration (Optional)**
If you need custom policies for your environment:
In GitHub Copilot Chat:
```
Generate a policy config for production environment with strict security policies
```
**Or use the tool directly:**
```
Use #arc_generate_policy_config with organization=tsvi-solutions, environment=production, requirements="Strict security, SOC2 compliance, cost optimization"
```
**What happens:**
- β
Generates `configs/policies/arc-policy-config.json`
- β
Tailored to your requirements
- β
Auto-discovered on next validation
- β
Ready for Git commit
**Example output:**
```json
{
"version": "1.0",
"organization": {
"name": "tsvi-solutions",
"environment": "production"
},
"global": {
"enforcement": "strict",
"autoFix": false
},
"ruleOverrides": {
"arc-sec-001": {
"enabled": true,
"severity": "critical"
},
"arc-cost-001": {
"enabled": true,
"severity": "high"
}
}
}
```
#### **2οΈβ£ Run Policy Validation**
In GitHub Copilot Chat:
```
Check my ARC policies
```
**Or explicitly:**
```
Use #arc_validate_policies
```
**What happens:**
- π Auto-discovers `configs/policies/arc-policy-config.json` (if exists)
- π Validates all runners against 18+ policies
- π Shows compliance score and violations
- π§ Identifies auto-fixable issues
**Example output:**
```
π ARC Policy Validation
π Auto-Discovery:
β
Found: configs/policies/arc-policy-config.json
π Applying custom overrides
π Compliance Score: β οΈ 72.2%
| Metric | Count |
|----------------|-------|
| Total Rules | 18 |
| β
Passed | 13 |
| β Failed | 5 |
| π§ Auto-fix | 3 |
π΄ Critical Issues: 0
π High Priority: 0
β οΈ Warnings: 5
```
#### **3οΈβ£ Auto-Fix Policy Violations (GitOps-Friendly)**
In GitHub Copilot Chat:
```
Fix my policy violations
```
**Or use tool directly:**
```
Use #arc_validate_policies with operation=auto_fix
```
**What happens (Default Behavior - Recommended β
):**
- β
Generates fixed configurations
- β
Saves to `configs/runner-sets/[name].yaml`
- β
Shows what will be fixed
- β Does NOT apply to cluster yet
- π Waits for your review
**Example output:**
```
π§ Auto-Fix Summary
β
Fixed 3 violations:
β’ Added resource limits (CPU: 2, Memory: 4Gi)
β’ Added security context (non-root)
β’ Configured DNS policy (ClusterFirst)
π Generated Files:
β’ configs/runner-sets/tsvi-solutions-runners.yaml
π What Changed:
spec.template.spec.containers[0].resources:
+ limits:
+ cpu: "2"
+ memory: "4Gi"
spec.template.spec.securityContext:
+ runAsNonRoot: true
+ runAsUser: 1000
π‘ Next Steps:
1. Review: configs/runner-sets/tsvi-solutions-runners.yaml
2. Test in dev first (optional)
3. Commit: git add configs/ && git commit
4. Apply: "Apply the runner configuration"
```
#### **4οΈβ£ Review Changes**
**In VS Code terminal:**
```bash
# See what changed
git diff configs/runner-sets/
# Review specific file
cat configs/runner-sets/tsvi-solutions-runners.yaml
```
#### **5οΈβ£ Commit to Git (Version Control)**
**In VS Code terminal:**
```bash
git add configs/
git commit -m "fix: auto-remediate policy violations - compliance 72.2% β 88.9%"
git push origin main
# Or create PR for team review:
git checkout -b fix/policy-compliance
git push origin fix/policy-compliance
# Create PR in GitHub UI
```
#### **6οΈβ£ Apply After Review**
**Return to GitHub Copilot Chat:**
```
Apply the runner configuration
```
**Or explicitly:**
```
Use #arc_apply_config with configType=runnerSet, name=tsvi-solutions-runners
```
**What happens:**
- β
Applies fixed configuration to cluster
- β
Waits for rollout to complete
- π Validates deployment succeeded
- π Auto-validates policies again
#### **7οΈβ£ Verify Compliance Improvement**
In GitHub Copilot Chat:
```
Check my ARC policies
```
**Expected output:**
```
π ARC Policy Validation
π Compliance Score: β
88.9%
| Metric | Count |
|----------------|-------|
| Total Rules | 18 |
| β
Passed | 16 |
| β Failed | 2 |
π Compliance Improved: 72.2% β 88.9%
Remaining issues require manual fixes:
β’ Repository scoping configuration
β’ Runner group assignment
```
---
### Alternative: Apply Immediately (Dev/Test Only β οΈ)
For **development or testing environments only**, you can fix and apply in one step:
In GitHub Copilot Chat:
```
Fix policy violations and apply to cluster
```
**Or:**
```
Use #arc_validate_policies with operation=auto_fix, apply=true
```
**What happens:**
- β
Generates fixed configs
- β
Saves to `configs/` (still creates files!)
- β
**Applies to cluster immediately**
- π Re-validates automatically
**β οΈ Use with caution:** This skips the review step!
---
### Policy Validation Best Practices
| Practice | Why It Matters |
|----------|----------------|
| **Generate policy config first** | Customize policies for your environment |
| **Run validation before deployments** | Catch issues early in dev |
| **Use default (config-only) mode** | Review before applying to production |
| **Commit policy configs to Git** | Version control for audit trail |
| **Validate regularly** | Detect configuration drift |
| **Check compliance in CI/CD** | Prevent non-compliant deployments |
---
### Integration with Deployment Workflows
**Hybrid Mode + Policy Validation:**
```
# Full workflow in GitHub Copilot Chat:
# 1. Deploy runners (hybrid mode)
Use #arc_deploy_runners_hybrid with organization=my-org, minRunners=10, maxRunners=50
# 2. Validate policies
#arc_validate_policies
# 3. Fix any violations
#arc_validate_policies with operation=auto_fix
# 4. Review and commit
# (Switch to terminal)
git diff configs/
git add configs/
git commit -m "feat: add runners with policy compliance"
# 5. Apply
# (Back to Copilot Chat)
Use #arc_apply_config with configType=runnerSet, name=my-org-runners
# 6. Verify
#arc_validate_policies
```
---
## π Troubleshooting
### "Configuration drift detected"
**Cause**: Someone modified runners directly in cluster
**Fix**:
```
# Option 1: Update repo to match cluster
kubectl get autoscalingrunnersets -n arc-systems <name> -o yaml > configs/runner-sets/<name>.yaml
git add configs/ && git commit -m "sync: update config to match cluster"
# Option 2: Apply repo config to cluster (overwrite cluster)
Use #arc_apply_config with configType=runnerSet, name=<name>
```
### "Config file not found"
**Cause**: Trying to apply config that doesn't exist in repo
**Fix**:
```
# Generate the config first:
Use #arc_deploy_runners_hybrid with mode=gitops, apply=false
```
---
## π Tool Quick Reference
| Tool | Mode Support | Purpose |
|------|--------------|---------|
| `arc_install_controller` | All | Install ARC controller |
| `arc_deploy_runners_hybrid` | Hybrid, GitOps | Deploy with config files |
| `deploy_github_runners` | Direct | Deploy without config files (legacy) |
| `arc_apply_config` | Hybrid, GitOps | Apply existing config to cluster |
| `arc_list_configs` | Hybrid, GitOps | List all config files |
| `arc_detect_drift` | Hybrid, GitOps | Check repo vs. cluster sync |
| `arc_scale_runners` | All | Scale runners (updates configs in Hybrid) |
| `arc_get_status` | All | Check cluster state |
---
## π Examples
> **π¬ All examples below use GitHub Copilot Chat** - Open it with `Cmd+Shift+I` (Mac) or `Ctrl+Shift+I` (Windows/Linux)
### Example 1: Full DevOps Workflow (Hybrid)
**In GitHub Copilot Chat**, copy and paste these commands one at a time:
```
# 1. Install
Use #arc_install_controller
# 2. Deploy runners with auto-scaling
Use #arc_deploy_runners_hybrid with organization=my-org, minRunners=10, maxRunners=100, mode=hybrid
# 3. Check what was created
#arc_list_configs
# 4. Verify cluster
#arc_get_status
# 5. Later, check for drift
#arc_detect_drift
```
### Example 2: Team Review Workflow (GitOps)
**Step 1 - In GitHub Copilot Chat:**
```
# 1. Generate config (don't apply)
Use #arc_deploy_runners_hybrid with organization=my-org, minRunners=10, maxRunners=100, mode=gitops, apply=false
```
**Step 2 - Switch to VS Code Terminal** (`Ctrl+`` or View β Terminal):
```bash
# 2. Review and push for PR
git checkout -b feature/add-runners
git add configs/
git commit -m "Add runners for my-org"
git push origin feature/add-runners
```
**Step 3 - After PR approval, return to GitHub Copilot Chat:**
```
# Pull latest changes first (in terminal)
git checkout main && git pull
# Then apply in Copilot Chat
Use #arc_apply_config with configType=runnerSet, name=my-org-runners
```
### Example 3: Quick Test (Direct)
**In GitHub Copilot Chat** (all commands):
```
# Just deploy immediately
Use #deploy_github_runners with organization=test-org, minReplicas=1, maxReplicas=5
# Scale later
Use #arc_scale_runners with runnerName=test-org-runners, minReplicas=2, maxReplicas=10
# Clean up
Use #arc_cleanup_installation with namespace=arc-systems
```
---
## π Getting Started
> **π― Quick Start:** Open GitHub Copilot Chat (`Cmd+Shift+I` / `Ctrl+Shift+I`) and follow the commands below
**New project?** Start with **Hybrid Mode** - it's the best balance:
**In GitHub Copilot Chat:**
```
Use #arc_install_controller
Use #arc_deploy_runners_hybrid with organization=YOUR_ORG, minRunners=5, maxRunners=20
```
**Existing deployment?** Capture current state then switch to Hybrid:
**In VS Code Terminal:**
```bash
kubectl get autoscalingrunnersets -n arc-systems -o yaml > configs/runner-sets/existing-runners.yaml
# Clean up the YAML, then commit
git add configs/ && git commit -m "capture existing config"
```
**Just testing?** Use **Direct Mode** with the legacy tool:
**In GitHub Copilot Chat:**
```
Use #deploy_github_runners with organization=test, minReplicas=1, maxReplicas=5
```