Skip to content

feat: cross-platform support (Windows + Linux) + native service install#28

Merged
espetro merged 13 commits into
mainfrom
develop
Jul 5, 2026
Merged

feat: cross-platform support (Windows + Linux) + native service install#28
espetro merged 13 commits into
mainfrom
develop

Conversation

@espetro

@espetro espetro commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fixes real Windows compile blocker: syscall.SysProcAttr{Setpgid} in platforms/android doesn't build on Windows. Split into OS-specific procattr_unix.go/procattr_windows.go, plus portable Android SDK home-dir defaults.
  • controllers/agentdevice: replaced Unix-only pkill -f with a tracked cmd.Process.Kill() (cross-platform stdlib).
  • internal/config: os.Getenv("HOME")os.UserHomeDir() so default config path resolves on Windows too.
  • CI: new ubuntu/windows/macos build+vet+test matrix job to catch this class of regression going forward.
  • Docs: corrected wording — only the iOS adapter needs macOS; Android + agent-device already run everywhere.
  • New mcp-sim service install|uninstall|start|stop|restart|status|run subcommand via kardianos/service — installs mcp-sim as a launchd/systemd/Windows Service, with a --user flag for non-root installs on macOS/Linux. docs/launchd.md renamed to docs/service.md.

Tracked in #27.

Test plan

  • go build ./..., go vet ./..., task validate all green
  • Cross-compiles clean for GOOS=windows and GOOS=linux
  • Manual: mcp-sim serve boots iOS+Android+agentdevice adapters, /healthz reachable, graceful shutdown on signal
  • Manual: mcp-sim service install --user/start/status/stop/uninstall full cycle on macOS — install/uninstall confirmed; launchctl load runtime start needs an active GUI login session (works from a real Terminal, not from a sandboxed shell)
  • CI matrix green on all three runners (pending this PR's checks)

espetro added 13 commits July 5, 2026 15:28
syscall.SysProcAttr{Setpgid} doesn't compile on Windows. Extract
setProcAttr into OS-specific files (Setpgid on Unix, CREATE_NEW_PROCESS_GROUP
on Windows) and use runtime.GOOS to pick a real Android SDK home default on
Windows instead of only darwin/linux paths.
pkill -f is Unix-only and fragile (matches by command line, not the actual
child PID). Store the *exec.Cmd from Start() and kill it directly via
cmd.Process.Kill(), which is cross-platform stdlib.
os.Getenv("HOME") is unset on Windows (USERPROFILE is used instead), so
default config-file discovery silently no-op'd there. os.UserHomeDir()
resolves the right env var per OS.
New job builds/vets/tests on ubuntu/windows/macos to catch OS-specific
compile regressions (e.g. the Setpgid/Windows breakage this branch fixes)
going forward. task validate stays ubuntu-only since its golangci-lint
and Taskfile vars aren't guaranteed on native Windows runners.
Only the iOS adapter needs macOS (Xcode/xcrun). Android and the
agent-device controller already work cross-platform.
Add `mcp-sim service install|uninstall|start|stop|restart|status|run` via
github.com/kardianos/service, so a single command registers mcp-sim as a
launchd service (macOS), systemd service (Linux), or Windows Service —
covering all three OSes the server now runs on. A `--user` flag installs a
per-user service (LaunchAgent / systemd --user) that doesn't need root.

Extracted the registry/HTTP-server wiring shared by "serve" and the new
service program into internal/bootstrap, and rename docs/launchd.md to
docs/service.md now that it covers all three platforms.
Homebrew/GitHub Releases are the primary install paths; go install is a
source-build fallback, not the recommended default.
Builds docs/ via docmd (task docs-build) and publishes through the
actions/upload-pages-artifact + actions/deploy-pages flow, avoiding a
branch-commit deploy hack.

Refs #29
procattr split (procattr_unix.go/procattr_windows.go) and cross-platform
adapters already support Windows; GoReleaser was still darwin/linux-only.
@espetro
espetro merged commit e316c1b into main Jul 5, 2026
8 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.

1 participant