localstack / localstack/localstack-mcp-server

BUG | MCP can't find localStack container, expects a constant name

Open
#10 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
27
Forks
13
PR merge metrics
No merged PRs in 30d

Description

I've started working with localStack this week, after setting it up in a docker-compose file.
all the containers get a prefix name.

when I tried using the mcp, it couldn't find the running container.
after digging a bit and asking chat, it seems the issue is that the expected container name is hardcoded to be "localstack-main", and once I set the container name to that, the mcp had no issues.

file in question: src/lib/docker/docker.client.ts

  async findLocalStackContainer(): Promise<string> {
    const running = (await (this.docker.listContainers as any)({
      filters: { status: ["running"] },
    })) as Array<{ Id: string; Names?: string[] }>;

    const match = (running || []).find((c) =>
      (c.Names || []).some((n) => {
        const name = (n || "").startsWith("/") ? n.slice(1) : n;
        return name === "localstack-main";
      })
    );

    if (match) return match.Id as string;

    throw new Error("Could not find a running LocalStack container named 'localstack-main'.");
  }

this should be a configurable option.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/lib/docker/docker.client.ts at findLocalStackContainer and trace how the MCP server receives configuration. Replace the fixed localstack-main expectation with a configurable container name, preserving support for Docker Compose prefixes. Done means the MCP can find a running LocalStack container without requiring that exact name.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.