feat: add cross-platform launcher for plugin use#25
Open
trostmarvin wants to merge 1 commit into
Open
Conversation
pixel-plugin ships per-platform server binaries and selects one via a bash wrapper script, which native Windows cannot execute — the MCP server never starts and no tools are exposed (willibrandon/pixel-plugin#3). Add cmd/pixel-mcp-launcher: a small native binary that detects the platform via runtime.GOOS/GOARCH, locates pixel-mcp-{os}-{arch}[.exe] next to its own resolved location, and runs it with args, stdio, and environment passed through. On Unix it execs the server in place; on Windows it stays as parent and propagates the child's exit code. Also add a `make cross` target building server and launcher for all five release platforms, and publish launcher binaries via GoReleaser. Closes willibrandon#18 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #18.
What
cmd/pixel-mcp-launcher: a small native binary that detects the platform viaruntime.GOOS/runtime.GOARCH, locatespixel-mcp-{os}-{arch}[.exe]next to its own (symlink-resolved) location, and runs it with args, stdio, and environment passed through. On Unix itexecs the server in place so signals and exit codes belong to the server process directly; on Windows it stays as parent and propagates the child's exit code.make crosstarget: cross-compiles server and launcher for darwin/amd64, darwin/arm64, linux/amd64, linux/arm64, windows/amd64.Why
pixel-plugin's
.mcp.jsonpoints atbin/pixel-mcp, a bash wrapper that native Windows cannot spawn — the MCP server never starts and no tools are exposed (willibrandon/pixel-plugin#3). A native launcher removes the shell dependency entirely.Shipped in the plugin as
bin/pixel-mcp.exe, it also gives.mcp.jsona single cross-platform command: Windows appends.exewhen spawning the extensionless${CLAUDE_PLUGIN_ROOT}/bin/pixel-mcppath and gets the launcher, while Unix executes the existing wrapper at the same path.Testing
go test -race ./cmd/pixel-mcp-launcher/— all pass;go vet/gofmtclean;goreleaser checkpasses).pixel-mcp.exe(launcher) next topixel-mcp-windows-amd64.exe, driven over a nativecmd.exepipe — correctinitializeresponse through the launcher.--plugin-dirwith a patched pixel-plugin: all 50mcp__aseprite__tools exposed. Control run without the launcher exe: 0 tools.One note from the investigation: the shipped
pixel-mcp-windows-amd64.exev0.5.0 answers MCP stdio correctly when driven with clean pipes — the earlier "server writes nothing to stdout" reports appear to be PowerShell test-harness artifacts, not a server bug.Companion plugin PR: uses this launcher and removes the
${HOME}env block that fails validation on native Windows.🤖 Generated with Claude Code