Skip to content

feat(mcp-cli): add CLI management commands (#6350)#6787

Merged
Hundao merged 4 commits into
aden-hive:mainfrom
Antiarin:feat/mcp-registry-cli
Mar 26, 2026
Merged

feat(mcp-cli): add CLI management commands (#6350)#6787
Hundao merged 4 commits into
aden-hive:mainfrom
Antiarin:feat/mcp-registry-cli

Conversation

@Antiarin

Copy link
Copy Markdown
Collaborator

Description

Implement the hive mcp subcommand group with all P0/P1 management commands and shared CLI helpers for the MCP Server Registry.

Type of Change

  • New feature (non-breaking change that adds functionality)

Related Issues

Fixes #6350

Changes Made

  • Add core/framework/runner/mcp_registry_cli.py with 11 subcommands: install, add, remove, enable, disable, list, info, config, search, health, update
  • Register hive mcp command group in core/framework/cli.py
  • Shared helpers: registry init, index refresh with stale/no-cache semantics, first-use security notice, credential prompting, secret masking, agent usage detection via load_agent_selection()
  • update <name> bridge: remove+reinstall with override preservation and rollback on failure (proper version diffing deferred to [MCP Registry] Version compatibility, pinning & upgrade safety #6355)
  • update (no name) refreshes index and updates all non-pinned registry servers
  • --json on list, info, search, health with masked overrides
  • All errors follow DX-2: what failed, why, suggested fix

Testing

  • Unit tests pass (cd core && pytest tests/)
  • Lint passes (cd core && ruff check .)
  • Manual testing performed

58 tests in core/tests/test_mcp_registry_cli.py covering:

  • Real framework.cli.main() entrypoint dispatch
  • Real registry-on-disk integration (install, list, config, info, remove)
  • All 11 command handlers
  • Security notice, credential prompting, secret masking
  • Index refresh semantics (stale cache vs no cache)
  • Update rollback on reinstall failure
  • Pinned/local server rejection with correct remediation

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Implement the hive mcp subcommand group with shared helpers and all
P0/P1 management commands: install, add, remove, enable, disable,
list, info, config, search, health, update.

Includes update bridge (remove+reinstall with rollback on failure),
first-use security notice, credential prompting, secret masking,
and agent usage detection via load_agent_selection().
58 tests covering all commands end-to-end:
- Real framework.cli.main() entrypoint dispatch (list, install, update)
- Real registry-on-disk integration (install, list, config, info, remove)
- All 11 command handlers (install, add, remove, enable, disable, list,
  info, config, search, health, update)
- Security notice shown only once
- Credential prompting stores overrides, skips when env set, handles cancel
- Secret masking in human output, JSON output, and config display
- Index refresh semantics (stale cache fallback vs no-cache hard fail)
- Update rollback on reinstall failure preserves original entry
- Update rejects local servers and pinned servers with correct remediation
- Bulk update skips local and pinned servers
- Argparse registration validates all 11 subcommands present
- _find_agents_using_server resolves via real load_agent_selection
- _parse_key_value_pairs validates KEY=VAL format
…ate, defer security sentinel (aden-hive#6350)

- list --json now masks override values as <set> before emitting
- update preserves enabled=False state across reinstall
- security notice sentinel only written after successful install
…extract _mask_overrides helper (aden-hive#6350)

- Fix module docstring to reflect update's full behavior
- Pass registry instance to _cmd_mcp_update_server to avoid redundant disk I/O
- Extract _mask_overrides() used by list --json, info --json, info human, and config display
- Add comment about _find_agents_using_server path arithmetic limitation
@Antiarin
Antiarin marked this pull request as ready for review March 25, 2026 18:24
@Antiarin
Antiarin requested a review from TimothyZhang7 March 26, 2026 03:32
@Hundao
Hundao merged commit 5e31975 into aden-hive:main Mar 26, 2026
7 checks passed
@Antiarin
Antiarin deleted the feat/mcp-registry-cli branch April 7, 2026 19:29
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.

[MCP Registry] CLI management commands — install, add, remove, list, search, config

2 participants