Skip to content

crux mcp add: no package validation before registration #27

Description

@kaushalpaneri

Bug Report

Description

crux mcp add registers MCP servers with a ✅ success message even when the underlying package doesn't exist, is broken, or has never been verified to actually install and run.

Two Distinct Failures

Failure 1: Package doesn't exist on registry

crux mcp add foo --npx nonexistent-package-xyz
# Output: ✅ Registered MCP 'foo'
# But `npx -y nonexistent-package-xyz` fails with E404 — package not on npm
crux mcp add jobspy --uvx jobspy-mcp-server
# Output: ✅ Registered MCP 'jobspy'
# But `uvx jobspy-mcp-server` fails — only version was yanked from PyPI

Expected: Crux should check the package exists on the registry before saying ✅.

Failure 2: npx/uvx never actually runs at registration time

Even for packages that DO exist, crux mcp add --npx <pkg> only writes the package name to registry.json. It never actually runs npx -y <pkg> to:

  • Download and cache the package
  • Verify it installs without errors
  • Verify the binary/entrypoint exists

This means the first time the package actually runs is when an agent invokes it — and if it fails (wrong Node version, missing native deps, incompatible platform), the agent fails mid-task.

Similarly, crux mcp add --uvx <pkg> never runs uvx <pkg> to pre-install and validate.

Steps to Reproduce

# Register a real npm package
crux mcp add playwright --npx @playwright/mcp
# Output: ✅ Registered MCP 'playwright'
# But @playwright/mcp is NOT actually downloaded/cached yet
# First real download happens when an agent uses it

# Register a real uvx package
crux mcp add postgres --uvx postgres-mcp
# Output: ✅ Registered MCP 'postgres'
# But postgres-mcp is NOT actually installed yet
# First install attempt happens at runtime — and in this case,
# it FAILS because pglast C extension doesn't compile on Python 3.14

Expected Behavior

crux mcp add --npx <pkg> should:

  1. Run npx -y <pkg> --help (or equivalent dry-run) to verify the package downloads and the entrypoint exists
  2. If it fails, report the error and don't register
  3. If it succeeds, cache the package and register

crux mcp add --uvx <pkg> should:

  1. Run uvx <pkg> --help (or equivalent) to verify installation
  2. If it fails (yanked version, build error, incompatible Python), report and don't register
  3. If it succeeds, register

Actual Behavior

Registration is purely a write to registry.json. No validation, no download, no installation. All failures are deferred to runtime.

Impact

During a real setup session:

  • jobspy-mcp-server via --npx: registered ✅, but npm package doesn't exist (E404)
  • jobspy-mcp-server via --uvx: registered ✅, but only PyPI version was yanked
  • postgres-mcp via --uvx: registered ✅, but pglast fails to compile on Python 3.14

All three showed ✅ at registration. All three were broken. Discovered only through manual testing.

Environment

  • crux-cli version: latest
  • macOS (Apple Silicon)
  • Node.js v25.8.1
  • Python 3.14

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions