Skip to content

feat: install and validate MCP packages during crux mcp add#31

Open
kaushalpaneri wants to merge 12 commits into
mainfrom
fix/issue-27
Open

feat: install and validate MCP packages during crux mcp add#31
kaushalpaneri wants to merge 12 commits into
mainfrom
fix/issue-27

Conversation

@kaushalpaneri

Copy link
Copy Markdown
Contributor

Summary

Key changes

File Change
src/crux_cli/install.py New module: install_npm_package, install_uv_package, detect_and_install_deps, rollback_mcp_add
src/crux_cli/cli/commands/mcp.py Rewritten cmd_mcp_add to install before registering
src/crux_cli/health.py probe_mcp_server_detailed now accepts configurable timeout parameter
src/crux_cli/package_validation.py Deleted (replaced by install.py)
8 doc files Updated for new behavior, flag rename, and --skip-validation

Design decisions

  • No probe at registration: MCP servers often need auth before responding to protocol handshakes, so probing would produce false negatives. Use crux mcp status after auth is configured.
  • Install = validation: npm install -g and uv tool install exit codes are sufficient to verify packages exist and are installable. No need for separate registry checks.
  • --skip-validation: Keeps the escape hatch for edge cases without complicating the happy path.

Test plan

  • 441 tests passing (unit + integration)
  • Lint clean (ruff check + format)
  • crux mcp add foo --npm @modelcontextprotocol/server-memory installs and registers
  • crux mcp add bar --npm nonexistent-pkg-xyz fails with clear error
  • crux mcp add baz --npm nonexistent-pkg-xyz --skip-validation registers without install
  • crux mcp add qux --uv some-mcp-tool installs via uv tool install
  • GitHub clone with package.json auto-runs npm install

🤖 Generated with Claude Code

kaushalpaneri and others added 12 commits March 30, 2026 03:27
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The flags now reflect the package manager, not the runner command.
--npm installs via npm install -g, --uv installs via uv tool install.
The runtime commands (npx, uvx) remain unchanged internally.

Updated across all source, tests, docs, README, install.sh, and skills.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nstall.py

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…closes #28)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Install success/failure is sufficient validation. MCP servers often
need auth configured before they can respond to protocol handshakes,
so probing at registration time produces false negatives. Full
protocol probing is available via crux mcp status after auth setup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Removed probe and rollback from the design. Install exit codes are
sufficient validation. Protocol probing deferred to crux mcp status.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Updated mcp-add CLI docs, registry guide, quickstart, authentication
guide, changelog, README, install.sh, and home page to reflect that
crux mcp add now installs packages before registering, auto-detects
deps for github/local sources, and supports --skip-validation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant