Skip to content

fix(catalog): make the CLI first-run catalog door work as printed [HOLD until E3 measurement release] - #1939

Draft
Dumbris wants to merge 6 commits into
mainfrom
fix/catalog-first-run-door
Draft

Dumbris wants to merge 6 commits into
mainfrom
fix/catalog-first-run-door

Conversation

@Dumbris

@Dumbris Dumbris commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

HOLD: do not merge before the E3 measurement release ships and Algis approves the onboarding rollout.
E3 sequencing: the instrumentation (Spec 126 PR-A, mcpproxy-telemetry#13, mcpproxy-dash#15) ships first, so the baseline is measured before any first-run change. This PR changes first-run CLI behaviour and copy, so it is held as a draft until then. There is no feature flag: holding the PR is the mechanism.

Summary

The smallest in-product first-run slice of Spec 126 (#1712). It makes the CLI catalog door work as printed, and gives an empty install a next step. Each item was found by walking a clean install on main (58a824e, fresh data dir).

  1. The catalog ref that catalog search prints now resolves (closes the Spec 126 FR-003 door defect).
    • The reference catalog ids already carry the source (reference/time). So mcpproxy catalog add reference/time failed with server not found in registry, and only reference/reference/time worked.
    • registries.FindServerByID now accepts the source-prefixed alias. An exact id wins. The alias is matched in the same listing, so there is no extra fetch, and it cannot match another source's entry. This is the shared resolution path, so REST and MCP adds get the fix too.
  2. The add hint now names the step that admits the server.
    • It used to say approve with: mcpproxy upstream approve <name>. That command only approves pending tools: it prints Approved 0 tools, and the server stays quarantined.
    • It now says mcpproxy review show <name> and then mcpproxy review approve <name> --yes, matching upstream add.
    • The catalog and registry help text and docs/features/registry-add.md are updated to match.
  3. An empty upstream list gives a next step (Spec 126 US2 on the CLI; partly meets FR-008).
    • The hint is skipped for --profile, and for a client that actually sends an agent-token key. Socket connections are administrator.
    • In config-file mode (no daemon) the hint starts with mcpproxy serve.
  4. access explain points a quarantined server at mcpproxy review approve <server> instead of upstream approve, which leaves the server quarantined.
    • Before, it printed only No results found.
    • Table output now suggests one credential-free reference server through the catalog door. It picks reference/time when uvx is on PATH, otherwise reference/sequentialthinking when npx is (FR-002 order), and says so when neither is present.
    • It also suggests upstream add <name> <url> and catalog search.
    • JSON/YAML output and --status-filtered empty lists are unchanged.

Deliberately left out

  • Quarantine, trust-mode and scan behaviour. Nothing is added, run or approved automatically. The suggested server goes through the normal catalog door: quarantined, scanned, and admitted only by an explicit review approve.
  • The starter offer itself (FR-001, FR-004 to FR-007, FR-009 core launcher resolution, FR-010, FR-012 endpoint) and the Web and native surfaces. The CLI hint is static and is not the FR-012 offer decision. The first-run gap write-up on docs(spec): day-two activation (E3) #1712 lists these.
  • Onboarding facts and telemetry, which are owned by the activation-baseline workstream.

Tests (failing first)

  • internal/registries:
    • TestFindServerByID_AcceptsSourcePrefixedReferenceID;
    • TestFindServerByIDInSource_ExactMatchWins.
  • cmd/mcpproxy:
    • TestRegistryAddMessage, extended to require review show / review approve --yes and to reject upstream approve;
    • TestFirstServerHint (uvx / npx only / no launcher);
    • TestOutputServers_EmptyListPrintsFirstServerHint (also checks the filtered-empty and JSON cases).

Each failed on main for the stated reason before the fix.

Gates:

  • golangci-lint v2 with .github/.golangci.yml, bare and --build-tags server: 0 issues;
  • go test -race ./internal/registries/...: ok;
  • go test ./cmd/mcpproxy/...: ok.
  • ./scripts/test-api-e2e.sh (ports 18731/18732, at 557e164): 77 passed, 0 failed.

Manual run, on a fresh data dir with the built binary: empty upstream list hint → catalog add reference/time (as printed) → hint naming review show / review approve --yes → review show time (clean, 3 tools) → review approve time --yes → time:get_current_time called over MCP successfully.

Review

Each round was a fresh-context Claude Opus 5.5 reviewer, working read-only; most rounds also ran the tests and used a mutation check.

Round Head Verdict Fixed in
r1 557e164 2 low: an empty --profile list got the hint; a vacuous --status test. Same-class gap: the access explain hint 1f64b5d
r2 1f64b5d 2 low: no-daemon mode needed serve; a scoped agent token got the hint f542824
r3 f542824 2 low: the hint was decided from the env, not the key actually sent; wiring untested fab3a97
r4 fab3a97 1 low: the runUpstreamList wiring had no test 7d4dfc7 (unix-socket end-to-end test, mutation-checked)
r5 7d4dfc7 1 low: a test leaked the registry list 43369d9
r6 43369d9 CLEAN —

Known limit (existing behaviour, not caused by this PR): review approve <name> --yes allows only read-only tools with a clean scan by default.

  • mcp-server-time tools are annotated read-only, so the uvx route admits them.
  • An older, unannotated sequential-thinking build would be admitted with its one tool blocked. The CLI prints this ("Allowing 0 of 1 tool; blocking 1"), and --all lets the user opt in.

Found on a clean-install walk-through of main (Spec 126 E3):

- catalog search prints reference ids that already carry the source
  ('reference/time'), but 'catalog add reference/time' failed with
  'server not found in registry'; only 'reference/reference/time'
  worked. FindServerByID now accepts the source-prefixed alias, matched
  in the same listing (exact id wins, no extra fetch), so every add
  surface resolves the id as printed.
- The add hint said 'approve with: mcpproxy upstream approve <name>',
  which approves pending tools only: on a quarantined server it prints
  'Approved 0 tools' and the server stays quarantined. It now names
  'review show' and 'review approve --yes', like 'upstream add'; help
  text and docs/features/registry-add.md follow.
- An install with no servers got only 'No results found' from
  'upstream list'. Table output now prints next steps: one
  credential-free reference server through the catalog door (time if
  uvx is on PATH, else sequentialthinking if npx is, Spec 126 FR-002
  order), a remote add, and catalog search. The hint adds, runs and
  approves nothing; quarantine, trust mode and the scan are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dumbris added a commit that referenced this pull request Nov 19, 2026
Maps a clean-install walk-through of main 58a824e to FR-001..FR-017
(met / partly met / missing, with evidence), lists the in-product gaps
left (starter G1, CLI second client G2, opaque refusal for client
credentials G3), notes the FR-002 audited tool list is stale
(mcp-server-time now also has get_time_ago), and records the
sequencing: measurement first, #1939 held.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 43369d9
Status: ✅  Deploy successful!
Preview URL: https://44059037.mcpproxy-docs.pages.dev
Branch Preview URL: https://fix-catalog-first-run-door.mcpproxy-docs.pages.dev

View logs

Dumbris and others added 5 commits November 19, 2026 14:10
- An empty 'upstream list --profile <p>' is that profile's servers, not
  an empty install: no first-server hint there. The --status guard was
  vacuous (the check runs before filtering) and is gone; the test now
  covers --profile.
- 'access explain' told a quarantined-server target to run
  'mcpproxy upstream approve <server>', which leaves it quarantined; it
  now says 'mcpproxy review approve <server>'. Tool targets keep
  'upstream approve <server> <tool>'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- No daemon (config-file mode): the hint now starts with 'mcpproxy
  serve', since catalog add and review need the core.
- An agent token in MCPPROXY_API_KEY sees only the servers it may see:
  an empty list is not an empty install and catalog add is not its
  operation, so no hint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
'upstream list' now takes the endpoint and key from daemonEndpoint and
passes the key to runUpstreamListClientMode, so a socket connection (no
key, administrator) gets the empty-install hint even with an agent token
exported, and only an mcp_agt_ key the client really sends suppresses
it. agentTokenInEnv is gone. A new test drives both list paths
(config-file mode and client mode against an httptest daemon with no
key, the admin key and an agent token).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… hint

Review r4: the wiring in runUpstreamList (which key reaches
runUpstreamListClientMode) was untested. The new test serves an empty
server list on a unix socket, exports an agent token, and asserts the
socket admin still gets the hint; passing the env-derived key instead
fails it.
Review r5: use withTestRegistries so the package global is restored.
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: fix/catalog-first-run-door

Available Artifacts

  • archive-darwin-amd64 (33 MB)
  • archive-darwin-arm64 (30 MB)
  • archive-linux-amd64 (20 MB)
  • archive-linux-arm64 (18 MB)
  • archive-windows-amd64 (33 MB)
  • archive-windows-arm64 (29 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (29 MB)
  • installer-dmg-darwin-arm64 (26 MB)
  • smart-mcp-proxymcpproxy-go6BP06I.dockerbuild (0 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 44524634454 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 95.83333% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/registries/search.go 75.00% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

This branch has not been deployed

No deployments
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.

2 participants