Set up
Runs on your computer. Pick your agent and operating system.
This project does not publish an install method we can turn into a config. Follow the README instead.
README
synced Oct 27, 2026Spacelift Intent MCP Server Demo - Snake Game
This project demonstrates the capabilities of the Spacelift Intent MCP Server by deploying a fully functional browser-based Snake game to static website hosting - entirely through AI-driven infrastructure management. The demo is cloud-agnostic: run it on AWS S3 or Azure Blob Storage (the same Snake game, deployed and governed the same way on either cloud).
Project Overview
This snake game was 100% created using AI, including:
- Game logic and implementation
- UI/UX design with Dracula theme color scheme
- AWS infrastructure setup and configuration
- Debugging and bug fixes based on user feedback
- All infrastructure deployed through the Spacelift Intent MCP Server
What is Spacelift Intent?
Spacelift Intent is an MCP (Model Context Protocol) server that provides AI assistants with the ability to manage infrastructure through OpenTofu/Terraform. It handles:
- Resource lifecycle management (create, read, update, delete)
- Dependency tracking between resources
- Policy enforcement and validation
- State management
- Provider schema discovery
Replicating This Demo
Phase 1: Setup Intent Project
- Clone this repository to your local machine:
git clone git@github.com:spacelift-solutions/intent.git- cd into its directory before continuing (if you dont do this, the mcp server wont work correctly with claude code)
- Create a new Spacelift Intent Project in your Spacelift account (note its id for later)
- Create the intent policy for your target cloud in your Spacelift account:
- AWS:
block-public-s3-websites.rego - Azure:
block-public-azure-static-websites.rego
- AWS:
- Attach the policy to your Intent Project.
- Setup claude with your Spacelift Intent Server ex.
claude mcp add -t http spacelift https://spacelift-solutions.app.spacelift.io/intent/mcp - Ensure the MCP server is authenticated by starting a new claude code session and running
/mcp.
Phase 2: Start Demo and Demonstrate Blocking
- Start a new Claude Code session
- Request: "Use Spacelift Intent project
{your-intent-project-id}" - Request: "Let's deploy my snake game to Amazon S3"
- Observe: The AI will successfully create the S3 bucket, but policy violations will block:
aws_s3_bucket_website_configuration- Public hosting blockedaws_s3_bucket_public_access_block- Public access blocked (all 4 settings must betrue)aws_s3_bucket_policy- Public bucket policy blocked (Principal: "*" not allowed)
- The deployment will fail with clear policy violation messages
Phase 3: Remove Policy and Deploy Successfully
- Remove the policy from your Intent Project in Spacelift
- Request: "I've removed the policy, lets try deploying it now."
- Observe: All resources create successfully without policy blocking
- The snake game is now publicly accessible
Phase 4: Import Unmanaged Resources and Generate IaC
This phase demonstrates Intent's ability to adopt existing infrastructure and generate IaC code:
-
Create an unmanaged AWS resource outside Intent (e.g., via AWS console or CLI):
aws s3api create-bucket --bucket my-unmanaged-demo-bucket-$(date +%s) --region us-east-1Note the bucket name for the next step.
-
Request: "Import the existing S3 bucket
my-unmanaged-demo-bucket-XXXXXinto Intent" -
Observe: The AI will:
- Use
lifecycle-resources-importto bring the resource under management - Add it to the Intent state
- Show the imported resource configuration
- Use
-
Request: "Generate OpenTofu HCL code, including import blocks, into a file for all resources in this project"
-
Observe: The AI will:
- Retrieve state for all managed resources
- Generate proper HCL configuration with resource blocks
- Include resource dependencies and references
- Output ready-to-use
.tffiles
Phase 5: Cleanup
- Request: "Delete all resources in my Intent project"
- Confirm with:
CONFIRM
Azure Variant
The phases above use AWS. To run the same demo on Azure Blob Storage static website hosting, attach block-public-azure-static-websites.rego instead and use these requests. Everything else (project setup, removing the policy, import, IaC generation, cleanup) is identical.
Phase 2 (Azure): Start Demo and Demonstrate Blocking
- Request: "Use Spacelift Intent project
{your-intent-project-id}" - Request: "Let's deploy my snake game to Azure Blob Storage static website hosting"
- Observe: The AI creates the resource group and storage account, but policy violations block:
azurerm_storage_account_static_website- Public static website hosting blockedazurerm_storage_accountwithallow_nested_items_to_be_public = true- Public blob access blocked
- The deployment fails with clear policy violation messages
Phase 3 (Azure): Remove Policy and Deploy Successfully
- Remove the policy from your Intent Project in Spacelift
- Request: "I've removed the policy, lets try deploying it now."
- Observe: All resources create successfully; the game is served at the storage account's
primary_web_endpoint
Phase 4 (Azure): Import Unmanaged Resources and Generate IaC
- Create an unmanaged Azure resource outside Intent, e.g.:
az storage account create --name unmanageddemo$RANDOM --resource-group <rg> --location eastus - Request: "Import the existing storage account
<name>into Intent" - Request: "Generate OpenTofu HCL code, including import blocks, into a file for all resources in this project"
Phases 1 and 5 (setup and cleanup) are the same as the AWS track.
Key Demo Highlights
- Policy-as-Code: Rego policies provide governance and compliance guardrails
- Clear Violations: Policy messages explain exactly what's blocked and why
- Selective Enforcement: Policies allow private S3 buckets while blocking public ones
- AI Understanding: The AI interprets policy violations and explains them to users
- Flexible Governance: Policies can be attached/removed as needed per environment
Important: The README.md file contains implementation details that make for a less engaging demo. The CLAUDE.md file ensures the AI doesn't read this file unless explicitly requested.