LocalStack 标志

LocalStack

组织
localstack

MCP Server for LocalStack

发布者localstack
代码仓库localstack-mcp-server
语言TypeScript
复刻数
13
星标数
27
可用工具
8
传输类型stdio
分类
许可协议Apache-2.0
链接
  • 将工具接入 AI 工作流

    LocalStack 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 8 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 27 个 Star 和 13 个 Fork。

LocalStack MCP Server

Let an AI agent manage and interact with LocalStack on your machine.

npm version License: Apache-2.0 MCP Registry

[!IMPORTANT] The LocalStack MCP server is currently available as an experimental public preview. For questions, issues or feedback, please utilize the LocalStack 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:

bash
npx -y @localstack/localstack-mcp-server init

The 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.

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 are failing. Read the LocalStack logs, find the permission errors, and generate an IAM policy that fixes them."
  • "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."

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 LocalStack for AWS container status 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.
  • 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.
  • 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:

[!NOTE] All tools in this MCP server require LOCALSTACK_AUTH_TOKEN.

Tool NameDescriptionKey Features
localstack-managementManages LocalStack runtime operations for AWS and Snowflake stacks- Execute start, stop, restart, and status checks- Integrate LocalStack authentication tokens- Inject custom environment variables- Verify real-time status and perform health monitoring
localstack-deployerHandles 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- Requires you to have cdklocal, tflocal, or samlocal installed in your system path
localstack-logs-analysisAnalyzes 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
localstack-iam-policy-analyzerHandles IAM policy management and violation remediation- Set IAM enforcement levels including enforced, soft, and disabled modes- Search logs for permission-related violations- Generate IAM policies automatically from detected access failures- Requires a valid LocalStack Auth Token
localstack-chaos-injectorInjects 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
localstack-cloud-podsManages 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
localstack-state-managementManages 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
localstack-extensionsInstalls, uninstalls, lists, and discovers LocalStack Extensions- Manage installed extensions (list, install, uninstall) inside the running container- Browse the LocalStack Extensions marketplace (available)- Requires a valid LocalStack Auth Token
localstack-ephemeral-instancesManages 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
localstack-aws-clientRuns AWS CLI commands inside the LocalStack for AWS container- Executes commands via awslocal inside the running container- Sanitizes commands to block shell chaining- Auto-detects LocalStack coverage errors and links to docs
localstack-aws-replicatorReplicates 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
localstack-app-inspectorInspects 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- Requires a valid LocalStack Auth Token and the App Inspector feature in the connected LocalStack license
localstack-docsSearches 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
localstack-snowflake-clientRuns 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- Check the Snowflake connection before running queries- Set optional database, schema, warehouse, and role context per query- Requires the Snowflake CLI (snow) and a valid LocalStack Auth Token

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 NameDescriptionArguments
infrastructure-testerDeploys an IaC project to LocalStack, validates declared resources with live AWS probes and App Inspector evidence, then writes and runs deterministic integration tests.iac_path (required), iac_type, test_language, test_framework, mode, services_focus, user_focus

Installation

Set up with the wizard (recommended)

The fastest way to install the MCP server is the interactive setup wizard:

bash
npx -y @localstack/localstack-mcp-server init

The wizard:

  • lets you choose how to run the server (npx on 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_TOKEN from 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:

bash
npx -y @localstack/localstack-mcp-server init --method npx --client cursor,claude-code --yes

To remove the server from your clients again:

bash
npx -y @localstack/localstack-mcp-server remove

Run 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.
  • cdklocal, tflocal, or samlocal installed in your system path if you want to deploy CDK, Terraform, or SAM projects
  • Snowflake CLI (snow) installed in your system path if you want to use the Snowflake tool
  • 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.

json
{
  "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:

json
{
  "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 Terraform/tflocal, CDK/cdklocal, SAM/samlocal, 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.

json
{
  "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",
        "s3.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 NameDescriptionDefault Value
LOCALSTACK_AUTH_TOKEN (required)The LocalStack Auth Token to use for the MCP serverNone
MAIN_CONTAINER_NAMEThe explicit LocalStack container name to use for Docker-based tools. When unset, the server auto-detects standard LocalStack containers such as localstack-main and localstack-aws, then LocalStack Docker images.Auto-detect
LOCALSTACK_IMAGE_NAME / IMAGE_NAMEDocker image the start action launches for the AWS stack. LOCALSTACK_IMAGE_NAME wins when both are set (beware: bare IMAGE_NAME is a common CI variable).localstack/localstack-pro:latest
LOCALSTACK_VOLUME_DIRHost directory mounted at /var/lib/localstack in the LocalStack container. Defaults to the same per-OS cache path the LocalStack CLI used (state carries over); inside Docker it defaults to the localstack-mcp named volume.Per-OS cache dir
GATEWAY_LISTENOverride the gateway port bindings for start (comma-separated [host]:port). When set, the implicit 443 binding is skipped.:4566,:443
DOCKER_HOSTDocker daemon endpoint used for all container operations (unix://, npipe://, tcp://).Platform default socket
DOCKER_SOCKHost path of the Docker socket mounted into the LocalStack container (for Lambda). Validated to exist when set explicitly./var/run/docker.sock
EXTERNAL_SERVICE_PORTS_START / _ENDInclusive host port range published for external services on start. Validated (1–65535, start ≤ end).4510 / 4560
MCP_ANALYTICS_DISABLEDDisable MCP analytics when set to 10
APP_INSPECTORSet to 1 in the LocalStack container environment to enable App Inspector by default across restarts. The MCP tool can also toggle App Inspector at runtime with set-status.0
AWS_ACCESS_KEY_ID (required for AWS Replicator tool)Source AWS access key used by AWS Replicator to read external AWS resourcesNone
AWS_SECRET_ACCESS_KEY (required for AWS Replicator tool)Source AWS secret access key used by AWS Replicator to read external AWS resourcesNone
AWS_DEFAULT_REGION (required for AWS Replicator tool)Source AWS region used by AWS ReplicatorNone

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/*.env config profiles and DOCKER_FLAGS are not read at start. Pass configuration through the envVars argument of the localstack-management start action, or set LOCALSTACK_-prefixed variables in the MCP server's environment (LocalStack aliases LOCALSTACK_<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 the LAMBDA_*/CFN_*/SNOWFLAKE_*/SF_* families).
  • Port 443 is published by default. If something else uses port 443 locally, set GATEWAY_LISTEN=:4566 to skip it.
  • If you previously used lstk, note the container the server creates is named localstack-main (externally started localstack-aws containers are still detected and managed; restart preserves their name, image, and volume).

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.

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 yarn
  • Build 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):
    bash
    yarn test:mcp:direct
  • Run Gemini-based MCP host evals:
    bash
    export GOOGLE_GENERATIVE_AI_API_KEY="<your-gemini-key>"
    export LOCALSTACK_AUTH_TOKEN="<your-localstack-auth-token>"
    yarn test:mcp:evals
  • Open the latest MCP Server Tester HTML report:
    bash
    npx mcp-server-tester open
  • Run both:
    bash
    yarn test:mcp

Notes:

  • MCP tests target the lifecycle-aware local server command node dist/cli.js by default.
  • LOCALSTACK_AUTH_TOKEN is required for all MCP tool usage and test suites.
  • You can override the target command with:
    • MCP_TEST_COMMAND
    • MCP_TEST_ARGS (space-separated arguments)

License

Apache License 2.0

安装

TypingMind
前提条件:

Node.js 18+

{
  "mcpServers": {
    "localstack-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@localstack/localstack-mcp-server"
      ]
    }
  }
}

可用工具

  • localstack-aws-client

    Executes an AWS CLI command against the running LocalStack container using the 'awslocal' wrapper.

  • localstack-chaos-injector

    Injects, manages, and clears chaos faults and network effects in LocalStack to test system resilience.

  • localstack-cloud-pods

    Manages LocalStack Cloud Pods with following actions: save, load, delete, reset

  • localstack-cloud-scanner

    Runs a Scout Suite security scan against the LocalStack environment to find cloud misconfigurations and security risks.

  • localstack-deployer

    Deploys or destroys AWS infrastructure on LocalStack using CDK or Terraform.

  • localstack-iam-policy-analyzer

    Configures LocalStack's IAM enforcement and analyzes logs to automatically generate missing IAM policies.

  • localstack-logs-analysis

    LocalStack log analyzer that helps developers quickly diagnose issues and understand their LocalStack interactions

  • localstack-management

    Manage LocalStack lifecycle: start, stop, restart, or check status

将 LocalStack MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 LocalStack 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请保持终端窗口及其中的进程运行。
3

将 LocalStack 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 LocalStack MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "localstack": {
      "command": "npx",
      "args": [
        "-y",
        "@localstack/localstack-mcp-server"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 LocalStack MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 LocalStack MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 LocalStack 帮我完成这项任务吗?
LocalStack
当然。我已阅读。
以下是我使用 LocalStack 得到的结果。

常见问题

LocalStack MCP 服务器有什么用途?

LocalStack 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 LocalStack MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您可以让 Claude、ChatGPT、Gemini 等不同 AI 模型,或您在 TypingMind 中配置的其他模型使用 LocalStack,而无需为每个模型单独配置 MCP 服务器。

为什么在 TypingMind 中使用 LocalStack MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是优秀的大语言模型聊天前端之一。连接 LocalStack 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 LocalStack MCP 连接到 TypingMind?

LocalStack 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

LocalStack MCP 在 TypingMind 中提供哪些工具?

LocalStack 提供 8 个 MCP 工具,您可以在 TypingMind 的插件页面启用这些工具,然后在聊天中使用,或将其分配给 AI 智能体。

使用 LocalStack MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行掌控模型提供商、API 密钥、提示词和 MCP 配置。如果 LocalStack 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇