Skip to content

Windows compatibility: MCP server bin entry needs Node.js wrapper #33

@KHAEntertainment

Description

@KHAEntertainment

Problem

The grok-swarm-mcp bin entry in package.json points directly to a Python file with a Unix shebang (#!/usr/bin/env python3). On Windows, shebangs aren't natively interpreted, so the installed CLI command won't work.

"bin": {
  "grok-swarm": "dist/index.js",
  "grok-swarm-mcp": "src/mcp/grok_server.py"   // ← broken on Windows
}

Additionally, scripts/postinstall.js references ./scripts/setup.sh which is also a bash script that won't execute on Windows. The os field in package.json includes "win32", so this is a declared-but-unsupported platform.

Proposed Fix

  1. Create a Node.js wrapper (bin/grok-swarm-mcp.js) that spawns the Python interpreter to run src/mcp/grok_server.py, trying python3 then python
  2. Update the grok-swarm-mcp bin entry to point to the JS wrapper
  3. Update postinstall.js to detect process.platform and use appropriate commands per OS

Context

Flagged by CodeRabbit on PR #32. The existing grok-swarm bin entry (dist/index.js) doesn't have this issue since it's already a Node script.

Labels

  • enhancement
  • compatibility

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions