Skip to content

Dockerize LocalStack MCP Server as a Self-Contained Image#36

Merged
HarshCasper merged 9 commits into
mainfrom
docker
Jun 17, 2026
Merged

Dockerize LocalStack MCP Server as a Self-Contained Image#36
HarshCasper merged 9 commits into
mainfrom
docker

Conversation

@HarshCasper

@HarshCasper HarshCasper commented May 31, 2026

Copy link
Copy Markdown
Member

Fixes DEVREL-292

Summary

  • add a Docker image (localstack/localstack-mcp-server, built for linux/amd64 and linux/arm64) that bundles the LocalStack CLI, awslocal, Terraform/tflocal, CDK/cdklocal, SAM/samlocal, the Snowflake snow CLI, and the Docker CLI, so Docker is the only thing needed on the host
  • start LocalStack as a sibling container through the mounted /var/run/docker.sock; the server and IaC CLIs reach it over host.docker.internal, set with LOCALSTACK_HOSTNAME and the --add-host aliases
  • inject the LocalStack endpoint plus credential and region defaults into the IaC CLIs (buildIacCliEnv) only in container mode, including the s3. endpoint and path-style S3 (patched into the bundled aws-cdk) so cdklocal asset uploads work
  • leave the npx/host setup unchanged: that env is added only when LOCALSTACK_HOSTNAME is not localhost, so host installs behave as before
  • build and test the image on PRs; on main and release tags, push it to Docker Hub (:latest and :sha-<short> from main, :X.Y.Z and :X.Y from tags) through a docker-push environment restricted to those refs, and sync the README to the Docker Hub page
  • add a test harness (tests/docker/validate-image.mjs) that drives the image over MCP stdio, including Terraform and CDK deploys against LocalStack, with sample projects under data/; document the setup in README.md and docs/DOCKER.md

@HarshCasper HarshCasper requested a review from remotesynth June 2, 2026 20:27
@remotesynth

Copy link
Copy Markdown
Collaborator

Love the idea but ran several tests of this and have a couple thoughts/issues:

  1. The configuration is pretty complex and I worry that may be a blocker to usage. I'm not sure if there is a way to simplify this, but it's very easy to mess up (I did multiple times before getting it right).
  2. I couldn't get it to deploy a CDK app. It says Deployer failed because cdklocal isn't installed. Checking prerequisites and installing it.. It then tried to go through a whole series of install processes (which I stopped).

@HarshCasper HarshCasper merged commit 7b83b82 into main Jun 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants