Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ jobs:
runs-on: ubuntu-26.04
env:
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
# The nightly image, as in every workflow here: the IAM features under test are on LocalStack's main branch
# before a release has them. The management tool's start and the port tests launch it.
LOCALSTACK_IMAGE_NAME: localstack/localstack-pro:dev

steps:
# GitHub gives pull requests from forks no secrets. Fail loud rather than skip, so a
Expand All @@ -95,7 +98,7 @@ jobs:

# Pulled up front so the start stays within the management tool's 120s.
- name: Pull the LocalStack image
run: docker pull localstack/localstack-pro:latest
run: docker pull "$LOCALSTACK_IMAGE_NAME"

- name: Run the tool tests
run: yarn test:mcp:tools
4 changes: 3 additions & 1 deletion .github/workflows/mcp-evals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ jobs:
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
EVAL_MODEL: ${{ inputs.model }}
# The nightly image, as in every workflow here; the management tool's start launches it.
LOCALSTACK_IMAGE_NAME: localstack/localstack-pro:dev
steps:
- name: Checkout code
uses: actions/checkout@v7
Expand All @@ -75,7 +77,7 @@ jobs:
# Pulled up front so a start inside a case doesn't time out on the download.
- name: Pull the LocalStack images
run: |
docker pull localstack/localstack-pro:latest
docker pull "$LOCALSTACK_IMAGE_NAME"
docker pull localstack/snowflake:latest

- name: Run the eval dataset
Expand Down
92 changes: 87 additions & 5 deletions AGENTS.md

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ The wizard detects your installed clients, asks how you want to run the server,
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 are failing. Read the LocalStack logs, find the permission errors, and generate an IAM policy that fixes them."
- "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.csv` to a new blob container."
Expand All @@ -46,14 +47,14 @@ This server eliminates custom scripts and manual LocalStack management. Your age
- 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.
- Parse logs, catch errors, and auto-generate IAM policies from violations.
- 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](https://docs.localstack.cloud/aws/capabilities/state-management/cloud-pods/) for development workflows.
- Export, import, inspect, and reset LocalStack state locally with [Export & Import State](https://docs.localstack.cloud/aws/capabilities/state-management/export-import-state/) file-based workflows.
- Install, remove, list, and discover [LocalStack Extensions](https://docs.localstack.cloud/aws/capabilities/extensions/) from the marketplace.
- Launch and manage [Ephemeral Instances](https://docs.localstack.cloud/aws/capabilities/cloud-sandbox/ephemeral-instances/) for remote LocalStack testing workflows.
- Replicate external AWS resources into LocalStack with [AWS Replicator](https://docs.localstack.cloud/aws/tooling/aws-replicator/) so IaC stacks can resolve shared dependencies locally.
- Inspect LocalStack application flows with [App Inspector](https://docs.localstack.cloud/aws/capabilities/web-app/app-inspector/) traces, spans, events, payload metadata, and IAM policy evaluations.
- Inspect LocalStack application flows with [App Inspector](https://docs.localstack.cloud/aws/capabilities/web-app/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
Expand All @@ -68,7 +69,7 @@ This server provides your AI with dedicated tools for managing your LocalStack e
| [`localstack-management`](./src/tools/localstack-management.ts) | Manages LocalStack runtime operations for AWS, Snowflake and Azure stacks | - Execute start, stop, restart, and status checks<br/>- Integrate LocalStack authentication tokens<br/>- Inject custom environment variables<br/>- Verify real-time status and perform health monitoring |
| [`localstack-deployer`](./src/tools/localstack-deployer.ts) | Handles infrastructure deployment to LocalStack for AWS environments | - Automatically run CDK, Terraform, and SAM tooling to deploy infrastructure locally<br/>- Enable parameterized deployments with variable support<br/>- Process and present deployment results<br/>- Runs `lstk terraform`, `lstk cdk`, or `lstk sam`, so it requires [`lstk`](https://docs.localstack.cloud/aws/developer-tools/running-localstack/lstk/) plus `terraform`, `cdk`, or `sam` in your system path |
| [`localstack-logs-analysis`](./src/tools/localstack-logs-analysis.ts) | Analyzes LocalStack for AWS logs for troubleshooting and insights | - Offer multiple analysis options including summaries, errors, requests, and raw data<br/>- Filter by specific services and operations<br/>- Generate API call metrics and failure breakdowns<br/>- Group errors intelligently and identify patterns |
| [`localstack-iam-policy-analyzer`](./src/tools/localstack-iam-policy-analyzer.ts) | Handles IAM policy management and violation remediation | - Set IAM enforcement levels including `enforced`, `soft`, and `disabled` modes<br/>- Search logs for permission-related violations<br/>- Generate IAM policies automatically from detected access failures<br/>- Requires a valid LocalStack Auth Token |
| [`localstack-iam-policy-analyzer`](./src/tools/localstack-iam-policy-analyzer.ts) | Handles IAM policy management and violation remediation; `localstack-app-inspector` is recommended for IAM | - Set IAM enforcement levels including `enforced`, `soft`, and `disabled` modes<br/>- Search logs for permission-related violations<br/>- Generate IAM policies automatically from detected access failures<br/>- Every response recommends the matching `localstack-app-inspector` action (`get-iam-mode`, `set-iam-mode`, `list-iam-denials`, `explain-iam`, `get-auto-derived-iam-policies`)<br/>- Requires a valid LocalStack Auth Token |
| [`localstack-chaos-injector`](./src/tools/localstack-chaos-injector.ts) | Injects and manages chaos experiment faults for system resilience testing | - Inject, add, remove, and clear service fault rules<br/>- Configure network latency effects<br/>- Comprehensive fault targeting by service, region, and operation<br/>- Built-in workflow guidance for chaos experiments<br/>- Requires a valid LocalStack Auth Token |
| [`localstack-cloud-pods`](./src/tools/localstack-cloud-pods.ts) | Manages remote LocalStack Cloud Pods for development workflows | - Save current state as a Cloud Pod<br/>- Load previously saved Cloud Pods instantly<br/>- Delete Cloud Pods from remote cloud-backed storage<br/>- Use this for managed remote state snapshots, not local export/import files<br/>- Requires a valid LocalStack Auth Token |
| [`localstack-state-management`](./src/tools/localstack-state-management.ts) | Manages local file-based LocalStack state export/import workflows | - Export LocalStack state to a local file on disk through the LocalStack State REST API<br/>- Import LocalStack state from a local file<br/>- Inspect current LocalStack state as JSON metamodel data<br/>- Reset all state or only selected services<br/>- Supports service-level granularity for export, reset, and inspect<br/>- Use this for local disk workflows; use Cloud Pods for remote cloud-backed snapshots<br/>- Requires a valid LocalStack Auth Token |
Expand All @@ -77,7 +78,7 @@ This server provides your AI with dedicated tools for managing your LocalStack e
| [`localstack-aws-client`](./src/tools/localstack-aws-client.ts) | Runs AWS CLI commands inside the LocalStack for AWS container | - Executes commands via `awslocal` inside the running container, against the gateway's in-container address (works with a remapped host port, `LOCALSTACK_HOST` or `GATEWAY_LISTEN`)<br/>- Sanitizes commands to block shell chaining<br/>- Auto-detects LocalStack coverage errors and links to docs |
| [`localstack-azure-client`](./src/tools/localstack-azure-client.ts) | Runs Azure CLI (`az`) commands against the LocalStack for Azure emulator | - Runs the Azure CLI installed on your machine with its own profile, never your Azure login<br/>- Blocks shell syntax and commands that would change the profile, install software or never end<br/>- Uses the extensions you installed with `az extension add`<br/>- Requires the Azure CLI and a valid LocalStack Auth Token |
| [`localstack-aws-replicator`](./src/tools/localstack-aws-replicator.ts) | Replicates external AWS resources into a running LocalStack instance | - Start single-resource replication jobs with a resource type and identifier or ARN<br/>- Start batch replication jobs, such as SSM parameters under a path prefix<br/>- Poll job status by job ID and list existing jobs<br/>- List resource types supported by the running Replicator extension<br/>- Reads source AWS credentials from the MCP server environment and supports optional target account or region overrides |
| [`localstack-app-inspector`](./src/tools/localstack-app-inspector.ts) | Inspects LocalStack application traces, spans, events, and IAM evaluations | - Enable or disable App Inspector for the running LocalStack instance<br/>- List and inspect traces to understand AWS service-to-service flows<br/>- Drill into spans, events, payload metadata, and IAM policy evaluation events<br/>- Filter by service, region, operation, resource, ARN, status, and time range<br/>- Requires a valid LocalStack Auth Token and the App Inspector feature in the connected LocalStack license |
| [`localstack-app-inspector`](./src/tools/localstack-app-inspector.ts) | Inspects LocalStack application traces, spans, events, and IAM evaluations | - Enable or disable App Inspector for the running LocalStack instance<br/>- List and inspect traces to understand AWS service-to-service flows<br/>- Drill into spans, events, payload metadata, and IAM policy evaluation events<br/>- Filter by service, region, operation, resource, ARN, status, and time range<br/>- IAM: set the enforcement mode (`get-iam-mode`, `set-iam-mode`), list denied requests (`list-iam-denials`), explain one with its deciding policies and LocalStack's suggested fix (`explain-iam`, `get-iam-policy`), and read or reset the least-privilege policies derived from a run (`get-auto-derived-iam-policies`, `reset-auto-derived-iam-policies`)<br/>- Requires a valid LocalStack Auth Token and the App Inspector feature in the connected LocalStack license; IAM details need a license that includes viewing IAM policy errors, and the policy summary needs IAM Policy Stream |
| [`localstack-docs`](./src/tools/localstack-docs.ts) | Searches LocalStack documentation through CrawlChat | - Queries LocalStack docs through a public CrawlChat collection<br/>- Returns focused snippets with source links only<br/>- Helps answer coverage, configuration, and setup questions without requiring LocalStack runtime |
| [`localstack-snowflake-client`](./src/tools/localstack-snowflake-client.ts) | Runs SQL against the LocalStack Snowflake emulator through the `snow` CLI | - Execute SELECT, DDL (CREATE/DROP), DML (INSERT/UPDATE/DELETE), and SHOW/DESCRIBE statements from a query string or a `.sql` file<br/>- Check the Snowflake connection before running queries<br/>- Set optional database, schema, warehouse, and role context per query<br/>- Requires the Snowflake CLI (`snow`) and a valid LocalStack Auth Token |

Expand Down
13 changes: 12 additions & 1 deletion REVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,18 @@ not compute it as a fallback.

## 6. IAM policies

No checks yet: they come with the IAM actions of `localstack-app-inspector`.
See "IAM policies" in AGENTS.md.

- **BLOCKER:** the tool changes LocalStack's suggestion for a denied request: drops, merges or reorders its changes,
or reports a different verdict on whether the changes fix the request. What the agent applies must be what LocalStack verified.
- **BLOCKER:** the tool computes a diff between suggested and deployed policies itself, instead of presenting one
that LocalStack returned.
- **SHOULD-FIX:** an auto-derived policy is presented as verified or complete, instead of as a suggestion from the
requests seen so far; or "unused permissions" is not qualified as unused in this run.
- **SHOULD-FIX:** an auto-derived policy is reshaped, for example by splitting a role's trust statement from its
permissions.
- **SHOULD-FIX:** a missing license feature (a 404 from the policy summary, or App Inspector unavailable) returns a
bare failure or an empty result instead of an `isError` response that names the feature and how to get it.

## 7. Tool contract

Expand Down
58 changes: 53 additions & 5 deletions data/evals/comprehensive.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
},
{
"id": "scenario-iam-soft-mode",
"description": "localstack-iam-policy-analyzer: switch IAM enforcement to soft mode from a symptom, not the mode's name.",
"description": "localstack-app-inspector: switch IAM enforcement to soft mode from a symptom, not the mode's name.",
"mode": "mcp_host",
"scenario": "My Lambda function keeps failing with AccessDenied errors in my local AWS emulator. Instead of blocking those calls, let them through and only log which permissions are missing. Then check which mode is active.",
"mcpHostConfig": {
Expand All @@ -125,16 +125,16 @@
"toolsTriggered": {
"calls": [
{
"name": "localstack-iam-policy-analyzer",
"arguments": { "action": "set-mode", "mode": "SOFT_MODE" },
"name": "localstack-app-inspector",
"arguments": { "action": "set-iam-mode", "mode": "SOFT_MODE" },
"required": true
}
],
"order": "any"
},
"matchesPattern": [
"\"output\":\"(?:[^\"\\\\]|\\\\.)*IAM enforcement mode has been set to `SOFT_MODE`",
"\"output\":\"(?:[^\"\\\\]|\\\\.)*\\*\\*Current Mode:\\*\\* `SOFT_MODE`"
"\"output\":\"(?:[^\"\\\\]|\\\\.)*## IAM Enforcement Updated",
"\"output\":\"(?:[^\"\\\\]|\\\\.)*\\*\\*Mode:\\*\\* `SOFT_MODE`"
]
}
},
Expand Down Expand Up @@ -201,6 +201,54 @@
"matchesPattern": ["\"output\":\"(?:[^\"\\\\]|\\\\.)*## Traces"]
}
},
{
"id": "scenario-iam-explain-denial",
"description": "localstack-app-inspector: find IAM denials from an AccessDenied symptom.",
"mode": "mcp_host",
"scenario": "A call in my local AWS emulator failed with AccessDenied. Which requests were denied, and what does LocalStack suggest to fix the permissions?",
"mcpHostConfig": {
"provider": "openrouter",
"model": "google/gemini-2.5-flash",
"temperature": 0
},
"expect": {
"toolsTriggered": {
"calls": [
{
"name": "localstack-app-inspector",
"arguments": { "action": "list-iam-denials" },
"required": true
}
],
"order": "any"
},
"matchesPattern": ["\"output\":\"(?:[^\"\\\\]|\\\\.)*## IAM Denials"]
}
},
{
"id": "scenario-auto-derived-iam-policies",
"description": "localstack-app-inspector: least-privilege policies auto-derived from requests.",
"mode": "mcp_host",
"scenario": "Which IAM permissions did my workload actually use in the local emulator? I want least-privilege policies to put into my infrastructure code.",
"mcpHostConfig": {
"provider": "openrouter",
"model": "google/gemini-2.5-flash",
"temperature": 0
},
"expect": {
"toolsTriggered": {
"calls": [
{
"name": "localstack-app-inspector",
"arguments": { "action": "get-auto-derived-iam-policies" },
"required": true
}
],
"order": "any"
},
"matchesPattern": ["\"output\":\"(?:[^\"\\\\]|\\\\.)*## Auto-derived IAM Policies"]
}
},
{
"id": "scenario-docs-search",
"description": "localstack-docs: a how-it-works question the docs answer, next to IAM tools that act on the running instance.",
Expand Down
Loading