Infrastructure as code management platform.
## Spacelift MCP Server: Infrastructure as Code Management The **Spacelift MCP Server** integrates the IaC management platform into Google Antigravity, enabling developers to manage Terraform, Pulumi, and CloudFormation stacks with policy enforcement and drift detection. ### Why Spacelift MCP? - **Multi-IaC** - Terraform, Pulumi, CloudFormation support - **Policy engine** - OPA-based policy enforcement - **Drift detection** - Automated infrastructure drift detection - **Stack management** - Organize infrastructure as stacks - **Run control** - Trigger and manage runs ### Key Features #### 1. Stack Management ```python # Create stack stack = await mcp.call("spacelift", "create_stack", { "name": "production-vpc", "repository": "org/infrastructure", "branch": "main", "project_root": "terraform/vpc" }) # Trigger run run = await mcp.call("spacelift", "trigger_run", { "stack": "production-vpc" }) print(f"Run ID: {run[\"id\"]}") ``` #### 2. Run Management ```python # Get run status status = await mcp.call("spacelift", "get_run", { "stack": "production-vpc", "run_id": run["id"] }) print(f"State: {status[\"state\"]}") # Confirm run (apply) await mcp.call("spacelift", "confirm_run", { "stack": "production-vpc", "run_id": run["id"] }) ``` #### 3. Drift Detection ```python # Check for drift drift = await mcp.call("spacelift", "detect_drift", { "stack": "production-vpc" }) if drift["has_drift"]: print("Drift detected!") for change in drift["changes"]: print(f" {change[\"resource\"]}: {change[\"change_type\"]}") # Schedule drift detection await mcp.call("spacelift", "schedule_drift_detection", { "stack": "production-vpc", "cron": "0 */4 * * *" }) ``` #### 4. Policy Management ```python # List policies policies = await mcp.call("spacelift", "list_policies", {}) # Attach policy to stack await mcp.call("spacelift", "attach_policy", { "stack": "production-vpc", "policy": "require-tags" }) ``` ### Configuration ```json { "mcpServers": { "spacelift": { "command": "npx", "args": ["-y", "@anthropic/mcp-spacelift"], "env": { "SPACELIFT_API_KEY_ID": "your-key-id", "SPACELIFT_API_KEY_SECRET": "your-secret", "SPACELIFT_API_ENDPOINT": "https://yourorg.app.spacelift.io" } } } } ``` ### Use Cases **IaC Orchestration**: Manage infrastructure stacks. **Policy Enforcement**: Enforce security policies. **Drift Management**: Detect and remediate drift. **Multi-Cloud IaC**: Unified IaC management. The Spacelift MCP Server enables IaC management at scale.
{
"mcpServers": {
"spacelift": {}
}
}