fix(mcp): suggest an explicit Official Registry retry on catalog miss - #2803
Open
vedanth bora (VedanthB) wants to merge 1 commit into
Open
fix(mcp): suggest an explicit Official Registry retry on catalog miss#2803vedanth bora (VedanthB) wants to merge 1 commit into
vedanth bora (VedanthB) wants to merge 1 commit into
Conversation
vedanth bora (VedanthB)
requested a review
from Daniel Meppiel (danielmeppiel)
as a code owner
September 4, 2026 13:11
vedanth bora (VedanthB)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
September 4, 2026 13:11
vedanth bora (VedanthB)
force-pushed
the
fix/2478-official-registry-hint
branch
from
September 4, 2026 13:11
4caeade to
4d89e20
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new CHANGELOG entry does not follow the file’s existing “end with PR number” formatting pattern, so it should be adjusted for consistency/traceability.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR improves the UX of direct apm install --mcp NAME when the default GitHub MCP catalog misses an exact server name by printing a safe, copyable retry command that explicitly targets the Official MCP Registry (without any automatic cross-registry fallback).
Changes:
- Add an optional, direct-install-only hint path that prints
Try: apm install --mcp "NAME" --registry https://registry.modelcontextprotocol.ioon default-catalog misses for validated server names. - Thread a
soft_wraprendering option through the console/info logger boundary to keep the retry command as a single literal line. - Add unit coverage for direct vs manifest installs, override suppression, unsafe name suppression, and Click round-trip behavior; update docs + changelog.
File summaries
| File | Description |
|---|---|
| tests/unit/install/test_mcp_registry_config_layer.py | Adds regression tests for default-catalog misses, official-retry rendering, override suppression, and safety/determinism. |
| src/apm_cli/utils/console.py | Adds soft_wrap support to Rich-backed echo/info rendering. |
| src/apm_cli/registry/client.py | Introduces OFFICIAL_MCP_REGISTRY_URL and centralizes server-name validation via is_valid_mcp_server_name; improves hint text for flag source. |
| src/apm_cli/integration/mcp_integrator_install.py | Emits the explicit official-registry retry hint only for direct default-registry misses with validated names. |
| src/apm_cli/core/null_logger.py | Keeps logger facade signature-compatible while supporting soft_wrap info rendering. |
| src/apm_cli/core/command_logger.py | Exposes keyword-only soft_wrap option for info messages. |
| docs/src/content/docs/reference/cli/install.md | Documents the explicit retry behavior and clarifies no automatic registry switching. |
| CHANGELOG.md | Adds an Unreleased entry describing the new direct-install retry hint behavior. |
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
vedanth bora (VedanthB)
force-pushed
the
fix/2478-official-registry-hint
branch
from
September 5, 2026 07:06
4d89e20 to
2e4b6cf
Compare
vedanth bora (VedanthB)
force-pushed
the
fix/2478-official-registry-hint
branch
from
September 5, 2026 07:12
2e4b6cf to
23bf784
Compare
Author
|
@microsoft-github-policy-service agree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(mcp): suggest an explicit Official Registry retry on catalog miss
TL;DR
Direct
apm install --mcp NAMEfailures against the built-in GitHub MCP catalog now show a literal command that retries the same canonical server name against the Official MCP Registry. The retry remains an explicit user decision: APM does not switch registries or make a second request automatically. Manifest installs, registry overrides, and unsafe names retain the existing generic guidance.Note
This implements the accepted hint-only option from #2478; automatic cross-registry fallback remains out of scope.
Fixes #2478
Problem (WHY)
Server(s) not found in registrywith no concrete recovery step.The issue's triage panel accepted an exact retry hint as the bounded first step because it improves first-install DevX without changing registry semantics or policy.
Approach (WHAT)
--mcpprevalidation against the canonical default source.src/apm_cli/registry/client.pysrc/apm_cli/utils/console.pytests/unit/install/test_mcp_registry_config_layer.pyImplementation (HOW)
src/apm_cli/integration/mcp_integrator_install.pydefaultregistry source and an entirely canonical missing-name batch.src/apm_cli/registry/client.pyfullmatchvalidator used by both URL construction and retry rendering. Adds the existingflagsource to registry URL diagnostics so the printed--registryretry follows the normal CLI path.src/apm_cli/utils/console.pysoft_wrapoption through the info renderer, defaulting to the existing behavior.src/apm_cli/core/command_logger.pysrc/apm_cli/core/null_logger.pyCommandLogger.tests/unit/install/test_mcp_registry_config_layer.pydocs/src/content/docs/reference/cli/install.mdCHANGELOG.mdDiagrams
Legend: dashed nodes are the new recovery boundary; the first branch to inspect is whether the request is a direct default-catalog miss.
flowchart LR subgraph Resolve[Resolve] A["apm install --mcp NAME"] B[prevalidate_registry_dependencies] C[_validate_registry_servers] M["manifest apm install"] end subgraph Decide[Decide] D{"direct hint enabled, default source, canonical names"} end subgraph Render[Render] E["Try command with Official Registry"] F[generic search guidance] end subgraph UserChoice[User choice] G["run copied command"] H["Official Registry request"] end A --> B B --> C M --> C C --> D D -->|all true| E D -->|otherwise| F E --> G G --> H classDef new stroke-dasharray: 5 5; class D,E new;Trade-offs
Benefits
api.mcp.github.com; the copied retry contacts onlyregistry.modelcontextprotocol.io.explicit,flag,env,config, and unknown) are regression-tested to suppress the hint.Validation
uv run pytest tests/unit/install/test_mcp_registry_config_layer.py -q:Full unit suite after rebasing onto current `main` (21,383 collected items)
uv run pytest tests/unit -n auto --dist worksteal:Additional repository gates
The lifecycle smoke suite passed 131 tests and skipped one. Its one remaining failure is environment-only: the Mac mini does not have PowerShell for
test_claude_project_hook_runs_from_external_cwd; the failure is outside the changed paths.Scenario Evidence
tests/unit/install/test_mcp_registry_config_layer.py::test_direct_default_miss_prints_round_trippable_official_retry(regression-trap for #2478)tests/unit/install/test_mcp_registry_config_layer.py::test_direct_default_miss_prints_round_trippable_official_retrytests/unit/install/test_mcp_registry_config_layer.py::test_manifest_default_registry_miss_keeps_generic_guidancetests/unit/install/test_mcp_registry_config_layer.py::test_registry_override_miss_does_not_suggest_another_registrytests/unit/install/test_mcp_registry_config_layer.py::test_official_retry_rejects_unsafe_server_namestests/unit/install/test_mcp_registry_config_layer.py::test_default_registry_miss_suggests_ordered_exact_name_retriesHow to test
apm install --mcp ado-mcpwith no registry override against a catalog where it is absent; expect one literalTry:line and no Official Registry request.https://registry.modelcontextprotocol.io.MCP_REGISTRY_URLor--registryset; expect the selected registry to remain authoritative and no Official Registry hint.apm mcp searchguidance and noTry:line.Pull request checklist
Type of change
Testing
Spec conformance (OpenAPM v0.1)
AI-assisted review disclosure: GPT-5.6 Sol and Claude Opus were used as independent reviewers; the contributor remains responsible for the change.