LocalStack MCP Server
OfficialThis server lets an AI agent manage LocalStack and operate emulated AWS resources for development, testing, and debugging.
Start, stop, restart, and check LocalStack status, with optional environment variables.
Run AWS CLI commands against LocalStack.
Deploy or destroy CDK, Terraform, and CloudFormation stacks.
Analyze LocalStack logs for summaries, errors, requests, or raw output.
Configure IAM enforcement and generate missing IAM policies from access failures.
Inject, inspect, and clear chaos faults and network latency.
Save, load, delete, and reset LocalStack Cloud Pods.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@LocalStack MCP Server start the LocalStack container and show its status"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
LocalStack MCP Server
Let an AI agent manage and interact with LocalStack on your machine.
The LocalStack MCP server is currently available as an experimental public preview. For questions, issues or feedback, please utilize theLocalStack Community slack or submit a GitHub Issue
LocalStack emulates the cloud on your local machine so software teams and AI agents can validate security, quality, and reliability faster and more safely than the cloud allows. This Model Context Protocol (MCP) server lets any MCP client (Cursor, Claude, VS Code, and more) start LocalStack, deploy infrastructure, and debug your local cloud in natural language.
Quick start
Set up the server in your MCP client with the interactive wizard:
npx -y @localstack/localstack-mcp-server initThe wizard detects your installed clients, asks how you want to run the server, and writes the configuration for you. You need a LocalStack Auth Token; the wizard reads LOCALSTACK_AUTH_TOKEN from your environment or asks for it. For the full options, prerequisites, and manual setup, see Installation.
Related MCP server: AWS MCP Server
What you can ask your agent
Once the server is configured, talk to LocalStack through your agent in natural language:
"Start LocalStack and deploy the Terraform project in
./infra, then tell me which resources came up.""My Lambda calls fail with AccessDenied. Find out which policy denies them and fix the project's IAM policies."
"Generate a least-privilege policy for what this workload actually does."
"Inject 500ms of latency into DynamoDB and confirm my retry logic still works."
"Search the LocalStack docs for how to enable S3 event notifications and summarize the steps."
"Start the LocalStack Azure emulator, create a resource group and a storage account, and upload
./data/sample.csvto a new blob container."
How it works
The server connects MCP-compatible apps directly to your local LocalStack environment and its emulated AWS services, so your assistant can operate the stack securely without custom scripts or manual setup.
This server eliminates custom scripts and manual LocalStack management. Your agent can:
Start, stop, restart, and monitor the LocalStack for AWS, Snowflake and Azure emulators with built-in auth.
Deploy CDK, Terraform, and SAM projects with automatic configuration detection.
Search LocalStack documentation for guides, API references, and configuration details.
Explain IAM denials from LocalStack's policy evaluations: the policies that decided a request, the suggested fix, and least-privilege policies derived from a run.
Inject chaos faults and network effects into LocalStack to test system resilience.
Manage LocalStack state snapshots via Cloud Pods for development workflows.
Export, import, inspect, and reset LocalStack state locally with Export & Import State file-based workflows.
Install, remove, list, and discover LocalStack Extensions from the marketplace.
Launch and manage Ephemeral Instances for remote LocalStack testing workflows.
Replicate external AWS resources into LocalStack with AWS Replicator so IaC stacks can resolve shared dependencies locally.
Inspect LocalStack application flows with App Inspector traces, spans, events, payload metadata, and IAM policy evaluations with suggested fixes.
Start repeatable LocalStack workflows from ready-made MCP prompts, including infrastructure validation and integration test generation.
Tools
This server provides your AI with dedicated tools for managing your LocalStack environment:
All tools in this MCP server requireLOCALSTACK_AUTH_TOKEN.
Tool Name | Description | Key Features |
Manages LocalStack runtime operations for AWS, Snowflake and Azure stacks | - Execute start, stop, restart, and status checks- Integrate LocalStack authentication tokens- Inject custom environment variables- Verify real-time status and perform health monitoring | |
Handles infrastructure deployment to LocalStack for AWS environments | - Automatically run CDK, Terraform, and SAM tooling to deploy infrastructure locally- Enable parameterized deployments with variable support- Process and present deployment results- Runs | |
Analyzes LocalStack for AWS logs for troubleshooting and insights | - Offer multiple analysis options including summaries, errors, requests, and raw data- Filter by specific services and operations- Generate API call metrics and failure breakdowns- Group errors intelligently and identify patterns | |
Handles IAM policy management and violation remediation; | - Set IAM enforcement levels including | |
Injects and manages chaos experiment faults for system resilience testing | - Inject, add, remove, and clear service fault rules- Configure network latency effects- Comprehensive fault targeting by service, region, and operation- Built-in workflow guidance for chaos experiments- Requires a valid LocalStack Auth Token | |
Manages remote LocalStack Cloud Pods for development workflows | - Save current state as a Cloud Pod- Load previously saved Cloud Pods instantly- Delete Cloud Pods from remote cloud-backed storage- Use this for managed remote state snapshots, not local export/import files- Requires a valid LocalStack Auth Token | |
Manages local file-based LocalStack state export/import workflows | - Export LocalStack state to a local file on disk through the LocalStack State REST API- Import LocalStack state from a local file- Inspect current LocalStack state as JSON metamodel data- Reset all state or only selected services- Supports service-level granularity for export, reset, and inspect- Use this for local disk workflows; use Cloud Pods for remote cloud-backed snapshots- Requires a valid LocalStack Auth Token | |
Installs, uninstalls, lists, and discovers LocalStack Extensions | - Manage installed extensions ( | |
Manages cloud-hosted LocalStack Ephemeral Instances | - Create temporary cloud-hosted LocalStack instances and get an endpoint URL- List available ephemeral instances, fetch logs, and delete instances- Supports lifetime, extension preload, Cloud Pod preload, and custom env vars on create- Requires a valid LocalStack Auth Token | |
Runs AWS CLI commands against LocalStack for AWS | - Executes commands with the official AWS CLI v2 through | |
Runs Azure CLI ( | - Runs the Azure CLI installed on your machine with its own profile, never your Azure login- Blocks shell syntax and commands that would change the profile, install software or never end- Uses the extensions you installed with | |
Replicates external AWS resources into a running LocalStack instance | - Start single-resource replication jobs with a resource type and identifier or ARN- Start batch replication jobs, such as SSM parameters under a path prefix- Poll job status by job ID and list existing jobs- List resource types supported by the running Replicator extension- Reads source AWS credentials from the MCP server environment and supports optional target account or region overrides | |
Inspects LocalStack application traces, spans, events, and IAM evaluations | - Enable or disable App Inspector for the running LocalStack instance- List and inspect traces to understand AWS service-to-service flows- Drill into spans, events, payload metadata, and IAM policy evaluation events- Filter by service, region, operation, resource, ARN, status, and time range- IAM: set the enforcement mode ( | |
Searches LocalStack documentation through CrawlChat | - Queries LocalStack docs through a public CrawlChat collection- Returns focused snippets with source links only- Helps answer coverage, configuration, and setup questions without requiring LocalStack runtime | |
Runs SQL against the LocalStack Snowflake emulator through the | - Execute SELECT, DDL (CREATE/DROP), DML (INSERT/UPDATE/DELETE), and SHOW/DESCRIBE statements from a query string or a |
Prompts
Prompts are user-selected workflow templates exposed by MCP clients as slash commands or quick actions. They frame multi-step LocalStack tasks so the assistant follows the same phases, evidence requirements, and reporting format every time.
Prompt Name | Description | Arguments |
| Deploys an IaC project to LocalStack, validates declared resources with live AWS probes and App Inspector evidence, then writes and runs deterministic integration tests. |
|
Installation
Set up with the wizard (recommended)
The fastest way to install the MCP server is the interactive setup wizard:
npx -y @localstack/localstack-mcp-server initThe wizard:
lets you choose how to run the server (
npxon your machine, or the self-contained Docker image),checks the prerequisites (Node.js, Docker) and tells you how to fix anything missing,
picks up your
LOCALSTACK_AUTH_TOKENfrom the environment, or asks for it,lets you pass extra LocalStack config (e.g.
DEBUG=1,PERSISTENCE=1),detects your installed MCP clients (Cursor, Antigravity, Claude Code, Claude Desktop, VS Code, Codex, OpenCode, Amazon Q CLI) and writes the right configuration for each one you select.
It can also run fully non-interactively, e.g. in dotfiles or scripts:
npx -y @localstack/localstack-mcp-server init --method npx --client cursor,claude-code --yesTo remove the server from your clients again:
npx -y @localstack/localstack-mcp-server removeRun npx -y @localstack/localstack-mcp-server init --help for all options.
Prerequisites
Docker installed and running. The MCP server manages the LocalStack container directly through the Docker API.
lstk(npm install -g @localstack/lstk) and the AWS CLI v2 if you want to run AWS CLI commands or deploy CloudFormation stacks, plus the Terraform, AWS CDK (2.177.0 or newer), or AWS SAM (1.95.0 or newer) CLI in your system path if you want to deploy Terraform, CDK, or SAM projectsSnowflake CLI (
snow) installed in your system path if you want to use the Snowflake toolAzure CLI (
az) installed in your system path if you want to use the Azure tool (see docs/AZURE.md)A valid LocalStack Auth Token configured as
LOCALSTACK_AUTH_TOKEN(required for all MCP tools)Node.js v20 or higher installed in your system path
Run with npx
Add the following to your MCP client's configuration file (e.g., ~/.cursor/mcp.json). This configuration uses npx to run the server, which will automatically download and install the package if needed. The server manages LocalStack through your Docker daemon; any deployment CLIs used by tools run from your host PATH.
{
"mcpServers": {
"localstack": {
"command": "npx",
"args": ["-y", "@localstack/localstack-mcp-server"],
"env": {
"LOCALSTACK_AUTH_TOKEN": "<YOUR_TOKEN>"
}
}
}
}All LocalStack MCP tools require LOCALSTACK_AUTH_TOKEN to be set. You can get your LocalStack Auth Token by following the official documentation.
Run from source
If you installed from source, change command and args to point to your local build:
{
"mcpServers": {
"localstack": {
"command": "node",
"args": ["/path/to/your/localstack-mcp-server/dist/cli.js"],
"env": {
"LOCALSTACK_AUTH_TOKEN": "<YOUR_TOKEN>"
}
}
}
}Run with Docker
The localstack/localstack-mcp-server Docker image bundles lstk with the AWS CLI v2, Terraform, CDK, and SAM, and the Snowflake CLI. The only required host dependency is Docker. The container uses the mounted Docker socket to run LocalStack as a sibling container on the host; state lives in a named Docker volume (localstack-mcp) unless LOCALSTACK_VOLUME_DIR points at a host directory.
If you use the deployer tool with local Terraform, CDK, or SAM projects, bind-mount those project paths into the MCP container and pass the in-container path to the tool. The simplest convention is to mount projects at the same absolute path they use on the host.
{
"mcpServers": {
"localstack": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"/var/run/docker.sock:/var/run/docker.sock",
"--add-host",
"host.docker.internal:host-gateway",
"--add-host",
"snowflake.localhost.localstack.cloud:host-gateway",
"-e",
"LOCALSTACK_AUTH_TOKEN",
"-e",
"LOCALSTACK_HOSTNAME=host.docker.internal",
"-v",
"/Users/you/projects:/Users/you/projects",
"localstack/localstack-mcp-server:latest"
],
"env": { "LOCALSTACK_AUTH_TOKEN": "<YOUR_TOKEN>" }
}
}
}See docs/DOCKER.md for the run command, MCP client config, IaC project mounts, CDK notes, and troubleshooting.
LocalStack configuration
Variable Name | Description | Default Value |
| The LocalStack Auth Token to use for the MCP server | None |
| Host name of the LocalStack gateway the tools call; in Docker, |
|
| Port of the LocalStack gateway the tools call. |
|
| Container name for Docker-based tools and the container | Auto-detect |
| Docker image the |
|
| Host directory mounted at | Per-OS cache dir |
| Override the gateway port bindings for |
|
| Docker daemon endpoint used for all container operations ( | Platform default socket |
| Host path of the Docker socket mounted into the LocalStack container (for Lambda). Validated to exist when set explicitly. |
|
| Inclusive host port range published for external services on |
|
| Disable MCP analytics when set to |
|
| Set to |
|
| Source AWS access key used by AWS Replicator to read external AWS resources | None |
| Source AWS secret access key used by AWS Replicator to read external AWS resources | None |
| Source AWS region used by AWS Replicator | None |
| Docker image the | Latest Azure image |
| The | Found on |
| The Azure tool's own Azure CLI profile directory (default | Under |
| The directory the AWS client tool runs the AWS CLI in. Local files a command reads or writes ( | The server's working directory |
| The directory the Azure tool runs | The server's working directory |
| Time limit for one Azure CLI command (5–3600). |
|
See docs/AZURE.md for how the Azure tool runs the Azure CLI.
Migration notes (CLI-free lifecycle)
Since v0.6.0 the MCP server no longer uses (or requires) the localstack CLI. The LocalStack container is created directly through the Docker Engine API. Behavioral differences from CLI-driven starts:
~/.localstack/*.envconfig profiles andDOCKER_FLAGSare not read at start. Pass configuration through theenvVarsargument of thelocalstack-managementstart action, or setLOCALSTACK_-prefixed variables in the MCP server's environment (LocalStack aliasesLOCALSTACK_<NAME>to<NAME>natively).Besides
LOCALSTACK_*/PROVIDER_OVERRIDE_*, only a curated set of common unprefixed config variables is forwarded from the host environment (DEBUG,LS_LOG,SERVICES,PERSISTENCE,EAGER_SERVICE_LOADING,ENFORCE_IAM,IAM_SOFT_MODE,EXTENSION_AUTO_INSTALL,APP_INSPECTOR,DNS_ADDRESS,MAIN_DOCKER_NETWORK, and theLAMBDA_*/CFN_*/SNOWFLAKE_*/SF_*families).Port 443 is published by default. If something else uses port 443 locally, set
GATEWAY_LISTEN=:4566to skip it.The container the server creates is named
localstack-main, not lstk'slocalstack-aws. See Using lstk.
For AWS Replicator-specific source credentials, you can use the AWS_REPLICATOR_SOURCE_ prefixed variants instead of the unprefixed variants. Do not mix the prefixed and unprefixed source credential groups; when any AWS_REPLICATOR_SOURCE_ variable is set, the Replicator tool reads the source configuration only from that group.
Using lstk
lstk names its container localstack-{type}, such as localstack-aws, or localstack-{type}-{tag} when it runs a pinned tag. The server names the container it creates localstack-main. It finds lstk's containers under these names, or under any name by the cloud.localstack.lstk label lstk sets.
To have both tools manage one container, set lstk's container_name to localstack-main:
[[containers]]
type = "aws"
port = "4566"
container_name = "localstack-main"Then lstk finds the container by name, whichever tool started it.
Without that setting, the server still finds and manages lstk's container: stop and status act on it, restart keeps its name, image, volume and lstk's labels (the gateway moves to LOCALSTACK_PORT, where the tools reach it), and start reports it as a conflict when it holds a port start needs. When LOCALSTACK_PORT is set, the tools that use Docker (stop, restart, logs, the deployer and others) act only on a container that publishes that port, or that publishes no ports at all, such as one on the host network. lstk, for its part, falls back to the first running container with a standard LocalStack image that publishes port 4566, so it may find the server's container, or another one when several run.
The two tools keep state in different directories, even under one container name. lstk uses <cache dir>/lstk/volume/<derived name>, which does not change with container_name, and the server uses the LocalStack CLI's <cache dir>/localstack/volume. To share state, point one at the other: set volume in lstk's config, or LOCALSTACK_VOLUME_DIR for the server.
Contributing
Built on the XMCP framework, you can add new tools by adding a new file to the src/tools directory and documenting it in the manifest.json file.
Pull requests are welcomed on GitHub! To get started:
Install Git and Node.js
Clone the repository
Install dependencies with
yarnBuild with
yarn build
MCP Server Tester
This repository includes MCP Server Tester for tool validation in direct mode and LLM host mode.
Run direct MCP tests (deterministic):
yarn test:mcp:directRun each tool against a running LocalStack, without a model (deterministic; starts LocalStack if it isn't running):
export LOCALSTACK_AUTH_TOKEN="<your-localstack-auth-token>" yarn test:mcp:toolsThe tests deploy a sample project, switch IAM enforcement to soft mode and save a Cloud Pod, so point them at an instance you don't need: set
LOCALSTACK_PORTandMAIN_CONTAINER_NAMEto use one other than the default on 4566. SetMCP_TEST_RESTART_LOCALSTACK=1(as CI does) to let a test stop and start that instance, so the AWS client is checked against one the server started; without it the test uses the running instance. They need Docker, Terraform, the AWS CLI v2 and lstk on thePATH.Run MCP host evals through OpenRouter (default model
google/gemini-2.5-flash; setEVAL_MODELto any OpenRouter model ID to override it):export OPENROUTER_API_KEY="<your-openrouter-key>" export LOCALSTACK_AUTH_TOKEN="<your-localstack-auth-token>" yarn test:mcp:evalsThe evals check whether a model picks and combines the right tools for a goal; their prompts don't name the tools. They start, change and stop LocalStack on port 4566, so don't run them against an instance you're using. They need Docker, Terraform, the AWS CLI v2, lstk and the Snowflake CLI (
snow) on thePATH, and the sample project's providers downloaded withterraform -chdir=data/sample-terraform init. The MCP evals workflow runs them after every merge intomainthat changes the server, its tools or the evals, weekly and on demand; it needs theOPENROUTER_API_KEYrepository secret.Open the latest MCP Server Tester HTML report:
npx mcp-server-tester openRun all of them:
yarn test:mcp
Notes:
MCP tests target the lifecycle-aware local server command
node dist/cli.jsby default.LOCALSTACK_AUTH_TOKENis required for all MCP tool usage and test suites.You can override the target command with:
MCP_TEST_COMMANDMCP_TEST_ARGS(space-separated arguments)
License
Available Tools
7 toolslocalstack-aws-clientA
Executes an AWS CLI command against the running LocalStack container using the 'awslocal' wrapper.
Inputs: command (required).
localstack-chaos-injectorADestructive
Injects, manages, and clears chaos faults and network effects in LocalStack to test system resilience.
Inputs: action (required), rules, latency_ms.
localstack-cloud-podsBDestructive
Manages LocalStack Cloud Pods with following actions: save, load, delete, reset
Inputs: action (required), pod_name.
localstack-deployerADestructive
Deploys or destroys AWS infrastructure on LocalStack using CDK or Terraform.
Inputs: action (required), projectType, directory, variables, +2 more.
localstack-iam-policy-analyzerB
Configures LocalStack's IAM enforcement and analyzes logs to automatically generate missing IAM policies.
Inputs: action (required), mode.
localstack-logs-analysisBRead-onlyIdempotent
LocalStack log analyzer that helps developers quickly diagnose issues and understand their LocalStack interactions
Inputs: analysisType, lines, service, operation, +1 more.
localstack-managementA
Manage LocalStack lifecycle: start, stop, restart, or check status
Inputs: action (required), envVars.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a clearly distinct purpose with no overlap: AWS client execution, chaos injection, cloud pods management, infrastructure deployment, IAM policy analysis, log analysis, and lifecycle management. The descriptions clearly differentiate their domains and functions, making misselection unlikely.
All tools follow a consistent 'localstack-' prefix with descriptive hyphenated suffixes (e.g., aws-client, chaos-injector). This uniform pattern makes the tool set predictable and easy to navigate, with no deviations in naming style.
With 7 tools, the server is well-scoped for managing LocalStack, covering key areas like execution, testing, deployment, security, diagnostics, and lifecycle. Each tool earns its place without feeling excessive or insufficient for the domain.
The tool set provides comprehensive coverage for LocalStack management, including core operations, resilience testing, and diagnostics. A minor gap exists in direct resource management (e.g., creating or querying specific AWS services), but agents can work around this using the AWS client tool.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
The AWS Knowledge MCP server is a fully managed remote Model Context Protocol server that provides real-time access to official AWS content in an LLM-compatible format. It offers structured access to AWS documentation, code samples, blog posts, What's New announcements, Well-Architected best practices, and regional availability information for AWS APIs and CloudFormation resources. Key capabilities include searching and reading documentation in markdown format, getting content recommendations, listing AWS regions, and checking regional availability for services and features.
MCP server for building and testing AI agents with multi-model experimentation and insights.
The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.
Related MCP Servers
- AlicenseCqualityDmaintenanceA Model Context Protocol (MCP) server that enables AI assistants like Claude to interact with your AWS environment. This allows for natural language querying and management of your AWS resources during conversations. Think of better Amazon Q alternative.3296ISC
- AlicenseAqualityDmaintenanceA Model Context Protocol server implementation that enables Claude to perform AWS operations on S3 and DynamoDB services through natural language commands.23128MIT
- AlicenseCqualityDmaintenanceA Model Context Protocol server allowing Claude AI to interact with AWS resources through natural language, enabling users to query and manage AWS services without using the traditional AWS Console or CLI.36ISC
- FlicenseAqualityDmaintenanceA containerized Model Context Protocol server that enables using natural language to develop AWS infrastructure with Terraform, offering best practices guidance, security scanning with Checkov, and access to AWS provider documentation.7-