diff --git a/.mcp.json b/.mcp.json index eac2b9c..9f3f3be 100644 --- a/.mcp.json +++ b/.mcp.json @@ -17,7 +17,7 @@ }, "playwright": { "type": "sse", - "url": "http://playwright-mcp.playwright.svc.cluster.local:3000/sse" + "url": "http://localhost:8086/sse" }, "pgtuner": { "type": "sse", diff --git a/CLAUDE.md b/CLAUDE.md index 8847757..14da2b4 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -90,13 +90,16 @@ MCP (Model Context Protocol) servers run as sidecar containers in the pod, enabl | `flux-mcp` | `ghcr.io/controlplaneio-fluxcd/flux-operator-mcp` | v0.41.1 | 8081 | `http://localhost:8081/sse` | Enabled | | `github-mcp` | `ghcr.io/modelcontextprotocol/servers/github` | latest | 8088 | `http://localhost:8088/sse` | Enabled | | `homeassistant-mcp` | `ghcr.io/homeassistant-ai/ha-mcp` | 6.7.1 | 8087 | `http://localhost:8087/sse` | Disabled | +| `pgtuner-mcp` | `dog830228/pgtuner_mcp` | latest | 8085 | `http://localhost:8085/sse` | Disabled | +| `playwright-mcp` | `microsoft/playwright-mcp` | latest | 8086 | `http://localhost:8086/sse` | Enabled | **Note:** - Kubernetes and Flux sidecars require `clusterAccess` != `none` to be deployed (they need RBAC permissions) - Kubernetes and Flux sidecars inherit the pod's ServiceAccount RBAC permissions - GitHub sidecar uses `GITHUB_TOKEN` from the env secret (same token used for repo cloning) - Home Assistant sidecar requires `HOMEASSISTANT_URL` and `HOMEASSISTANT_TOKEN` in the env secret -- Playwright MCP remains an external service +- PostgreSQL tuner sidecar requires `DATABASE_URI` in the env secret (PostgreSQL connection string) +- Playwright sidecar provides browser automation and web testing capabilities #### Enabling/Disabling MCP Servers @@ -113,6 +116,10 @@ mcpSidecars: enabled: false homeassistant: enabled: false + pgtuner: + enabled: false + playwright: + enabled: false # Or selectively enable/disable mcpSidecars: @@ -124,6 +131,10 @@ mcpSidecars: enabled: true # Keep GitHub MCP enabled (uses GITHUB_TOKEN) homeassistant: enabled: true # Enable Home Assistant MCP (requires secrets) + pgtuner: + enabled: true # Enable PostgreSQL tuner MCP (requires DATABASE_URI) + playwright: + enabled: true # Enable Playwright MCP for browser automation ``` When deploying via Helm: diff --git a/Dockerfile b/Dockerfile index 9c68f0c..aadb346 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM jlesage/baseimage-gui:ubuntu-22.04-v4 # Set environment variables -ENV APP_NAME="Antigravity Dev Container" \ +ENV APP_NAME="Dev Container" \ KEEP_APP_RUNNING=1 \ DISPLAY_WIDTH=1920 \ DISPLAY_HEIGHT=1080 \ @@ -119,4 +119,4 @@ ENV HOME=/config/userdata \ EXPOSE 5800 # Set app name for baseimage-gui -RUN set-cont-env APP_NAME "Antigravity" +RUN set-cont-env APP_NAME "Dev Container" diff --git a/README.md b/README.md index 4b316e2..8568c2e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Antigravity Dev Container +# Dev Container ![Build and Push](https://github.com/cpfarhood/devcontainer/actions/workflows/build-and-push.yaml/badge.svg) @@ -24,6 +24,8 @@ The secret is picked up automatically via `envFrom`. Keys recognised: | `SSH_AUTHORIZED_KEYS` | Public key(s) for SSH access (required when `ssh: true`) | | `homeassistant-url` | Home Assistant URL (required when `mcpSidecars.homeassistant.enabled: true`) | | `homeassistant-token` | Home Assistant long-lived access token (required when `mcpSidecars.homeassistant.enabled: true`) | +| `database-uri` | PostgreSQL connection string (required when `mcpSidecars.pgtuner.enabled: true`) | +| `pgtuner-exclude-userids` | Comma-separated PostgreSQL user OIDs to exclude from monitoring (optional) | ```bash kubectl create secret generic devcontainer-mydev-secrets-env \ @@ -160,21 +162,27 @@ The devcontainer includes MCP (Model Context Protocol) servers as sidecar contai |---------|---------|---------| | `mcpSidecars.kubernetes.enabled` | `true` | Kubernetes API access via MCP | | `mcpSidecars.flux.enabled` | `true` | Flux GitOps operations via MCP | +| `mcpSidecars.github.enabled` | `false` | GitHub API access via MCP (DISABLED: archived image) | | `mcpSidecars.homeassistant.enabled` | `false` | Home Assistant smart home control via MCP | +| `mcpSidecars.pgtuner.enabled` | `false` | PostgreSQL performance tuning and analysis via MCP | +| `mcpSidecars.playwright.enabled` | `true` | Browser automation and web testing via MCP | **Notes:** - Kubernetes and Flux sidecars require `clusterAccess` != `none` to be deployed (automatically disabled when no cluster access) - Kubernetes and Flux sidecars inherit the pod's ServiceAccount RBAC permissions (controlled by `clusterAccess`) -- Home Assistant sidecar requires additional configuration (see below) +- Home Assistant sidecar requires `homeassistant-url` and `homeassistant-token` in the env secret +- PostgreSQL tuner sidecar requires `database-uri` in the env secret (PostgreSQL connection string) +- Playwright sidecar provides browser automation and web testing capabilities **Disable MCP sidecars:** ```bash -# Disable both sidecars +# Disable multiple sidecars helm install mydev ./chart \ --set name=mydev \ --set githubRepo=https://github.com/youruser/yourrepo \ --set mcpSidecars.kubernetes.enabled=false \ - --set mcpSidecars.flux.enabled=false + --set mcpSidecars.flux.enabled=false \ + --set mcpSidecars.playwright.enabled=false # Or selectively disable helm install mydev ./chart \ @@ -198,6 +206,20 @@ helm install mydev ./chart \ --set mcpSidecars.homeassistant.enabled=true ``` +**Enable PostgreSQL Tuner MCP:** +```bash +# Create secret with PostgreSQL connection string +kubectl create secret generic devcontainer-mydev-secrets-env \ + --from-literal=GITHUB_TOKEN='ghp_...' \ + --from-literal=database-uri='postgresql://user:password@postgres.example.com:5432/dbname' + +# Deploy with PostgreSQL tuner MCP enabled +helm install mydev ./chart \ + --set name=mydev \ + --set githubRepo=https://github.com/youruser/yourrepo \ + --set mcpSidecars.pgtuner.enabled=true +``` + **Custom MCP configuration:** ```yaml # values.yaml override @@ -206,7 +228,7 @@ mcpSidecars: enabled: true image: repository: quay.io/containers/kubernetes_mcp_server - tag: latest + tag: v0.0.57 port: 8080 resources: requests: @@ -217,19 +239,47 @@ mcpSidecars: cpu: "500m" flux: enabled: false # Disabled in this example + github: + enabled: false # Disabled by default (archived image) homeassistant: enabled: true image: repository: ghcr.io/homeassistant-ai/ha-mcp - tag: 6.7.1 # Override the pinned version if needed + tag: stable port: 8087 + resources: + requests: + memory: "64Mi" + cpu: "50m" + limits: + memory: "256Mi" + cpu: "500m" + pgtuner: + enabled: true + image: + repository: dog830228/pgtuner_mcp + tag: latest + port: 8085 + resources: + requests: + memory: "64Mi" + cpu: "50m" + limits: + memory: "256Mi" + cpu: "500m" + playwright: + enabled: true + image: + repository: microsoft/playwright-mcp + tag: latest + port: 8086 resources: requests: memory: "128Mi" cpu: "100m" limits: memory: "512Mi" - cpu: "500m" + cpu: "1000m" ``` ### Display and resources diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index db62937..81ce13d 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -266,6 +266,34 @@ spec: resources: {{- toYaml .Values.mcpSidecars.pgtuner.resources | nindent 12 }} {{- end }} + {{- if .Values.mcpSidecars.playwright.enabled }} + - name: playwright-mcp + image: "{{ .Values.mcpSidecars.playwright.image.repository }}:{{ .Values.mcpSidecars.playwright.image.tag }}" + imagePullPolicy: Always + args: + - --transport + - sse + - --port + - {{ .Values.mcpSidecars.playwright.port | quote }} + ports: + - name: playwright + containerPort: {{ .Values.mcpSidecars.playwright.port }} + livenessProbe: + tcpSocket: + port: {{ .Values.mcpSidecars.playwright.port }} + initialDelaySeconds: 15 + periodSeconds: 10 + readinessProbe: + tcpSocket: + port: {{ .Values.mcpSidecars.playwright.port }} + initialDelaySeconds: 10 + periodSeconds: 5 + resources: + {{- toYaml .Values.mcpSidecars.playwright.resources | nindent 12 }} + securityContext: + runAsUser: 1000 + runAsGroup: 1000 + {{- end }} volumes: - name: workspace emptyDir: {} diff --git a/chart/values.yaml b/chart/values.yaml index 9866be4..500f455 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -125,7 +125,7 @@ mcpSidecars: enabled: false # Disabled by default, requires DATABASE_URI in secrets image: repository: dog830228/pgtuner_mcp - tag: latest # TODO: pin to specific version once stable release available + tag: latest port: 8085 resources: requests: @@ -134,3 +134,16 @@ mcpSidecars: limits: memory: "256Mi" cpu: "500m" + playwright: + enabled: true # Enabled by default for browser automation + image: + repository: microsoft/playwright-mcp + tag: latest + port: 8086 + resources: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "512Mi" + cpu: "1000m" diff --git a/scripts/startapp.sh b/scripts/startapp.sh index 2502573..7b687e4 100644 --- a/scripts/startapp.sh +++ b/scripts/startapp.sh @@ -2,7 +2,7 @@ # Start application script for baseimage-gui set -e -echo "=== Starting Antigravity Dev Container ===" +echo "=== Starting Dev Container ===" # Initialize repository and Happy Coder /usr/local/bin/init-repo