Bug Description
The megg setup command registers the MCP server with the wrong npx command, causing the MCP server to fail to connect.
Expected Behavior
MCP server should start successfully after running megg setup.
Actual Behavior
MCP server fails to connect with "Failed to connect" error.
$ claude mcp list
Checking MCP server health...
megg: npx -y megg@latest - ✗ Failed to connect
Root Cause
In build/commands/setup.js, the registerMcpServer() function uses:
spawnSync('claude', ['mcp', 'add', 'megg', '--', 'npx', '-y', 'megg@latest'], ...)
This has two problems:
-
megg@latest runs the CLI, not the MCP server
- Looking at
package.json, there are two binaries:
megg → ./build/cli.js (CLI tool)
megg-mcp → ./build/index.js (MCP server)
- The command
npx -y megg@latest runs the CLI, which exits immediately
-
megg-mcp is not a standalone npm package
- Running
npx -y megg-mcp fails because there's no npm package called megg-mcp
- It's just a binary exported by the
megg package
Environment
- megg version: 1.1.0
- OS: macOS (Homebrew install)
- Claude Code version: 2.1.20
Bug Description
The
megg setupcommand registers the MCP server with the wrong npx command, causing the MCP server to fail to connect.Expected Behavior
MCP server should start successfully after running
megg setup.Actual Behavior
MCP server fails to connect with "Failed to connect" error.
Root Cause
In
build/commands/setup.js, theregisterMcpServer()function uses:This has two problems:
megg@latestruns the CLI, not the MCP serverpackage.json, there are two binaries:megg→./build/cli.js(CLI tool)megg-mcp→./build/index.js(MCP server)npx -y megg@latestruns the CLI, which exits immediatelymegg-mcpis not a standalone npm packagenpx -y megg-mcpfails because there's no npm package calledmegg-mcpmeggpackageEnvironment