Skip to content

Add a Go launcher for cross-platform plugin use #18

Description

@willibrandon

pixel-plugin ships binaries for all platforms in its bin/ directory and uses a bash wrapper script (bin/pixel-mcp) to detect OS/arch and exec the right one. The plugin's .mcp.json then points to this wrapper as the MCP server command.

This breaks on Windows. Claude Code requires Git for Windows, but bash in the system PATH often resolves to the WSL bash proxy at C:\WINDOWS\system32\bash.exe rather than Git Bash. WSL bash can't handle the D:/SRC/... style paths that ${CLAUDE_PLUGIN_ROOT} expands to, so the MCP server fails to start. Hardcoding the Git Bash path (C:/Program Files/Git/bin/bash.exe) works but is fragile.

The proper fix is a small Go launcher binary (~30 lines) that replaces the bash wrapper. It uses runtime.GOOS and runtime.GOARCH to find and exec pixel-mcp-{os}-{arch}[.exe] in its own directory. Cross-compiled for all 5 target platforms, it gives pixel-plugin a native executable to point at from .mcp.json — no shell dependency, no path resolution issues.

What's needed in this repo:

A new cmd/pixel-mcp-launcher/main.go that detects the platform via Go's runtime package, constructs the expected binary name, and execs it with all args, stdin, stdout, and stderr passed through.

A make cross Makefile target that cross-compiles both the server and the launcher for darwin/amd64, darwin/arm64, linux/amd64, linux/arm64, and windows/amd64.

GoReleaser config updated to include the launcher binaries in releases.

Related: willibrandon/pixel-plugin#3

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestplatformPlatform-specific behavior or compatibility

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions