Skip to content

feat(registry): add remove path for user-added custom registries (MCP-1057)#592

Merged
Dumbris merged 1 commit into
mainfrom
feat/registry-remove-source-1057
Jun 4, 2026
Merged

feat(registry): add remove path for user-added custom registries (MCP-1057)#592
Dumbris merged 1 commit into
mainfrom
feat/registry-remove-source-1057

Conversation

@Dumbris
Copy link
Copy Markdown
Member

@Dumbris Dumbris commented Jun 4, 2026

Summary

Adds the missing remove path for user-added custom registries (gap found during QA in MCP-1053). A custom registry added via registry add-source previously could not be removed through any supported surface — the only recourse was hand-editing config.db and restarting the daemon. This is the inverse operation, mirroring add-source exactly.

What's included (backend lane: internal/ + cmd/ + docs)

  • REST: DELETE /api/v1/registries/{id} — removes a custom/unverified source. Refuses built-ins via the same registry_shadows_builtin guard add-source uses (409), returns registry_not_found (404) for unknown ids, registries_locked (403) when the enterprise stub policy is set. Persisted copy-on-write via UpdateConfig (runtime-config-snapshot-COW rule), then SetRegistriesFromConfig so the source disappears immediately.
  • CLI: mcpproxy registry remove <id> (aliases rm, remove-source), daemon-required like add-source, with remove-specific error guidance.
  • cliclient: RemoveRegistrySource(ctx, id) wrapping the DELETE endpoint.
  • Shared server-side core: pure removeRegistrySourceFromConfig so CLI and REST produce an identical persisted config.
  • Docs + OpenAPI: docs/registries.md, docs/api/rest-api.md, and regenerated oas/swagger.yaml/docs.go in the same PR (ENG-9).

Removing a source does not touch any upstream servers already added from it.

Tests (TDD)

  • internal/server: pure removal-logic unit tests — removes custom, case-insensitive, refuses built-in, not-found, empty-id, refuses-locked, error-code mapping.
  • internal/httpapi: handler tests for 200 (removes custom, trusted=false), 409 (built-in), 404 (unknown).

Verification evidence

  • go test ./internal/server ./internal/httpapi ./internal/cliclient ./cmd/mcpproxy (new tests) — PASS
  • ./scripts/run-linter.sh0 issues
  • gofmt/go vet — clean
  • Binary E2E (TestBinaryStartupAndShutdown, TestMCPProtocolToolCalling) — PASS after building the binary

Note: TestRegistryAddCLIMissingInputE2E and the TestBinary*/TestMCPProtocol* suites fail on clean origin/main in this local environment (daemon socket-readiness / missing prebuilt binary preconditions) — verified independent of this change; they pass once the binary is built. CI runs in a clean environment.

Out of scope (follow-up)

  • Web UI affordance to remove a custom registry — frontend lane (frontend/src/), tracked as a separate follow-up issue for the Frontend engineer.

Related #MCP-1057

Custom registry sources added via `registry add-source` could not be
removed through any supported surface — the only recourse was hand-editing
config.db and restarting the daemon. Add the inverse remove operation:

- DELETE /api/v1/registries/{id} — removes a custom/unverified source,
  refusing built-ins via the same registry_shadows_builtin guard and
  returning registry_not_found (404) for unknown ids. Persisted
  copy-on-write like add-source.
- `mcpproxy registry remove <id>` CLI (aliases: rm, remove-source),
  daemon-required, with remove-specific error guidance.
- cliclient.RemoveRegistrySource wrapping the DELETE endpoint.
- Shared server-side derivation (removeRegistrySourceFromConfig) so CLI
  and REST produce identical persisted config.

Docs (registries.md, rest-api.md) and OpenAPI spec updated in the same PR.
The Web UI affordance is tracked as a separate frontend follow-up.

Related #MCP-1057
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: f63bc00
Status: ✅  Deploy successful!
Preview URL: https://53f7d2ee.mcpproxy-docs.pages.dev
Branch Preview URL: https://feat-registry-remove-source.mcpproxy-docs.pages.dev

View logs

@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 31.13772% with 115 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/mcpproxy/registry_cmd.go 0.00% 55 Missing ⚠️
internal/cliclient/client.go 0.00% 29 Missing ⚠️
internal/server/remove_registry_source.go 54.38% 25 Missing and 1 partial ⚠️
internal/httpapi/server.go 80.76% 3 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2026

📦 Build Artifacts

Workflow Run: View Run
Branch: feat/registry-remove-source-1057

Available Artifacts

  • archive-darwin-amd64 (28 MB)
  • archive-darwin-arm64 (25 MB)
  • archive-linux-amd64 (16 MB)
  • archive-linux-arm64 (14 MB)
  • archive-windows-amd64 (28 MB)
  • archive-windows-arm64 (24 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (21 MB)
  • installer-dmg-darwin-arm64 (19 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 26941081762 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

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