---
id: w2/m4/t004
title: Acceptance — MCP create_web_service → live URL → delete_service → gone
worker: worker2
status: done
estimate: 25m
depends_on: [w2/m4/t001, w2/m4/t003]
---

## Objective

Prove the whole lifecycle loop on a real cluster: an MCP client calls `create_web_service` with a prebuilt image and gets a service that converges to a live `*.onbex.co` URL; `delete_service` removes it cleanly (no App CR, Deployment, Service, or Ingress left); the accepted-but-pending `repo` path is exercised and truthful.

## Context

- Local cluster via `bash scripts/mock-cluster.sh`; known-good image = the whoami example (`examples/whoami-app.yaml`).
- In-memory MCP round-trip tests exist (`mcp_test.go` pattern from w2/m1) — extend for `delete_service`; the live check runs against the mock cluster.

## Steps

1. Extend the MCP round-trip test: `delete_service` advertised and deletes through the same path as REST.
2. Live: create via MCP → `kubectl get apps.app.bex.co` shows the App → poll to ready → curl the URL → delete → App and derived resources gone.
3. Repo-body create: accepted, visible with a truthful non-live state (until w1/m5).

## Files

- `lego/backend/internal/apps/mcp_test.go` (or the feature's existing test files)

## Acceptance criteria

- [ ] Image-backed create reaches a live https URL with no kubectl involved; delete leaves nothing behind.
- [ ] Repo-backed create does not pretend to be live.

## Out of scope

- Build-from-git convergence (w1/m5); deploy-history assertions (w2/m5).
