Skip to content

Add mcp init command to configure MCP clients#311

Open
gtsiolis wants to merge 1 commit into
mainfrom
pro-317-add-lstk-mcp-init-to-configure-mcp-clients-for-the
Open

Add mcp init command to configure MCP clients#311
gtsiolis wants to merge 1 commit into
mainfrom
pro-317-add-lstk-mcp-init-to-configure-mcp-clients-for-the

Conversation

@gtsiolis

@gtsiolis gtsiolis commented Jun 15, 2026

Copy link
Copy Markdown
Member

Summary

Adds lstk mcp init — configures the user's installed MCP clients (Cursor, Claude Code, Claude Desktop, VS Code, Codex) to launch the LocalStack MCP server, so coding agents can drive LocalStack with one command.

This is a native Go reimplementation of the standalone setup wizard in localstack/localstack-mcp-server (PR #40), not a wrapper around npx … init. Rationale: lstk is a self-contained Go binary that has never required Node, and the users most likely to run this (Homebrew / raw-binary installs) often have no Node; reimplementing natively keeps the binary self-contained, reuses the auth token lstk already resolves (no token prompt), and matches lstk's output/sink house style.

What's included

  • lstk mcp namespace + init verb.
  • Docker-default server config so no Node is needed; --method npx switches to the host-Node launcher. The localstack/localstack-mcp-server image is now published publicly on Docker Hub, so the Docker-default path works end-to-end (verified: the generated entry matches the published image's stdio contract, and the server reports LocalStack v0.5.0 exposing 14 tools).
  • Adapters in internal/mcpconfig/: file-based JSON (Cursor, Claude Desktop, VS Code — VS Code uses the divergent servers + type: stdio schema) and CLI-managed shell-out (Claude Code, Codex via their own mcp add).
  • Flags: --method, --client, --token, --image-tag, --cache-dir, --workspace, --config KEY=VALUE. Auto-configures all detected clients by default.
  • Entry kept byte-compatible with the npm wizard (key localstack, same specs) so the two installers are interchangeable.
  • Secret-safe: token written 0600 and redacted from error output; Docker socket grant disclosed in output + help.

Follow-ups

  • lstk mcp remove and lstk mcp status.
  • Harden the Docker default: pin --image-tag to a release tag (e.g. 0.5) instead of the moving latest (which tracks the server repo's main); pre-pull the image during init so the first client launch doesn't race the MCP initialize timeout (~10–60s depending on client) on the cold pull; add --init to the docker run args (PID-1 reaper, avoids orphaned containers on client exit).
  • Potentially convert the MCP server itself to Go as lstk mcp serve — first-party and engineering-owned, replacing the TypeScript @localstack/localstack-mcp-server. init would then default to --method lstk, pointing clients at lstk itself.

Closes PRO-317.

@gtsiolis gtsiolis marked this pull request as draft June 15, 2026 18:45
@gtsiolis gtsiolis added the docs: needed Pull request requires documentation updates label Jun 15, 2026
@gtsiolis gtsiolis force-pushed the pro-317-add-lstk-mcp-init-to-configure-mcp-clients-for-the branch from 8943617 to 78a211a Compare June 15, 2026 19:10
@gtsiolis gtsiolis changed the title feat: add lstk mcp init to configure MCP clients for the LocalStack MCP server Add mcp init command to configure MCP clients Jun 15, 2026
@gtsiolis gtsiolis force-pushed the pro-317-add-lstk-mcp-init-to-configure-mcp-clients-for-the branch 3 times, most recently from 0714fb4 to 7151747 Compare June 15, 2026 19:29
@gtsiolis gtsiolis self-assigned this Jun 16, 2026
@gtsiolis gtsiolis force-pushed the pro-317-add-lstk-mcp-init-to-configure-mcp-clients-for-the branch from 7151747 to b673d89 Compare June 18, 2026 08:40
@gtsiolis gtsiolis force-pushed the pro-317-add-lstk-mcp-init-to-configure-mcp-clients-for-the branch from b673d89 to f48ac8e Compare June 18, 2026 09:15
@gtsiolis gtsiolis marked this pull request as ready for review June 18, 2026 09:17
@gtsiolis

Copy link
Copy Markdown
Member Author

Thoughts, friends? 😁

@anisaoshafi anisaoshafi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know how to test this properly, but the lstk mcp init properly configures the agent config files. I think it looks good 💯

})
sink.Emit(output.MessageEvent{
Severity: output.SeveritySecondary,
Text: "The first run pulls " + DockerImage + " — give it a minute.",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: this message is unclear; what is the first run? First lstk run or first agent run? Could you rephrase?
Image

@carole-lavillonniere carole-lavillonniere left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 Could we just add a few lines to our readme about it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs: needed Pull request requires documentation updates semver: patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants