# ARC MCP Server Quickstart Guide
> **π Get up and running with ARC automation in 5 minutes**
>
> This guide walks you through setting up the ARC MCP Server for AI-powered GitHub Actions Runner Controller management.
## β‘ Quick Setup Options
Choose your preferred setup method:
### π³ Option 1: Docker (Recommended)
```bash
# Run with minimal configuration
docker run -p 3000:3000 \
-e GITHUB_TOKEN=your_token_here \
-v ~/.kube/config:/app/.kube/config:ro \
ghcr.io/tsviz/arc-config-mcp:latest
```
### π¦ Option 2: npm/Node.js
```bash
# Clone and install
git clone https://github.com/tsviz/arc-config-mcp.git
cd arc-config-mcp
npm install && npm run build && npm start
```
### π€ Option 3: MCP Client Integration
```bash
# Direct MCP protocol connection
npm start -- --stdio
```
## π Prerequisites Checklist
Before starting, ensure you have:
- [ ] **Kubernetes cluster** (1.24+ recommended)
- [ ] **kubectl** configured and connected
- [ ] **GitHub Personal Access Token** with required scopes
- [ ] **Node.js 18+** (if running locally)
- [ ] **Docker** (if using container method)
## π GitHub Token Setup
1. **Create Personal Access Token**: https://github.com/settings/tokens/new
2. **Required Scopes**:
```
β
repo # Repository access
β
admin:org # Organization management
β
workflow # Actions workflow management
```
3. **Set Environment Variable**:
```bash
export GITHUB_TOKEN=ghp_your_token_here
```
## π― Quick Start Scenarios
### Scenario 1: First-Time ARC Installation
```text
π§ "Install ARC in my development cluster"
π€ I'll help you set up ARC with development-friendly settings:
1οΈβ£ Checking cluster readiness...
β
Kubernetes 1.28 detected
β
kubectl access verified
β
Sufficient resources available
2οΈβ£ Installing ARC controller...
π¦ Downloading official GitHub ARC v0.13.0
βοΈ Configuring with official OCI charts
π Deploying to namespace: arc-systems
3οΈβ£ Setting up runner deployment...
π₯ Creating autoscaling runner sets
π Registering with GitHub organization
π Enabling enhanced metrics with workflow labels
β
Installation complete!
π ARC dashboard: kubectl port-forward -n arc-systems svc/arc-gha-rs-controller 8080:8080
π Next steps: Deploy runners or configure advanced ARC v0.13.0 features
```
### Scenario 2: Health Check & Status
```text
π§ "Check my ARC status"
π€ Running comprehensive ARC health check...
π Controller Status:
β
ARC Controller: Running (v0.13.0)
β
Webhook Server: Healthy
β
Metrics Server: Collecting enhanced workflow data
π Runner Status:
β’ Active runners: 3/5
β’ Queued jobs: 1
β’ Success rate: 98.5%
π Recent Activity:
β’ Job completed: web-app-ci (2m ago)
β’ Runner scaled up: +2 runners (5m ago)
β’ Health check: All systems green β
π‘ Recommendations:
β’ Consider auto-scaling for variable loads
β’ ARC v0.13.0 features available (container modes, dual-stack networking)
```
### Scenario 3: Scale Runners for High Load
```text
π§ "Scale my runners for the afternoon deployment window"
π€ Preparing for high-load deployment window:
π Current Situation:
β’ Active runners: 3
β’ Queue depth: 8 jobs
β’ Average wait time: 4 minutes
π― Scaling Strategy:
β’ Target runners: 8 (optimal for current queue)
β’ Auto-scaling: Enable (3-12 range)
β’ Scale-down delay: 10 minutes (post-deployment)
βοΈ Implementing scaling...
β
Updated runner set configuration
β
Horizontal Pod Autoscaler configured
β
Resource quotas verified
π Result:
β’ New runner capacity: 8 runners
β’ Estimated queue clear time: 2 minutes
β’ Cost impact: +$15/hour during peak
```
### Scenario 4: Policy Validation & Compliance
```text
π§ "Check my ARC policies"
π€ Running comprehensive policy validation...
π Auto-Discovery:
β
Found policy config: configs/policies/arc-policy-config.json
π Applying custom policy overrides
π Compliance Score: β οΈ 72.2%
| Metric | Count |
|----------------|-------|
| Total Rules | 18 |
| β
Passed | 13 |
| β Failed | 5 |
| π΄ Critical | 0 |
| π High | 0 |
| β οΈ Warnings | 5 |
π§ Auto-Fix Available:
β’ 3 violations can be fixed automatically
β’ Missing resource limits (2 runners)
β’ Missing security context (1 runner)
π‘ Quick Actions:
β’ "Fix policy violations" - Auto-remediate
β’ "Show me security violations" - Detailed view
β’ "Generate compliance report" - Full analysis
π§ "Fix policy violations"
π€ Applying automatic fixes...
β
Fixed missing resource limits
β
Added security context (non-root)
β
Configured DNS policy
π Generated: configs/runner-sets/tsvi-solutions-runners.yaml
π Re-validating...
β
New Compliance Score: 88.9%
β
3 violations resolved
π‘ Next Steps:
β’ Review: configs/runner-sets/tsvi-solutions-runners.yaml
β’ Apply: "Apply the runner configuration"
```
**Pro Tip**: Generate a custom policy config for your needs:
```text
"Generate a policy config for production with strict security"
```
This creates `configs/policies/arc-policy-config.json` which is auto-discovered on next validation!
## π§ Configuration
### Environment Variables
Create a `.env` file or set these environment variables:
```bash
# Required
GITHUB_TOKEN=ghp_your_token_here
# Optional but recommended
GITHUB_ORG=your-organization # For org-level runners
GITHUB_REPO=your-repository # For repo-specific runners
KUBECONFIG_PATH=/path/to/kubeconfig # If not using default location
ARC_NAMESPACE=arc-systems # ARC controller namespace
RUNNER_NAMESPACE=arc-runners # Runner pods namespace
# MCP Server Settings
MCP_PORT=3000 # HTTP mode port
LOG_LEVEL=info # debug|info|warn|error
ENABLE_METRICS=true # Prometheus metrics
```
### VS Code + GitHub Copilot Integration
1. **Add to MCP Settings** (`~/.config/github-copilot/mcp.json`):
```json
{
"mcpServers": {
"arc-config": {
"command": "node",
"args": ["/path/to/arc-config-mcp/build/index.js"],
"env": {
"GITHUB_TOKEN": "your_token_here",
"LOG_LEVEL": "info"
}
}
}
}
```
2. **Test Integration**:
- Open VS Code with GitHub Copilot
- Type: *"Show me my ARC status"*
- Copilot should connect to the MCP server
### Kubernetes RBAC Setup
If you encounter permission issues, apply this RBAC configuration:
```bash
# Download and apply RBAC manifests
kubectl apply -f https://raw.githubusercontent.com/tsviz/arc-config-mcp/main/examples/rbac.yaml
# Or create manually
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: ServiceAccount
metadata:
name: arc-mcp-server
namespace: arc-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: arc-mcp-server
rules:
- apiGroups: [""]
resources: ["namespaces", "pods", "services", "configmaps", "secrets"]
verbs: ["get", "list", "create", "update", "patch", "delete"]
- apiGroups: ["apps"]
resources: ["deployments", "replicasets"]
verbs: ["get", "list", "create", "update", "patch", "delete"]
- apiGroups: ["actions.summerwind.dev"]
resources: ["*"]
verbs: ["*"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: arc-mcp-server
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: arc-mcp-server
subjects:
- kind: ServiceAccount
name: arc-mcp-server
namespace: arc-system
EOF
```
## π§ͺ Testing Your Setup
### 1. Basic Connectivity Test
```bash
# Test Kubernetes connectivity
kubectl cluster-info
# Test GitHub API connectivity
curl -H "Authorization: token $GITHUB_TOKEN" \
https://api.github.com/user
# Test MCP server health (if running in HTTP mode)
curl http://localhost:3000/health
```
### 2. MCP Tool Test
Use the MCP client to test available tools:
```bash
# List available tools
echo '{"method": "tools/list", "params": {}}' | nc localhost 3000
# Test ARC status
echo '{"method": "tools/call", "params": {"name": "arc_get_status"}}' | nc localhost 3000
```
### 3. Natural Language Test
Try these commands with your MCP client:
```text
π§ "What ARC tools are available?"
π§ "Check my cluster status"
π§ "Show me runner health"
π§ "List ARC components"
```
## π¨ Troubleshooting
### Common Issues & Solutions
#### β Kubernetes Connection Failed
```bash
# Check kubectl configuration
kubectl config current-context
kubectl auth can-i create pods --namespace arc-systems
# Solution: Fix KUBECONFIG or RBAC permissions
export KUBECONFIG=/path/to/correct/kubeconfig
kubectl apply -f examples/rbac.yaml
```
#### β GitHub API Authentication Failed
```bash
# Test token validity
curl -H "Authorization: token $GITHUB_TOKEN" \
https://api.github.com/user
# Solution: Regenerate token with correct scopes
# Go to: https://github.com/settings/tokens
```
#### β MCP Server Won't Start
```bash
# Check Node.js version
node --version # Should be 18+
# Check dependencies
npm install
# Check TypeScript compilation
npm run build
# Solution: Update Node.js or fix compilation errors
```
#### β No ARC Resources Found
```bash
# Check if ARC is installed
kubectl get pods -n arc-system
kubectl get crd | grep actions
# Solution: Install ARC first
# Use: "Install ARC in my cluster" command
```
### Debug Mode
Enable detailed logging for troubleshooting:
```bash
# Environment variable
export LOG_LEVEL=debug
export DEBUG=arc:*,mcp:*,k8s:*
# Runtime flag
npm start -- --log-level debug
# Docker debug mode
docker run -e LOG_LEVEL=debug -e DEBUG=arc:* \
ghcr.io/tsviz/arc-config-mcp:latest
```
### Health Check Commands
```bash
# Check all components
kubectl get all -n arc-system
kubectl get all -n arc-runners
# Check ARC controller logs
kubectl logs -n arc-system deployment/controller
# Check runner pod logs (using new namespace structure)
kubectl logs -n arc-systems -l app.kubernetes.io/name=gha-runner-scale-set
# Check MCP server metrics (if enabled)
curl http://localhost:3000/metrics
```
## π Next Steps
### π Basic Operations
- **Install ARC**: *"Install ARC in my cluster with standard security"*
- **Scale Runners**: *"Scale my runners to 10 for high load"*
- **Monitor Health**: *"Show me detailed ARC status"*
- **Troubleshoot**: *"Diagnose why my runners are failing"*
### π Security & Compliance
- **Policy Validation**: *"Check my ARC setup against SOC2 requirements"*
- **Security Scan**: *"Run security scan on my ARC deployment"*
- **Compliance Report**: *"Generate compliance report for auditors"*
### π° Cost Optimization
- **Cost Analysis**: *"Show me ARC cost breakdown and optimization opportunities"*
- **Auto-scaling**: *"Set up intelligent auto-scaling for cost efficiency"*
- **Resource Right-sizing**: *"Optimize runner resource allocations"*
### π Learning Resources
- [Complete Tool Catalog](./TOOLS.md)
- [Policy as Code Guide](./docs/POLICY_AS_CODE.md)
- [External Configuration](./docs/EXTERNAL_POLICY_CONFIG.md)
- [Advanced Examples](./examples/)
## π¬ Getting Help
### π Support Channels
- **GitHub Issues**: [Report bugs or request features](https://github.com/tsviz/arc-config-mcp/issues)
- **Discussions**: [Community Q&A](https://github.com/tsviz/arc-config-mcp/discussions)
- **Documentation**: [Complete docs](./docs/)
### π€ Community
- **Contributing**: [How to contribute](./CONTRIBUTING.md)
- **Code of Conduct**: [Community guidelines](./CODE_OF_CONDUCT.md)
- **Roadmap**: [Future plans](./ROADMAP.md)
---
<div align="center">
**π Congratulations! You're ready to automate ARC with AI**
[Advanced Configuration](./docs/) β’ [Tool Examples](./examples/) β’ [Community](https://github.com/tsviz/arc-config-mcp/discussions)
*From manual kubectl commands to conversational AI automation in 5 minutes* β¨
</div>