AI & Agent Workflows
Overview
Section titled “Overview”AI-assisted development workflows need a fast and secure environment to develop and test in. Whether you’re using an AI coding assistant to generate infrastructure code, running an agent that deploys AWS resources, or validating AI-generated IaC before applying it to real AWS — LocalStack gives you a safe, fast, cost-free environment to run these workflows in.
Connect an AI coding assistant via MCP
Section titled “Connect an AI coding assistant via MCP”The LocalStack MCP Server is a Model Context Protocol (MCP) server that connects compatible clients (Claude, Cursor, Windsurf, and others) to your LocalStack environment. It gives agents tools to run the full local cloud lifecycle—not only generating infrastructure code, but starting the container, deploying and tearing down IaC, analyzing logs, and more. See Introducing the LocalStack MCP Server for the original announcement and walkthrough.
With the MCP server configured, your assistant can use tools such as:
- Lifecycle — Start, stop, restart, or check status of the LocalStack container
- Deploy — Deploy or destroy CDK, Terraform, SAM, or CloudFormation projects on LocalStack
- Operations — Analyze logs, run AWS CLI commands via
awslocal, manage Cloud Pods, and (where supported) IAM policy analysis, chaos injection, and docs search
…and many more.
MCP Server Prerequisites
Section titled “MCP Server Prerequisites”Before you begin, make sure these are installed and in your system’s PATH:
- Node.js (v20.x or later) to run the
npxcommand. - LocalStack CLI and Docker to manage the LocalStack container itself.
cdklocalortflocalto use thelocalstack-deployertool. (optional)- A LocalStack Auth Token to enable licensed features. (optional)
MCP Server Configuration
Section titled “MCP Server Configuration”Add a server entry like this to your client’s MCP configuration—for Cursor, this would typically be ~/.cursor/mcp.json.
For Claude Code, register the server with claude mcp add (it is saved to your project-level MCP configuration).
{ "mcpServers": { "localstack-mcp-server": { "command": "npx", "args": ["-y", "@localstack/localstack-mcp-server"], "env": { "LOCALSTACK_AUTH_TOKEN": "<YOUR_TOKEN>" } } }}Full prerequisites, Cursor/VS Code/Claude Code variants, custom endpoints (LOCALSTACK_HOSTNAME, LOCALSTACK_PORT), troubleshooting, and the complete tool reference are on LocalStack MCP Server.
Deploy with agent-driven automation using Skills
Section titled “Deploy with agent-driven automation using Skills”LocalStack Skills are pre-built agent skill definitions for deploying common AWS architectures locally. It contains skills for LocalStack lifecycle management, IaC deployment, state management and more. Skills can be used in combination with the MCP server to create a fully autonomous agent-driven workflow.
Skills are useful when:
- You want to scaffold a new local environment quickly without writing all the infrastructure code yourself
- You’re using an agent-first workflow and want LocalStack to be a first-class deployment target
- You want to iterate rapidly on architecture without touching real AWS
Browse the skills repository for available skills and setup instructions.
Validate AI-generated IaC before applying to AWS
Section titled “Validate AI-generated IaC before applying to AWS”A common pattern when using AI to generate Terraform, CDK, or CloudFormation is to deploy it to LocalStack first. This catches configuration errors, missing permissions, and service interaction bugs before you spend time (and money) deploying to real AWS.
The workflow is:
- Generate infrastructure code with your AI tool
- Deploy to LocalStack with
tflocal apply(Terraform),cdklocal deploy(CDK), or the AWS CLI - Run your integration tests against the local environment
- When everything passes, deploy to real AWS with confidence
See Tooling for the full list of LocalStack-aware wrappers for common IaC tools.
Summary
Section titled “Summary”| Use case | Tool |
|---|---|
| AI assistant that can inspect & manage local resources | LocalStack MCP Server |
| Agent-driven infrastructure deployment | LocalStack Skills |
| Validate AI-generated IaC safely | LocalStack + tflocal / cdklocal / awslocal |