Claude Deployment Assistant: End-to-End Exampleο
This guide walks through a complete scenario: using Claude with the strata MCP server to validate, build, and preview an infrastructure deployment.
Scenarioο
Youβre deploying a new environment to Azure AKS. Instead of manually running CLI commands, you ask Claude to:
Generate a deployment YAML from a template
Validate the YAML
Show what will be built and deployed
Suggest improvements
Provide instructions for executing the deployment
Prerequisitesο
strata workspace initialized (
strata sln init)Claude Desktop installed (or Claude API access)
MCP server running:
strata mcp servein your workspaceClaude configured with strata MCP server (see Setup)
Step 1: Configure Claude Desktopο
Add strata MCP server to your Claude configuration:
File: ~/.claude/claude-config.json (or %APPDATA%\Roaming\Claude\claude-config.json on Windows)
{
"mcpServers": {
"strata": {
"command": "strata",
"args": ["mcp", "serve"],
"cwd": "/Users/yourname/projects/my-strata-workspace"
}
}
}
Replace /Users/yourname/projects/my-strata-workspace with your actual workspace path.
Restart Claude to load the new configuration.
Step 2: Verify MCP Connectionο
Start Claude Desktop and send:
βWhat tools do you have access to?β
Claude should respond with a list mentioning strata tools:
workspace_statusβ Check workspace statevalidate_fileβ Validate YAMLscaffold_fileβ Generate YAML from templatebuild_planβ Preview builddeploy_planβ Preview deploymentβ¦ and more
If you donβt see strata tools, check:
The configuration file path is correct
cwdpoints to your workspace root (should contain.strata/)Claude Desktop was restarted after editing the config
Step 3: Full Workflow β Claude Guides Youο
3a. Generate Deployment YAMLο
You: βI need to deploy a new Azure AKS environment called βstagingβ. Generate a deployment YAML for me.β
Claude will:
Call
workspace_status()to understand your setupCall
scaffold_file(kind="deployment", name="staging-aks")to generate a templateShow you the generated YAML
Ask where you want to save it
You: βSave it as deploy/deploy-staging.yamlβ
At this point, Claude has generated the file content (not written to disk yet). You copy the output and save it manually, or:
# Claude shows you the content, you save it
cat > deploy/deploy-staging.yaml << 'EOF'
apiVersion: strata.huybrechts.xyz/v1
kind: deployment
meta:
name: staging-aks
annotations:
description: "Staging environment on Azure AKS"
labels:
version: "1.0.0"
spec:
stages:
- name: infrastructure
provisioner: terraform
scope: all
on_failure: stop
EOF
3b. Validate the YAMLο
You: βValidate the deployment file I just created.β
Claude will:
Call
validate_file(file_path="deploy/deploy-staging.yaml")Check structural validity (against JSON Schema)
If you request, call with
deep=Trueto check cross-references
Claude responds:
β All valid β File passes structural validation
β οΈ Warnings β File is valid but has non-critical issues (e.g., missing annotations)
β Errors β File fails validation (Claude shows you the field errors and suggests fixes)
Example Claude response:
β
Validation passed!
File: deploy/deploy-staging.yaml
Kind: deployment
Name: staging-aks
The YAML is structurally valid. All required fields are present and correctly typed.
Observations:
- provisioner "terraform" is defined but not configured in your workspace yet
- No repositories linked to this deployment
- Stage "infrastructure" has no timeout specified (will use default 30m)
Next steps:
1. Add terraform provisioner configuration to your workspace.yaml
2. Validate deeper cross-references with --deep flag
3. Run build_plan to see what Terraform will generate
3c. Preview the Buildο
You: βShow me what will be built if I run the build.β
Claude will:
Call
build_plan(file="deploy/deploy-staging.yaml")Show you the expected artifacts (Terraform modules, configurations, etc.)
Claude responds:
π¨ Build Preview (Dry-Run)
Build would produce:
βββ platform.json (platform configuration artifact)
βββ terraform/
β βββ main.tf
β βββ variables.tf
β βββ outputs.tf
β βββ versions.tf
βββ configs/
β βββ azure-aks.yaml
Stage: infrastructure
Provisioner: terraform
Modules to instantiate:
- azure/aks (v1.2.3)
- azure/network (v1.1.0)
No actual resources would be provisioned (this is a dry-run).
Ready to commit this build? Run:
strata build run -f deploy/deploy-staging.yaml
3d. Ask for Improvementsο
You: βAre there any improvements I should make to this deployment?β
Claude will:
Review the YAML structure
Call
get_schema(kind="deployment")to check best practicesProvide recommendations
Claude responds:
Here are suggested improvements:
1. **Add health checks** β Currently, no health_checks defined for the infrastructure stage
Add:
```yaml
stages:
- name: infrastructure
health_checks:
- type: http
target: "https://${azure_lb_ip}/health"
interval_seconds: 30
Specify timeouts β Add explicit timeout for infrastructure provisioning Add:
timeout_minutes: 45Add labels β Help with organization and filtering Add to meta.labels:
"environment": "staging", "team": "platform"Document dependencies β If this deployment depends on another, document it Consider stages order and on_failure policy
Add approver role β Deployment to staging should require approval Add to meta.annotations:
"require_approval": "true"
You can ask Claude to regenerate the YAML with these improvements.
### 3e. Preview the Deployment
**You:** "Show me what will actually be deployed if I run `strata deploy run`."
**Claude** will:
1. Call `build_plan()` to ensure artifacts are up-to-date
2. Call `deploy_plan(file="deploy/deploy-staging.yaml")` to show the deployment preview
3. Display Terraform plan output (what resources will be created/modified)
**Claude responds:**
π Deployment Preview (Dry-Run)
Stage 1: infrastructure Provisioner: Terraform
Changes to be made: β azurerm_resource_group.staging (new) β azurerm_kubernetes_cluster.staging (new) β azurerm_virtual_network.staging (new)
8 more resources
Summary: Plan: Create 11 new resources Estimated cost: $2,340/month (compute + networking) Deployment time: ~15 minutes
β οΈ CRITICAL: This will create real Azure resources that cost money.
Next steps:
Review the resource list above
Confirm with your team
Run via CLI: strata deploy run -f deploy/deploy-staging.yaml βforce (Use βforce to skip interactive confirmation)
### 3f. Check Current Status
**You:** "What's the current status of my workspace? Is everything ready to deploy?"
**Claude** will:
1. Call `workspace_status()`
2. Display readiness phases, active profile, repositories, etc.
**Claude responds:**
π Workspace Status
Readiness: Phase 1: Initialized β Phase 2: Repositories configured β Phase 3: Profiles set up β (active: production) Phase 4: Deployment files created β Phase 5: Validated β Phase 6: Built β³ (pending) Phase 7: Deployed π (next step) Phase 8: Monitoring β³ (after deployment)
Next recommended action:
Run: strata build run -f deploy/deploy-staging.yaml
Then: strata deploy run -f deploy/deploy-staging.yaml
Active profile: production Repositories: 2 configured Tools available: terraform, ansible, docker
---
## Step 4: Execute the Deployment
At this point, Claude can only preview. **The actual deployment must happen via the CLI** with explicit user confirmation.
```bash
# 1. Build the deployment artifacts
strata build run -f deploy/deploy-staging.yaml
# 2. Deploy to staging (this actually creates resources)
strata deploy run -f deploy/deploy-staging.yaml
Claude cannot execute these commands. This is intentional for safety:
MCP tools can query and preview
Only CLI can execute destructive operations
All operations are audited
Step 5: Monitor & Verifyο
After youβve run the deployment via CLI:
You: βCheck the health of my deployed staging environment.β
Claude will:
Call
deploy_status(file="deploy/deploy-staging.yaml")to get current Terraform outputsCall
deploy_health(file="deploy/deploy-staging.yaml")to run health checksSummarize the state
Claude responds:
β
Deployment Status
Stage: infrastructure
Provisioner: Terraform
Infrastructure Outputs:
kubernetes_cluster_fqdn: staging-aks.eastus.cloudapp.azure.com
kubernetes_cluster_id: /subscriptions/.../Microsoft.ContainerService/managedClusters/staging-aks
load_balancer_ip: 20.45.123.45
Health Checks:
β
HTTP GET /health β 200 OK (2.3s)
β
API endpoint responding
β
Kubernetes nodes healthy (3/3 ready)
Recent deployments:
2026-07-05 14:23:45 β Deploy RUN (success, 8m 34s)
2026-07-05 14:15:10 β Build RUN (success, 2m 11s)
All systems operational.
Step 6: Troubleshoot Issuesο
If something goes wrong:
You: βThe deployment failed. What went wrong?β
Claude will:
Call
deploy_history()to see recent deployment attemptsCall
audit_query()to check the error logsSuggest remediation steps
Claude responds:
β Deployment Failed
Last deployment:
Time: 2026-07-05 14:52:30
Status: FAILED
Duration: 4m 15s
Error stage: infrastructure
Error Details:
terraform apply failed:
Error: azurerm_resource_group.staging already exists
This suggests a previous partial deployment left resources behind.
Suggested fixes:
1. Check what resources exist in Azure (manual check needed)
2. Import existing resources into Terraform state:
terraform import azurerm_resource_group.staging /subscriptions/.../resourceGroups/staging
3. Try deploy again
Or:
1. Change the resource group name in your deployment YAML
2. Run build_plan to preview
3. Re-run deploy
Summary: Claude Workflow Checklistο
β Generate YAML template β
scaffold_file()β Validate YAML structure β
validate_file()β Build Preview what will be generated β
build_plan()β Deploy Preview what will be provisioned β
deploy_plan()β Check Status of workspace β
workspace_status()β Get Schema for validation rules β
get_schema()β Monitor deployed infrastructure β
deploy_status(),deploy_health()β Query History of deployments β
deploy_history(),audit_query()β Troubleshoot failures β audit logs + error analysis
CLI remains the executor β strata build run, strata deploy run, etc.
Tips & Best Practicesο
1. Always Validate Before Buildingο
You: "Validate the file before we build."
Claude: β
[validates] β Ready to build!
2. Always Preview Before Deployingο
You: "Show me the deploy plan."
Claude: [runs deploy_plan()] β Lists all resources that will be created
You: "That looks good, I'll deploy via CLI."
3. Use Claude for Analysis, CLI for Actionο
Claude (via MCP): CLI:
- Validate - Build
- Preview - Deploy
- Query status - Destroy
- Suggest fixes - Execute operations
4. Ask for Improvementsο
You: "Are there any best-practice improvements I should make?"
Claude: [reviews YAML] β Lists recommendations
5. Multi-Step Workflowsο
You: "Generate a namespace and deployment for staging. Validate both. Show me what will be built."
Claude: [calls scaffold_file(), validate_file(), build_plan()] β Complete preview
Next Stepsο
Review Security & Workflows for production use
Troubleshooting Use Cases for operational patterns
Tools Reference for all available MCP tools