Terraform pull request automation.
## Atlantis MCP Server: Terraform Pull Request Automation The **Atlantis MCP Server** integrates Atlantis pull request automation into Google Antigravity, enabling terraform plan and apply workflows directly from your development environment with full visibility into infrastructure changes. ### Why Atlantis MCP? - **PR Automation**: Automate terraform plan execution on pull request changes - **Team Collaboration**: Enable code review for infrastructure changes before apply - **Policy Enforcement**: Integrate with OPA/Conftest for policy-as-code validation - **Audit Trail**: Complete logging of who ran what terraform commands and when - **Multi-Repo Support**: Manage terraform workflows across multiple repositories ### Key Features #### 1. Plan Execution ```python # Trigger terraform plan on PR plan_result = await mcp.run_plan( repo="org/infrastructure", pull_request=42, workspace="production", directory="terraform/aws" ) # View plan output print(f"Plan status: {plan_result['status']}") print(f"Resources to add: {plan_result['additions']}") print(f"Resources to change: {plan_result['changes']}") print(f"Resources to destroy: {plan_result['destructions']}") ``` #### 2. Apply Management ```python # Apply approved changes apply_result = await mcp.apply( repo="org/infrastructure", pull_request=42, workspace="production", auto_merge=True # Merge PR after successful apply ) # Monitor apply progress async for log in mcp.stream_apply_logs(apply_result["run_id"]): print(log) ``` #### 3. Project Configuration ```python # List configured projects projects = await mcp.list_projects() for project in projects: print(f"Project: {project['name']}") print(f" Directory: {project['dir']}") print(f" Workspace: {project['workspace']}") print(f" Autoplan: {project['autoplan']}") ``` #### 4. Lock Management ```python # Manage workspace locks locks = await mcp.list_locks() for lock in locks: print(f"Locked by PR #{lock['pull_request']} in {lock['repo']}") # Unlock a workspace await mcp.unlock( repo="org/infrastructure", workspace="staging" ) ``` ### Configuration ```json { "mcpServers": { "atlantis": { "command": "npx", "args": ["-y", "@anthropic/mcp-atlantis"], "env": { "ATLANTIS_URL": "https://atlantis.yourcompany.com", "ATLANTIS_TOKEN": "your-api-token", "GITHUB_TOKEN": "your-github-token" } } } } ``` ### Use Cases **Infrastructure Review**: Automatically generate and display terraform plans on PRs, enabling team review of infrastructure changes before deployment. **GitOps Workflows**: Implement GitOps-style infrastructure management where merging PRs triggers automatic terraform apply. **Multi-Environment Deployment**: Coordinate terraform changes across development, staging, and production environments with workspace isolation. **Compliance Automation**: Enforce infrastructure policies and generate audit logs for compliance requirements in regulated industries. The Atlantis MCP enables GitOps-style infrastructure automation directly within your Google Antigravity development workflow.
{
"mcpServers": {
"atlantis": {}
}
}